The easiest way to start an L4 application using the L4 loader is to pass the name of the executable as command line argument to the loader. The example below assumes GRUB loads files via the network. Loader uses the BMODFS file provider, a simple RAM-based application, to access files:
# menu.lst
set ND = "(nd)/tftpboot/drops"
set BIN_PATH = "$(ND)/bin"
title Hello World
kernel $(BIN_PATH)/bootstrap
modaddr 0x02000000
module $(BIN_PATH)/fiasco -nokdb -serial -serial_esc
module $(BIN_PATH)/l4v2/sigma0
module $(BIN_PATH)/l4v2/roottask task modname "bmodfs" attached 1 modules
module $(BIN_PATH)/l4v2/names
module $(BIN_PATH)/l4v2/log
module $(BIN_PATH)/l4v2/dm_phys
module $(BIN_PATH)/l4v2/simple_ts
module $(BIN_PATH)/l4v2/bmodfs
module $(BIN_PATH)/l4v2/hello
module $(BIN_PATH)/l4v2/loader --fprov=BMODFS hello
- Note:
- The default file provider the loader communicates with is tftp. This server accepts filenames in the GRUB syntax and loads files through the network using the TFTP protocol. Therefore, you must prepend
"(nd)/". The binary must be accessible by the TFTP protocol (e.g. the binaries must be world-readable). The above example using TFTP looks like this:
# menu.lst
set ND = "(nd)/tftpboot/drops"
set BIN_PATH = "$(ND)/bin"
title Hello World
kernel $(BIN_PATH)/bootstrap
modaddr 0x02000000
module $(BIN_PATH)/fiasco -nokdb -serial -serial_esc
module $(BIN_PATH)/l4v2/sigma0
module $(BIN_PATH)/l4v2/roottask
module $(BIN_PATH)/l4v2/names
module $(BIN_PATH)/l4v2/log
module $(BIN_PATH)/l4v2/dm_phys
module $(BIN_PATH)/l4v2/simple_ts
module $(BIN_PATH)/l4v2/l4io
module $(BIN_PATH)/l4v2/ore
module $(BIN_PATH)/l4v2/tftp --server=192.168.0.2
module $(BIN_PATH)/l4v2/loader $(BIN_PATH)/l4v2/hello