Kernel Build (Linux)

Building a colorOS kernel image requires installation of the ARM toolchains on the build computer: 32 bit for Raspberry Pi models 1B and 2B, and 64 bit for models 3B (Zero 2W) and 4B. Other combinations — different Raspberry Pi models, and running 32 bit kernels on 3B and 4B, for example — may work, but have not been tested.

Note: You should build and use a Raspberry Pi 3B kernel image for a Raspberry Pi Zero 2W.

You can download the toolchains here:

https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads/13-2-rel1

These build instructions were prepared and tested on Linux (64 bit), using the following downloads (build instructions for other environments will be provided in the future):

  • arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar (32)
  • arm-gnu-toolchain-13.2.rel1-x86_64-aarch64-none-elf.tar (64)

Steps for Building a colorOS on Linux

  1. Download circle-stdlib (with Circle, Newlib, and mbed TLS) from GitHub:
$ git clone --recursive https://github.com/smuehlst/circle-stdlib.git
$ cd circle-stdlib
  1. Configure and Build circle-stdlib for Your Raspberry Pi Model:
Use only one of the following to configure your model:

$ ./configure --opt-tls --prefix arm-none-eabi- --raspberrypi 1
$ ./configure --opt-tls --prefix arm-none-eabi- --raspberrypi 2
$ ./configure --opt-tls --prefix aarch64-none-elf- --raspberrypi 3
$ ./configure --opt-tls --prefix aarch64-none-elf- --raspberrypi 4

And then build:

$ make
  1. Install the colorOS Source (must be in the same directory as the git clone command in step #1):
$ tar xvfz colorOS-pre-1.0.0-src-2024-11-03.tgz
$ cd colorOS
  1. Link colorOS for Your Raspberry Pi Model (requires Linux/Unix or bash shell support):
Replace '#' with your Raspberry Pi model (1-4):

$ ./src/coloros_stdlib #
  1. Build the colorOS Kernel:
$ cd current/build

[Optionally perform any customization by editing coloros.h]

$ make clean
$ make

This process builds the following kernel image (for the Raspberry Pi model specified during steps #2 and #4), which must then be copied to the root of the SD card used to boot the Raspberry Pi:

For 1 - Raspberry Pi 1B: kernel.img
For 2 - Raspberry Pi 2B: kernel7.img
For 3 - Raspberry Pi 3B / Zero 2W: kernel8.img
For 4 - Raspberry Pi 4B: kernel8-rpi4.img

For More Information

More information on building and using Circle and circle-stdlib can be found at the source:

Circle – Thanks to Rene Strange
circle-stdlib – Thanks to Stephan Mühlstrasser