bolthur/kernel project. Copyright (C) 2018 - 2025 bolthur project
There are no completely supported platforms yet.
Currently, the following targets are planned to be supported:
-
armv6 ( 32 bit )
- RPI A
- RPI A+
- RPI B
- RPI B+
- RPI zero 1
-
armv7-a ( 32 bit )
- RPI 2B r.1
-
armv8-a ( 64 bit - rpi 2 r.2, rpi 3 and rpi 4 series )
- RPI 2B r.2
- RPI 3B
- RPI 3B+
- RPI 4
- RPI zero 2
- Raspberry PI 2 Model B ( rev 1.1 )
- Raspberry PI 3 Model B
- Raspberry PI Zero W
Initial necessary command after checkout or adding new files autotools executed within project root:
autoreconf -ivmkdir build
cd build
### configure with one of the following commands
../configure --host arm-raspbi2b_r1-bolthur-eabi --enable-device=raspi2b_r1 --enable-debug --enable-output
../configure --host arm-raspi0_1-bolthur-eabi --enable-device=raspi0_1 --enable-debug --enable-outputPossible additional parameters to --host and --enable-device:
--with-debug-symbolsenables remote debugging mode ( blocks --enable-release )--with-optimization-level=xsets optimization from default ( 2 ) to specified one ( ignored when --enable-release is set )--enable-outputenables kernel output ( blocks --enable-remote-debug )--enable-output-mm-physactivate tty output of physical memory manager--enable-output-mm-virtactivate tty output of virtual memory manager--enable-output-mm-heapactivate tty output of kernel heap--enable-output-mm-sharedactivate tty output of shared memory--enable-output-mailboxactivate tty output of mailbox implementation--enable-output-timeractivate tty output of timer implementation--enable-output-initrdactivate initrd implementation output--enable-output-eventactivate event implementation output--enable-output-processactivate process implementation output--enable-output-interruptactivate interrupt request output--enable-output-exceptionactivate exception handler output--enable-output-elfactivate elf routine output--enable-output-syscallactivate syscall output--enable-output-serialactivate serial handling output--enable-output-messageactivate message system output--enable-output-rpcactivate rpc system output--enable-output-sspactivate ssp origin output in kernel--enable-remote-debugactivate remote debugging ( blocks --enable-output )--enable-releaseactivate release build ( blocks --enable-debug and ignores --with-optimization-level )
# just call make for building the project
make clean && makeGetting some debug-print on real hardware, like debug debug-print is done via serial. In case of raspberry pi it is UART0. So to get execution debug-print, you'll need an TTL-RS232 to USB convert cable. When that is existing, wire it up like on the following page and connect it to the development machine. The most simple way to get the serial debug-print is using screen with the connected usb to serial.
# Connect to usb tty port via screen
screen /dev/ttyUSB0 115200
# Exit tty screen session
Ctrl+a Shift+k yEmulation of the project with qemu during development is not recommended. The platforms itself are most time very limited or completely not supported. Raspberry pi is very limited and lack necessary features, also the n900 or the beagleboard are completely not supported. We recommend testing on real hardware with remote debugging via serial port.
Emulation of the kernel project with qemu during development may be done at all with the following commands. When kernel debugging is necessary, add the parameter shorthand -s -S or the long version -gdb tcp:1234 to qemu call:
# raspberry pi zero kernel emulation
qemu-system-arm -M raspi0 -cpu arm1176 -m 512M -no-reboot -serial stdio -kernel ./bolthur/kernel/target/raspi/kernel_qemu.img -initrd ../build-aux/platform/raspi/initrd -dtb ../config/dts/raspi/bcm2708-raspi-zero.dtb -drive file=../build-aux/platform/raspi/sdcard.img,format=raw -append "root=/dev/storage/sd1 rootfstype=ext2" -usb -device usb-mouse -device usb-kbd -s -S
# raspberry pi 2B rev 1 kernel emulation
qemu-system-arm -M raspi2b -cpu cortex-a7 -m 1G -no-reboot -serial stdio -kernel ./bolthur/kernel/target/raspi/kernel7_qemu.img -initrd ../build-aux/platform/raspi/initrd -dtb ../config/dts/raspi/bcm2709-raspi-2-b.dtb -drive file=../build-aux/platform/raspi/sdcard.img,format=raw -append "bcm2708_fb.fbwidth=1024 bcm2708_fb.fbheight=768 root=/dev/storage/sd1 rootfstype=ext2" -usb -device usb-mouse -device usb-kbd -s -S
# raspberry pi 3B kernel emulation
qemu-system-aarch64 -M raspi3b -cpu cortex-a53 -m 1G -no-reboot -serial stdio -kernel ./bolthur/kernel/target/raspi/kernel8_qemu.img -initrd ../build-aux/platform/raspi/initrd -dtb ../config/dts/raspi/bcm2710-raspi-3-b.dtb -drive file=../build-aux/platform/raspi/sdcard.img,format=raw -append "root=/dev/storage/sd1 rootfstype=ext2" -usb -device usb-mouse -device usb-kbd -s -SWithin the project root there are two different gdbinit files that may be used for setting up the debugger. .gdbinit-qemu should be chosen, when debugging the kernel with qemu. In case you want to use remote debugging, you should choose .gdbinit-remote.
The files can be specified by using the parameter -x.
# qemu debugging example
/opt/bolthur/sysroot/arm/bin/arm-unknown-bolthur-eabi-gdb -x .gdbinit-qemu
# remote debugging example
/opt/bolthur/sysroot/arm/bin/arm-unknown-bolthur-eabi-gdb -x .gdbinit-remoteWhen starting remote debugging, you need to specify the target, e.g. target /dev/ttyUSB0 to connect to the running instance. Furthermore, you need to configure the project with option --enable-debug.