installs

Fiasco u-kernel

Compiling and testing fiasco

[Posted Sunday, September 25, 2005]

I have the Fiasco u-kernel booted on my IBM Thinkpad T41. These are the steps that I followed:

1. Checkout "hello" from CVS. Login first using:

# cvs -d :pserver:guest@ os.inf.tu-dresden.de:/home/remote-cvs \
     login
Password: guest

# cvs -d :pserver:guest@ os.inf.tu-dresden.de:/home/remote-cvs \
     checkout hello
# cvs -d :pserver:guest@ os.inf.tu-dresden.de:/home/remote-cvs \
     logout

2. Enter into l4/ directory and do

# make config .

Make sure you have yacc and lex set in the compiler tools.

3. Then to compile hello and its required modules do:

# make hello

4. To compile the fiasco microkernel, enter into l4/kernel/fiasco, configure the kernel using:

# make menuconfig

5. To compile the kernel do:

# make

6. Created /boot/fiasco and copied hello, main, rmgr and sigma0 to it.

7. Edited /boot/grub/menu.lst to add an entry to fiasco:

title Fiasco u-kernel hello world
kernel   (hd0,0)/boot/fiasco/rmgr -sigma0
module (hd0,0)/boot/fiasco/main -noserial -nowait -nokdb
module (hd0,0)/boot/fiasco/sigma0
module (hd0,0)/boot/fiasco/hello

The hello world thread iterates :)

Compiling L4Env

[Posted Monday, September 26, 2005]

I checked out L4Env from CVS:

# cvs -d :pserver:guest@ os.inf.tu-dresden.de:/home/remote-cvs checkout l4env

I entered into l4/ and did:

# DROPS_STDDIR=/path/to/l4 make config .

Just had to make sure yacc was set in "Compilers and Tools" and not byacc, and did make to compile the modules.

I didn't want to disturb my laptop setup. Hence, I am using an old PIII Intel x86 desktop that has a floppy drive as a testbed environment. You can download the DROPS demo floppy from:

http://os.inf.tu-dresden.de/drops/download/. I use the following script to mount the exiting images on x86 and then replace them with my compiled images.

1. I don't have loop device driver compiled in the kernel. So, I compiled it separately and load it manually using:

insmod /path/to/loop.ko

2. I created a /mnt/floppy directory. I pass the current drops-demo-floppydisk.img as an argument to the script:

# !/bin/bash
IMG=$1
dd if=/dev/zero of=floppy.img bs=512 count=2880
losetup /dev/loop0 floppy.img
mkdosfs /dev/loop0
dd if=$IMG of=/dev/loop0 bs=512 count=2880
mount /dev/loop0 /mnt/floppy

I then replaced the images in /mnt/floppy with the newly compiled ones. Also had to make necessary changes in boot/grub/menu.lst to boot the required tasks. Finally, had to create a new image and unmount the loop device.

# dd if=/dev/loop0 of=new-floppy.img bs=512 count=2880
# umount /mnt/floppy
# losetup -d /dev/loop0

I then transferred the image to the testbed desktop (Debian Sarge 3.1r0a) through the LAN and dumped the image to the floppy:

# dd if=new-floppy.img of=/dev/fd0

Reboot the testbed x86 to test the new images :)

Compiling dde

[Posted Tuesday, September 27, 2005, 2350 IST]

I checked out dde from CVS:

# cvs -d :pserver:guest@ os.inf.tu-dresden.de:/home/remote-cvs checkout dde

Just did "make" in the sources directory to compile it. I tested the dde_debug with --pcidevs option. It displayed the PCI devices in the testbed environment. Its time to dig into the sources.

hiworld server and hiworld idl server

[Updated Sunday, January 11, 2009, 1620 IST]

To build dice, checkout from repomgr and build:

./repogmr modules
./repogmr co dice

cd dice/
make -f Makefile.drops
./configure
make

As per the documentation on BID, I have written the hiworld server instcode and hiworld idl server instcode. It compiles fine.

1. The hiworld server is to be extracted in l4/pkg.

1.hiworld.server.tar.bz2

Enter into hiworld/server/src and do "make O=/path/to/build" to compile.

2. The hiworld idl server needs to be extracted in l4/pkg.

2.hiworld.server.idl.tar.bz2

