Getting started

Clone, build and run bedrock[RTOS] on QEMU.

Requirements

Tool Used for
arm-none-eabi-gcc, newlib Cortex-M build. The link step uses -lc -lnosys -lgcc.
qemu-system-arm Running the image on the emulated LM3S6965 board.
Go Building chorus from the submodule.
Zig 0.16 or newer Building the Kconfig tools. Optional.
gcc Host build for x86-64 Linux. Optional.

On Arch Linux:

sudo pacman -S arm-none-eabi-gcc arm-none-eabi-newlib qemu-system-arm go

Clone

git clone --recursive https://github.com/bedrockRTOS/bedrock-core.git
cd bedrock-core

The repository has two submodules:

Path Repository
3rd/tools/chorus z3nnix/chorus, the build system
3rd/tools/kconfig bedrockRTOS/kconfig-tools

If the repository was cloned without --recursive, fetch them with:

git submodule update --init

Build chorus

cd 3rd/tools/chorus
go build -o chorus .
sudo cp chorus /usr/local/bin/
cd ../../..

Build

chorus

The default target produces:

File Contents
libbedrock_kernel.a Scheduler, tasks, time, IPC, panic
libbedrock_hal.a Cortex-M timer, context switch, UART, startup
libbedrock_lib.a Fixed-block pool allocator
bedrock_example.elf examples/main.c linked with the three libraries

Run

chorus run

This runs qemu-system-arm -M lm3s6965evb -kernel bedrock_example.elf -nographic. The example starts two tasks that print to UART0:

bedrock[RTOS] v0.0.1 booting...
Starting scheduler
[A] tick
[B] tock

The version string is hardcoded in examples/main.c. The kernel version is defined in bedrock.h and is currently 0.0.3.

To exit QEMU, press Ctrl+A, then X.

Clean

chorus clean

Removes *.o, *.a, *.elf, *.bin, the host binaries and include/generated.

Next