IBM
Skip to main content
 
Search IBM Research
     Home  |  Products & services  |  Support & downloads  |  My account
 Select a country
 IBM Home
IBM Research
Hypervisor
Search Research
Feedback
IBM Research
  Research Hypervisor
Research Hypervisor Hackers Guide

2. Tool-chain

The Research Hypervisor Project is dedicated to the Open Source Movement and restricts it primarily supports the features supported by popular Open Source Friendly tools. The tools that are needed to get, configure, build and test the Research Hypervisor is as follows:

Source Controller Manager

Unless you got this from a tarball, you are probably already familiar with our current SCM which is (for various reasons) CVS. Anonymous access to the repository is available to all and instructions can be found on the project web page. Developer access is restricted using SSH accounts in order to accept CVS commits "if you have to ask.. you'll never know".

Compiler

Though the project adheres to the ANSI C99 compiler, our reference compiler is the GNU C Compiler and we use many extensions that this compiler provides. However, in the case where GCC allows several ways to do something (eg. structure initializer notation) but the ANSI C99 Specification is explicit, the ANSI Spec shall be used.

Linker, Assembler and Object Tools

The project uses and adheres to the System V ELF ABI as defined for the processor that it is targeting. The tools for generating and manipulating these object files are supplied but the GNU Binutils package.

Cross Toolchain

It is expected that anytime the above tool-chain is available to generate code for another host it is expected to be use by Research Hypervisor. In fact most developers usually build using Cross Compilers.

Any toolchain (cross or not) that is capable of building a Linux kernel should be able to build Research Hypervisor. However, the ELF specific tool-chain configurations (such as i686-elf or powerpc-elf) are much simpler to build and can be easily hosted on alternate development environments including Apple's Mac OS X and Cygwin and for this reason, their use is encouraged.

Warning

It is known issue that the powerpc64-elf tool-chain configuration has yet to exist for GCC, which is sad since the powerpc64-linux GCC is the hardest to build.

Configuration

The GNU Autoconf [2] configuration tool is used in order describe the specific processor and machine environment that Research Hypervisor will be hosted on. Currently Autoconf Ver. 2.13 is only supported, it is a low priority task to update to the latest version.

The resulting configure script depends on a small Unix like environment that is restricted to POSIX features and any dependencies on specific GNU extensions of those commands is purely accidental.

Build

Research Hypervisor uses the GNU Make, currently the known minimal version is 3.79.1.

Note: It is a known problem that the current Makefiles do not support Research Hypervisor to be built in parallel. It is also desirable to design a Makefile infrastructure that is not recursive. If these topics interest you please contact a maintainer.

Running

Currently the resulting binary hype gets created in several forms that is usable by several systems and simulators. Research Hypervisor runs on various hardware [3] machines. The project members acknowledge that it is advantageous to be able to run on a simulator while developing for Research Hypervisor. Simulators generally allow you to run a specific build of Research Hypervisor anywhere as well as supply the developer with a machine level hook to debug the entire system. Frequently it is desirable to debug Research Hypervisor in this manner if the bug can be reproduced in the simulated environment.

The current X86 Research Hypervisor is known to work on BOCHS and QEMU full system simulators and both run on several platforms.

Note: It has also been shown that the Research Hypervisor can run in a VMware partition.

The current PPC Research Hypervisor runs on the Mambo 970 simulator that is currently available in binary only form.

Thinwire

Thinwire [4] is a character IO transport that can use any single transport to multiplex/de-multiplex several channels of character IO. The protocol is a designed to work under the worst conditions and is therefore slow and suitable only for character IO. The transports used by Thinwire vary from UARTs for HW, sockets for Mambo, PTYs for BOCHS.

The other side of the transport will take all the channels that are in use and open a listening socket using a port value that is the channel number plus some base offset. This listening socket can then be attached to with telnet, GDB or any other program that can interact with a socket to communicate with a channel source within the Hypervisor.

Debugger

The project is closely tied with to the GNU Project Debugger which can be built as a cross platform debugger but more importantly is capable of debugging remote victims. Most of the Simulators used by this project allow for GDB to control the simulated software. When on HW, the Hypervisor core is completely debugable using a Thinwire channel or other transport.

Note: The HW debugging is currently possible for PowerPC targets and the x86 work is in progress.


3. The Source Tree Layout

Research Hypervisor source tree is organized with the following objectives in mind:

  1. Isolation of the different modules. The source tree contains Build tools, TestOSes, plugins, and the Hypervisor core it is desirable to isolate the code that is independent to the module and place the shared code in the top level areas.

  2. Maximal use of code sharing. Where generic code would be automatically used unless a more customized implementations exists.

  3. To easily and accurately build the smallest most efficient Hypervisor where the source files that are use to create it can be easily identified and audited for security purposes.