You first have to enter into hiworld/idl and do "make O=/path/to/build" to create the C functions for IPC communication. The server/src/server.c is copied from the build hiworld-template.c from l4/build/pkg/hiworld/idl/OBJ-x86-l4v2/, and function is implemented. You can then enter into hiworld/server/src and do a "make O=/path/to/build" to compile the server.

hiworld client library and client

[Updated Sunday, January 11, 2009, 1620 IST]

As per the BID documentation, I have written, and compiled the hiworld client library that has the include/ and lib/ directories. Check the source instcode from:

3.hiworld.client.lib.tar.bz2

It needs to be extracted in l4/pkg. Do a make in idl/, include/ and lib/src, and server/src.

The final step is to write an example client instcode to test the server and client. The complete source code can be checked out from here:

4.hiworld.server.client.tar.bz2

It needs to be extracted in l4/pkg/. Do a make in idl/, include/ and lib/src, server/src, and examples/client.

You can test the modules with qemu or on a system. To create a cd-image to test with qemu, put all executables in a top-level directory:

boot/grub/menu.lst
boot/grub/stage2_eltorito
bootstrap
fiasco
sigma0
roottask
hiworld
hiserver
hiclient
log
names
dm_phys

stage2_eltorito is available in Debian under /usr/lib/grub/i386-pc/.

boot/grub/menu.lst contents:

title hiworld
kernel /bootstrap -modaddr 0x02000000
module /fiasco -serial_esc -comspeed 115200 -comport 1 -nokdb -jdb_cmd=JH
module /sigma0
module /roottask
module /hiworld

title hiworld client, server
kernel /bootstrap -serial -modaddr 0x02000000
module /fiasco -serial_esc -comspeed 115200 -comport 1 -nokdb -jdb_cmd=JH
module /sigma0
module /roottask
module /log
module /names
module /dm_phys
module /hiserver
module /hiclient

To create an .iso use the following from the top-level directory:

mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 -boot-info-table -hide-rr-moved -J -joliet-long -o "cd-image.iso" .

To execute with qemu, use:

sudo qemu -cdrom cd-image.iso -serial stdio -m 200

The basic source instcode directory structure is as follows:
idl/           contains the interface name and the functions it uses
include/   contains the client helper library declaration
lib/           contains the client helper library initialization
server/    contains the server implementation instcode
example/ contains client instcode that invokes function names in include/

qemu

[Posted Tuesday, October 4, 2005, 0005 IST]

Installed qemu .deb package and its dependencies:

http://fabrice.bellard.free.fr/qemu/

I ran the demo-drops-floppy.img with qemu on GNU/Linux using:

# qemu -fba drops-demo-floppy.img

The hello thread iterates fine in the demo.

fiasco-DROPS with grub on hard disk

[Posted Tuesday, October 4, 2005, 2110 IST]

I first had to compile grub with the os1 patch exclusively for fiasco-DROPS. So, I downloaded grub-0.97.tar.gz on to the testbed computer on the GNU/Linux partition from:

ftp://alpha.gnu.org/gnu/grub/

I downloaded the grub-0.97-os.1.diff.gz patch from:

http://os.inf.tu-dresden.de/~adam/grub/0.97/

Extracted grub-0.97 and gunzipped the diff patch. Entered into the grub-0.97 sources and applied the patch using:

$ cd grub-0.97/
$ patch -p0 < /path/to/patch

Created a build directory, did configure, make and make install

$ mkdir build
$ ./configure --prefix=/path/to/build
$ make
$ make install

I created a primary partition on my testbed computer for fiasco-DROPS,made an ext2 filesystem on that, setup a mount point and installed grubto it.

# mkfs.ext2 /dev/hdb4
# mkdir /mnt/fiasco
# mount /dev/hdb4 /mnt/fiasco
# grub-install --root-directory=/mnt/fiasco /dev/hdb4

I copied all the modules to /mnt/fiasco/boot/fiasco. I have an entry in the grub in the MBR for this new fiasco-DROPS partition as:

title Fiasco-DROPS
root (hd0,3)
chainloader +1

In the grub installed to /dev/hdb4, I have a menu.lst file that contains the following:

set P := (hd0,3)/l4/v2
set GRUB := (hd0,3)/boot/grub
...
title The "hello" program
kernel $(P)/bootstrap
modaddr 0x01500000
module $(P)/fiasco $(FIASCOARGS)
module $(P)/sigma0
module $(P)/roottask
module $(P)/hello

The hello thread iterates on bootup!