Skip to contentSkip to conversation

cstrap domU boot loader

DISCUSSION Jacob Gorm Hansen 1 participant 1 message Jan 4, 2007

lore
Share & tools
lore
#0 lore raw

hi,

it is still very rough, but for those interested I am working on a domU bootloader. In its current state it is able to boot domains either from a ramdisk or over a HTTP-1.0 connection.

You may find the source at http://www.distlab.dk/hg/index.cgi/cstrap.hg
as a HG repo.

To compile, type:

make XEN_ROOT=/my/xen/tree.hg

The resulting ELF-binary called cstrap is the boot-loader. The cmdline it gets started with decides the mode of operation, e.g.:

kernel=cstrap
initrd=out.img
cmdline=ram

boots from a ramdisk/initrd called out.img.

and

kernel=cstrap cmdline=ip=172.16.6.1:255.255.0.0:172.16.1.1 http://1.2.3.4/out.img

Configures the IP address to 172.6.6.1, netmask to 255.255.0.0, and default gateway to 172.16.1.1 (the example box is running NAT for domains), and boots from a 'packed' kernel+initrd image at
http://1.2.3.4/out.img .

Currently only 'packed' images, created with the 'pack' from tool from
http://www.distlab.dk/hg/index.cgi/migrationtools.hg are supported (look at the source of pack.c to see what the format is like), but fetching a menu.lst-file to allow booting of regular ELF kernels is on the TODO.

Hostname-resolution does not work, so you need to specify the IP address of your web server. Other ports than 80 are supported in standard HTTP URI syntax. The TCP/IP stack in use is UIP, and the HTTP client is an example from the UIP source. Better performance + congestion control would probably be nice, and I am considering moving over the LwIP instead. Another option is to go via a HTTP proxy in dom0, to get HTTP-1.1 support and other nice features (such as caching).

Regards,
Jacob