L4RE hands-on : hello world and boot ISO
REFS
- https://l4re.org/getting_started/make.html (CC-BY-SA 4.0, L4Re project members and individual contributors)
Basically a plaintext note for my own reference.
DEPS AND ENV
pacman:
base-devel dtc lib32-gcc-libs qemu qemu-ar
aur:
perl-git-repository perl-xml-mini perl-uri
ham (include in $PATH)
https://github.com/kernkonzept/ham.git
prepare the sources with ham
mkdir $PROJ_BASE
cd $PROJ_BASE
ham init -u https://github.com/kernkonzept/manifest.git
ham sync
dir naming convention (x86_64)
PROJ_BASE=/PATH/TO/PROJ/ROOT
export L4RE_SRCDIR ="${PROJ_BASE}/l4"
export L4RE_OBJDIR ="${PROJ_BASE}/l4re_builds/x86_64"
export KERNEL_SRCDIR ="${PROJ_BASE}/fiasco"
export KERNEL_OBJDIR ="${PROJ_BASE}/fiasco_builds/x86_64"
STRUCT
.
├── .ham # managed by ham tool
├── fiasco # the L4RE microkernel (namely the "kernel")
├── l4 # the L4RE (OS framework)
├── fiasco_builds # kernel build dir : initialized later
└── l4re_builds # L4RE build dir : initialized later
BUILDING L4
If you build L4RE from source (instead of using a snapshot), you are default to the amd64 build. To change the default target modify the Maiefile:
diff --git a/Makefile b/Makefile
index 49cca2f..a9b7037 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,7 @@ all::
DROPSCONF = y
TEMPLDIR := mk/defconfig
-DFL_TEMPLATE := amd64
+DFL_TEMPLATE := x8
BUILDING L4RE
# initialize L4 build dir, only do once
$ cd $L4RE_SRCDIR # l4
$ make B=$L4RE_OBJDIR # l4re_builds/x86_64
# build L4RE from src tree
cd $L4RE_SRCDIR # l4
make O=$L4RE_OBJDIR # l4re_builds/x86_64
# or in the build tree
cd $L4RE_OBJDIR # l4re_builds/x86_64
make
# (optional) to change the configs
cd $L4RE_OBJDIR # l4re_builds/x86_64
make config
# (amd64) build target in
# $L4RE_OBJDIR/bin/amd64_gen/l4f/
BUILDING L4 MICROKERNEL (FIASCO)
cd $KERNEL_SRCDIR # fiasco
make B=$KERNEL_OBJDIR # fiasco_builds/x86_64
cd $KERNEL_OBJDIR # fiasco_builds/x86_64
make
HELLOWORLD
cd $L4RE_OBJDIR
make E=hello-cfg qemu MODULE_SEARCH_PATH=$KERNEL_OBJDIR:$L4RE_SRCDIR/conf/examples
USING THE SNAPSHOT
DOWNLOAD FROM: https://os.inf.tu-dresden.de/download/snapshots/ and .. read instructions there, maybe.
# cd snapshot
make setup
make