*********************************************************************** Running L4Android over L4 on ARM PB11MPCORE and booting Root filesystem via NFS --Prasannakumar Krishnamurthy (pkrishn6@ncsu.edu) --Varun Ganesh (vganesh2@ncsu.edu) *********************************************************************** *********************************************************************** For L4 and Fiasco: *********************************************************************** 1. Download l4re-snapshot from http://os.inf.tu-dresden.de/download/snapshots-oc/ 2. cd l4re-snapshot-2011081207 3. make setup -> choose ARM, arm-rv 4. vi obj/l4/arm-rv/Makeconf.local change the first two lines pointing to arm9-rv-up and arm-up to MODULE_SEARCH_PATH=/home/quest/l4re-snapshot-2011081207/obj/fiasco/arm-mp-rv-pb11mp:/home/quest/l4re-snapshot-2011081207/obj/l4linux/arm-mp 5. make This will take time as it will compile all possible combinations for l4, fiasco and l4linux the process can be slightly speedened up by make -j16 *********************************************************************** For L4Android, *********************************************************************** 1. mkdir l4android;cd l4android 2. git clone git://git.l4android.org/kernel.git 3. cd kernel 4. mkdir build 5. make L4ARCH=arm CROSS_COMPILE=arm-linux- O=build/ arm_defconfig 6. make L4ARCH=arm CROSS_COMPILE=arm-linux- O=build/ menuconfig Under L4Linux configuration--> set L4 tree build directory as l4re-snapshot-2011081207/obj/l4/arm-rv Under System Type--> Select ARM system type--> as L4Linux Select Build type--> as USE ARMv6k Under Device Drivers--> Enable and select Network device support--> Enable and select Ethernet (10 or 100Mbit)--> Select SMSC LAN911[5678] support Select SMSC LAN911x/LAN921x families embedded ethernet support Don't set the above two as modules but select them to get compiled along with the kernel Under File Systems--> Select Ext2, Ext3, Ext4 (for init) Enable and select Network file systems--> Enable and select NFS client support--> NFS client support for NFS version 3 NFS client support for NFS version 4 Root file system on NFS (this option won't appear if NFS client as Module is set) 7. make L4ARCH=arm CROSS_COMPILE=arm-linux- O=/path/to/obj/l4linux This will be a slow process and can be speedened up by make -j16 L4ARCH=arm CROSS_COMPILE=arm-linux- O=build/ After this step, vmlinuz.arm will be created under build/ directory. 8. cd build/; cp vmlinuz.arm l4re-snapshot-2011081207/obj/l4linux/arm-mp/ 9. cd l4re-snapshot-2011081207/obj/l4/arm-rv/ 10. make elfimage -->select option 3. This will compile and create an image bootstrap_L4Linux_ARM.elf under images/ and is the bootable kernel image. *********************************************************************** Configuring L4 to passthrough SMC911x to L4Linux through a virtual bus, *********************************************************************** The following steps need to be done before doing "make elfimage" 1. cd l4re-snapshot-2011081207/src/l4/conf 2. vi modules.list Change entry L4Linux ARM as the following, entry L4Linux ARM kernel fiasco -serial_esc roottask moe rom/l4lx.cfg module l4re module ned module l4lx.cfg module l4lx-vbus.io module arm-rv-eb-mc.devs module io module arm-rv.io module vmlinuz.arm module ramdisk-arm.rd 3. Create the file l4lx-vbus.io under conf/examples/ and add the following lines vi examples/l4lx-vbus.io l4linux => new System_bus() { NIC => wrap(hw-root.NIC); } 4. Change l4lx.cfg to the following Note: -- means a comment, the line loader:new_channel() is to make device passthrough vi examples/l4lx.cfg -- vim:set ft=lua: local lxname = "vmlinuz"; if L4.Info.arch() == "arm" then lxname = "vmlinuz.arm"; end 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 -vv rom/arm-rv-eb-mc.devs rom/l4lx-vbus.io"); L4.default_loader:start( { caps = { log = L4.Env.log:m("rws"), vbus = vbus_l4linux; }, l4re_dbg = L4.Dbg.Warn, log = { "l4linux", "yellow" }, }, "rom/" .. lxname .. " mem=64M console=ttyLv0 l4x_rd=rom/ramdisk-" .. L4.Info.arch() .. ".rd root=1:0 ramdisk_size=4000 init=/bin/sh"); The above configuration allows the kernel image to boot from ramdisk.arm image. To configure it to boot root filesystem from NFS, change the last line in the above file to the following, "rom/" .. lxname .. " mem=64M console=ttyLv0 console=tty0 root=/dev/nfs rw nfsroot=152.14.245.190:/home/quest/nfs/armv6-board-fs,nolock,wsize=1024,rsize=1024 ip=152.14.86.208:152.14.245.190:152.14.86.129:255.255.255.0 init=/sbin/init noinitrd nfsrootdebug"); 5. Repeat make elfimage. This time the created bootstrap_L4Linux_ARM.elf image will boot rootfilesystem from NFS. *********************************************************************** Creating a rootfilesystem to boot from NFS *********************************************************************** Follow steps exactly as given in http://www.linux-arm.org/LinuxKernel/LinuxAndroidPlatform The above link also specifies how to configure the NFS server. *********************************************************************** U-Boot Commands to be done on the board *********************************************************************** When the board boots up a prompt will be seen as follows, M:\> This will happen if the SD Card is inserted, else the prompt would be > To start up U-Boot, M:\>flash M:\>run UBOOTRV Don't let it to autoboot, press enter. Then the Uboot prompt will appear. To set the ip of the TFTP server that contains the kernel elf image, setenv serverip Now the command tftp 2000 will fetch the elf file from the tftp server and place it at 2000 memory address. Ensure that the board ip and gateway ip are set in similar manner as serverip. Do a saveenv so that the environment variables are saved to the flash and need not be typed in each time the board boots. After this, do the following, bootelf 2000 This will startup the kernel. If Uboot is configured at baud 38400 and the kernel by default is set at baud 115200, change the baudrate of the serial port terminal immediately after the command bootelf so that it is now set to listen at baud 115200. This will allow the terminal to capture the output of the L4 kernel booting up. ***********************************************************************