User Mode Linux is a binary
executable that works in a Linux host and boots a virtual Linux
within a user process. It's an isolated environment for making
experiments on a kernel or a system. Its hardware architecture is a
process in the host system (the system that you execute UML binary).
For detailed information see:
http://usermodelinux.org/
Once you execute the UML binary, a Linux system boots in the terminal and opens some consoles.
Download and install kernel sources, 2.6.18 (this version is the version of the binary provided below). Install it from your distribution repository or:
ftp://ftp.metu.edu.tr/pub/mirrors/ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.16.18.tar.gz
(For your modules to work with the binary, you should have this version). You should also have a 2.6.x kernel working in the host system. Assume sources are installed under /usr/src/linux-source-2.6.18/
Install latest uml-utilities package of your distribution
Download the files
under:
http://www.ceng.metu.edu.tr/courses/ceng536/sources/uml/
Files and
debian-root.gz 91M Root filesystem of your Linux
kernel-conf 12K Kernel config to copy as .config
ldd3-samples-1.0.0.tar.gz 77K Sample sources from the book
ldd3_pdf.tar.bz2 11M Chapters of the book
linux.gz 9.4M UML binary
Extract and decompress all packages. Give execute permission to linux. Assume all files are under /home/youruser/uml
execute this command to test your environment:
./linux ubd0=my-root,debian-root
You should have a system booting. You can login as root without any password.
UML system mounts /home as the /home of the host system. So you can change directory to /home/youruser/ and access your files in the host system.
copy kernel-conf as /usr/src/linux-source-2.6.18/.config
In host system, change directory
to ldd3-samples-1.0.0/scullc
execute:
make
KERNELDIR=/usr/src/linux-source-2.6.18 ARCH=um
You should
have scullc.ko file is
created (ignore a warning about vmlinuz)
In UML system change directory to /home/youruser/uml/ldd3-samples-1.0.0/scullc
In UML system, execute:
chmod +x scullc_load scullc_unload
./scullc_load
echo
“hello” >/dev/scullc0
cat /dev/scullc0
If it echoed back your “hello”,
it works. Now you can change “scullc” as your device:
“pstackdev”