Get news? 2011 | 2010 | 2009 | 2008 | 2007 | 2006 | 2005 | 2004 | 2003 | 2002 | 2001 | 2000 | 1999 | 1998 | 1997 | About | Contact Want to help?

Linux-Kongress 2002
9th International Linux System Technology Conference
September 4-6, 2002 in Cologne, Germany

Home | Events | Program | Abstracts | Tutorials | BoFs | Fees | Exhibition | Location | Accommodations | Keysigning Party | Sponsors | Supporters | Reports and Photos | Papers and Slides | Call for Papers

See the list of all papers
Authors Hans-Jörg Höxer, Kerstin Buchacker, Volkmar Sieh
Title Implementing a User Mode Linux with Minimal Changes from Original Kernel
Paper
Postscript: lk2002-hoexer.ps (136489 Bytes)
Abstract

Our team is implementing a User-Mode-Linux with two main targets in mind. The first one is, that the changes needed to port an original Linux kernel to our User-Mode environment should be minimal. The second is, that it should be possible to make the virtual hardware the User-Mode-Linux is running on fail at will. We plan to use this capability to test how well fault-tolerant systems such as the Linux Virtual Server described at www.linuxvirtualserver.org, can handle failures of hardware components.

The first goal, minimal changes from original kernel, is the main topic of this paper. The advantages are clear. The fewer lines of code we touch, the fewer errors we can introduce into the kernel and the less effort is needed to port the kernel to UMLinux. This speeds up adapting UMLinux to new kernel releases.

The parts of kernel code that need to be changed, are those directly interacting with the hardware. Basically these are all lines containing inline assembler instructions. Inline assembler is used in three main areas in the kernel: for interrupt and exception handling, to access functions of the memory management unit and for communication with devices via inb/outb-instructions. Our approach is to replace these lines of assembler code with functions, which have the same effect as the original assembler instructions.

In UMLinux, signals replace interrupts/exceptions. Consequently, signal handler functions replace interrupt/exception handlers. The signal handler functions in UMLinux do not actually contain code to handle the interrupt. The signal handler function modifies the stack so the original kernel's interrupt handler can work with it and then calls that handler. Upon return of the handler, the modifications are undone by a function implementing the iret assembler instruction and execution of the User-Mode-Kernel continues.

Assembler instructions concerning the memory management unit are those, for example, which modify the page-directory base register or segment registers. We have implemented functions based on mmap/munmap to replace these instructions and simulate the memory management unit.

Communication with devices is mainly done via interrupts and inb/outb assembler instructions. In UMLinux we have implemented functions to replace the inb/outb instructions. These functions implement the UMLinux virtual hardware devices, such as real time clock, APIC, IDE-controller, keyboard-controller and VESA-graphics-controller. These virtual devices communicate with the UMLinux kernel just like real devices would communicate with the real kernel. Consequently we can use the device drivers of the original kernel in UMLinux, too. It is not our goal, to create a complete hardware simulation like Plex86. We just want to simulate enough of the hardware, to be able to use the original Linux device drivers.

About the Authors

This paper was written by Hans-Jörg Höxer, Kerstin Buchacker and Volkmar Sieh. All have graduated in computer science from the University of Erlangen. K. Buchacker and V. Sieh also hold a PhD in computer science. All authors are part of the team working on the UMLinux project.


Comments or Questions? Mail to contact@linux-kongress.org Last change: 2005-09-17