3.1. Source Directory Skeletons

The core Hypervisor is concerned with the partitioning of memory and the accurate "time-slicing" of the processors. Therefore the Hypervisor must not only be aware of the differences in the ISA, but must be particularly aware of the differences between the specific chip implementation. For this reason we have organized the code in order to handle the "grey area" that represents the similarities and differences within the ISA.

The basic directory structure can be represented by the following:

./module/ISA/word-size/core/

The structure allows for a specific implementation of any programming interface to be customized down to the definition in the core/ directory. Each directory component is described below.


3.1.3. ./module/ISA/word-size/

The word-size directory is where the "native machine word size" is defined. Any any differences in the architecture relating to the code that executes to take advantage of this difference.

Currently, the expectation is that we are only running processors that are capable of 32 or 64 bits or both. [5]

Important: It is by design that the code assumes that this "machine word" is the most efficient arithmetic integer size, is sufficient to access all of addressable memory from the view of the software program and can be expressed by a C pointer type and the project base type uval. See Base Types below.

The above assumption contribute to a programming model that maximizes the portability objectives of Research Hypervisor and is independent of the model used by the OSes running on top of Hypervisor. However, it does specify the the use of registers when an OS makes a call into the Hypervisor.

Note: In the case of the 64 bit extensions of the Intel® x86 architecture, it is expected that any 64 bit specific details would be introduced in ./module/x86/64/.

Note: It is expected that any differences between the two known 64 bit x86 architecture extensions (i.e. Intel® EM64T and AMD Athelon/Hammer) shall be introduced in at this level since they are indeed architecture. However, specific core details would appear in the core directories below.


3.2. Modules

The project is currently broken up into the following directories that represent these "modules".


3.2.1. The Root Directory ./

Starting at the top level the source tree we find the introductory files to the source:

./DeadDirs

One of the problems with CVS is that it does not handle the removal of directories very well. So when a directory is removed it needs to be removed from the repository and then all developers that have commit access must remove the directories in their own workspace. This will stop the developer from accidentally reintroducing the directory. Since this happens infrequently we keep track of the directories we wish to delete (during some synchronization point) in this file.

./autogen.sh

When a configure file or fragment is changed, that is most files that end in ".in", the autogen.sh shell script will verify that the correct Autoconf version will be used and will run Autoconf on all newer configuration files in order to produce a final configure script that is then checked into the repository so that regular builders of the project need not generate these files themselves.

Note: This is the only program that actually makes changes in the source tree and is really the only exception to not placing generated code in the source tree.

It is desirable to first check in the ".in" files into the repository, rerun autogen.sh and then check in the result. This will allow the generated scripts to have matching SCM numbers to the ".in" file that it was sourced from.


3.2.4. ./test/

The ./test/ directory contains a set of Small Client OS images that are designed to test atomic features of the core Hypervisor. The Tesing OSes are often referred to as "ToyOSes" and are designed to be written almost like standard C applications.

The specifics of this programming model is as follows:

the most important of them all is controller.


3.2.4.1. ./test/controller

The Controlling OS is the only OS that the core Hypervisor is capable of loading. It is expected to be a binary WOS [6] which is free of any ELF like file information. Hypervisor expects to simply copy it into the first partitioned area of memory and execute it at a known location (normally 0x0) and an agreed upon initial register state, which is ISA specific. This ensures that Hypervisor is free of any knowledge of file formats and simply consideres a well defined series of bits.

Note: The configuration system allows you to choose an alternate Controlling OS by using the --with-controller=OS Image. However, the OS Image must loadable and executable in the same way that controller is.

By default the Controlling OS for Research Hypervisor is controller.

The remainder of the Test OSes are collected together and used to create and linkable object that represents an array that contains the complete ELF image and a name associated with it. This linkable object is then linked into controller so controller can create a new partition and load the Image into the partition and cause it to be scheduled as specified by its ELF information.

Note: It is possible to add other OS Images from "outside" the project area (such as a bootable Linux Kernel) and have it added to the list of OSes that controller can spawn controller. You can specify a list of external images by using the configure option --with-controller-images=FILE1[,FILE2,...]

Notes

[1]

Although the term originated with the Denali the method has been used by several VMM projects.

[2]

Yes we do use Autoconf, but there are no plans to try to use its "evil" cousin GNU Automake since the maintainers believe (perhaps erroneously) that this tool is incapable of easily describing the configuration that has been designed.

[3]

A complete list is forthcoming.

[4]

Thinwire is part of the K42 project but is available for use by other programs such as Research Hypervisor.

[5]

Yes, we acknowledge the existence of machines like PDP-11s that have been wire wrapped to have an 18 bit bus, we eagerly await the patch submission for this machine and others like it so we can giggle uncontrollably.

[6]

Wad O' Stuff


  

    About IBMPrivacyContact