Site Home Page The UML Wiki UML Community Site The UML roadmap What it's good for Case Studies Kernel Capabilities Downloading it Running it Compiling Installation Skas Mode Incremental Patches Test Suite Host memory use Building filesystems Troubles User Contributions Related Links The ToDo list Projects Diary Thanks Contacts
Tutorials The HOWTO (html) The HOWTO (text) Host file access Device inputs Sharing filesystems Creating filesystems Resizing filesystems Virtual Networking Management Console Kernel Debugging UML Honeypots gprof and gcov Running X Diagnosing problems Configuration Installing Slackware Porting UML IO memory emulation UML on 2G/2G hosts Adding a UML system call Running nested UMLs
How you can help Overview Documentation Utilities Kernel bugs Kernel projects
Screenshots A virtual network An X session
Transcripts A login session A debugging session Slackware installation
Reference Kernel switches Slackware README
Papers ALS 2000 paper (html) ALS 2000 paper (TeX) ALS 2000 slides LCA 2001 slides OLS 2001 paper (html) OLS 2001 paper (TeX) ALS 2001 paper (html) ALS 2001 paper (TeX) UML security (html) LCA 2002 (html) WVU 2002 (html) Security Roundtable (html) OLS 2002 slides LWE 2005 slides
Fun and Games Kernel Hangman Disaster of the Month

### IO memory emulation

Thanks to Greg Lonnon, UML (as of 2.4.6-4um) has support for I/O memory emulation. This allows a host file to be specified as an I/O region on the kernel command line. That file will be mapped into UML's kernel address space where a driver can locate it and do whatever it wants with the memory, including providing an interface to it for UML processes to use.

Driver interface

> Specifying an iomem region on the kernel command line is done as follows:

> > `iomem=name,file`

> The name is defined by the driver that will use the I/O area and the file is the name of the host file that will be mapped in.

> The driver finds its I/O area by calling find_iomem ``

>     unsigned long find_iomem(char *driver, unsigned long *len_out)

> which returns the address of the beginning of the area and passes its length out in len_out. The driver argument is the name of the I/O area as defined on the command line.

> Once the driver has located its I/O area, it can do whatever it wants with it, including

> - providing a file interface to it
> - allowing processes to mmap it into their own address spaces
> - use it as a backing store for some other kind of interface, such as an X server using it as a framebuffer and providing an X protocol interface to it

The mmapper driver

> arch/um/drivers/mmapper_kern.c contains a simple example driver which locates the iomem area named "mmapper" and makes it available for mapping through /dev/mmapper. Here is a little program which will mmap the /dev/mmapper device and print its contents.

> To run this driver, compile it into the kernel by turning on CONFIG_MMAPPER, and assign a file to it by putting

> > `iomem=mmapper,file`

> on the command line.

Hosted at