# This how-to https://os.inf.tu-dresden.de/Studium/KMB/WS2016/Exercise3.txt # Preparation - Download: https://os.inf.tu-dresden.de/Studium/KMB/WS2016/Exercise3.tar.xz - Unpacking: mkdir /somewhere/mos-ex3 cd /somewhere/mos-ex3 tar xvf Exercise3.tar.xz cd tudos make setup (select "amd64" as target architecture) - Building: make -j8 # Basic setup - if you don’t like the QEMU graphical console, you can hide it: export QEMU_OPTIONS="-display vnc=:1" - running in QEMU: make -C obj/l4/amd64 qemu - running specific setup in QEMU: make -C obj/l4/amd64 qemu E="L4Linux-basic" # Enabling devices - Start io service: -- edit src/l4/conf/examples/l4lx.cfg local loader = L4.default_loader; vbus_l4linux = loader:new_channel(); loader:start( { caps = { sigma0 = L4.cast(L4.Proto.Factory, L4.Env.sigma0):create(L4.Proto.Sigma0); icu = L4.Env.icu; l4linux = vbus_l4linux:svr(); }, }, "rom/io -vvv"); - look at output; which devices do you see? - add legacy devices: -- vi:ft=lua local Res = Io.Res local Hw = Io.Hw Io.hw_add_devices(function() P80 = Hw.Device(function() Property.hid = "P80"; Resource.iop1 = Res.io(0x80); end); BIOS = Hw.Device(function() Property.hid = "BIOS"; Resource.reg1 = Res.mmio(0x0, 0xfff); Resource.reg2 = Res.mmio(0x9f000, 0x9ffff); Resource.reg3 = Res.mmio(0xc0000, 0xfffff); end); VGA = Hw.Device(function() Property.hid = "PNP0900"; Resource.iop1 = Res.io(0x3b0, 0x3bf); -- MDA Resource.iop2 = Res.io(0x3c0, 0x3df); -- EGA/VGA Resource.iop3 = Res.io(0x1ce, 0x1d0); -- Vbox Resource.iop4 = Res.io(0x402, 0x402); -- QEMU Debug Port Resource.mmio = Res.mmio(0xa0000, 0xbffff); end); RTC = Hw.Device(function() Property.hid = "PNP0B00"; Resource.iop1 = Res.io(0x70, 0x71); end); end) # Enabling device access in l4Linux - add connection (IPC gate) to L4Linux by adding a new capability entry: loader:start( { caps = { vbus = vbus_l4linux; }, log = L4.Env.log:m("rws"), }, "rom/vmlinuz ..."); - populate bus for L4Linux by creating new io config file l4lx.io: -- vi:ft=lua local hw = Io.system_bus() Io.add_vbusses { l4linux = Io.Vi.System_bus { -- Add a new virtual PCI root bridge PCI0 = Io.Vi.PCI_bus { pci_l4x = wrap(hw:match("PCI/network", "PCI/storage", "PCI/media")); }; }; } # Enabling device drivers in L4Linux - enable Intel Ethernet drivers make -C obj/l4linux/amd64 menuconfig make -j8 - bring up network stack in L4Linux: ifconfig eth0 10.0.2.15 route add default gw 10.0.2.2 wget http://141.76.48.99/Studium/KMB/WS2016/Exercise3.txt # Enable real-time clock support - "Now witness the firepower of this fully armed and operational battle station^Dtime machine" :) date Thu Jan 1 00:00:00 UTC 1970 - start L4 RTC service (will need access to RTC device) - connect L4Linux driver (l4_rtc) to L4 RTC service