I have tried building a user-mode-linux kernel using both the source from the Ubuntu repository using apt-get and by using the git of the generic kernel.
The source code from Ubuntu's repository generated an error during compilation "error: __supported_pte_mask undeclared (first use in this function)". This is strange since a running precompiled version of the kernel can be downloaded right from the Ubuntu repository.
The git code compiles the ARCH=um just fine but it fails to run. I get an Aborted error see below for my compiled version vs the precompiled UML kernel downloaded from Ubuntu's repository.
Locating the bottom of the address space ... 0x10000
Locating the top of the address space ... 0xc0000000
Core dump limits :
soft - 0
hard - NONE
Checking that ptrace can change system call numbers...OK
Checking syscall emulation patch for ptrace...OK
Checking advanced syscall emulation patch for ptrace...OK
Checking for tmpfs mount on /dev/shm...OK
Checking PROT_EXEC mmap in /dev/shm/...OK
Checking for the skas3 patch in the host:
- /proc/mm...not found: No such file or directory
- PTRACE_FAULTINFO...not found
- PTRACE_LDT...not found
UML running in SKAS0 mode
Adding 30121984 bytes to physical memory to account for exec-shield gap
Aborted
instead of the following from the built version of the uml kernel in the repository:
Locating the bottom of the address space ... 0x10000
Locating the top of the address space ... 0xc0000000
Core dump limits :
soft - 0
hard - NONE
Checking that ptrace can change system call numbers...OK
Checking syscall emulation patch for ptrace...OK
Checking advanced syscall emulation patch for ptrace...OK
Checking for tmpfs mount on /dev/shm...OK
Checking PROT_EXEC mmap in /dev/shm/...OK
Checking for the skas3 patch in the host:
- /proc/mm...not found: No such file or directory
- PTRACE_FAULTINFO...not found
- PTRACE_LDT...not found
UML running in SKAS0 mode
Adding 1142784 bytes to physical memory to account for exec-shield gap
Initializing cgroup subsys cpuset
Linux version 2.6.35.1 (root@rothera) (gcc version 4.4.5 20100813 (Linaro prerelease) [release 2010.08-0] (Ubuntu/Linaro 4.4.4-8ubuntu2) ) #2 Mon Aug 16 10:45:47 UTC 2010 ()
The steps to build are from https://wiki.ubuntu.com/KernelTeam/GitKernelBuild and from http://www.ime.usp.br/~baroni/docs/uml-en.html
The complete steps that I used are:
cd linuxsrc
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
cd linux-2.6
make mrproper
make mrproper ARCH=um
make defconfig ARCH=um
make linux ARCH=um
make modules ARCH=um
It is at this point that I attempt to launch my UML kernel with:
./vmlinux ubda=centcow,CentOS5.6-x86-root_fs mem=256M root=/dev/ubda umid=centos
I downloaded the CentOS filesystem from http://fs.devloop.org.uk/