torralbaalla / smol-kernel

@nobody5050 and me after reading OSDev tutorials and random PDFs on the BCM.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

small kernel

Building

The build system isn't cursed, but the toolchain and OS tuple is: you need an AArch64 OS (kernel and userspace) and ARM's toolchain. The instructions in this section cover RPiOS.

Installing the userspace

The easiest way to do this is by installing raspbian-nspawn-64:

sudo apt-get update
sudo apt-get install -y raspbian-nspawn-64

You might have to reboot your system to complete the instalation. After that, install the build and testing dependencies:

sudo apt-get install -y make qemu-system-aarch64 tar

The following steps should be performed inside the container.

Installing the toolcahin

Download the GNU Toolchain provided by ARM (aarch64-none-elf target) for AArch64 hosts, and untar it under a toolchain directory:

tar -xJf gcc-arm-10.*-aarch64-aarch64-none-elf.tar.xz -C toolchain

Configuring

Copy config.def.mk to config.mk and edit it as needed. For example, edit the PREFIX variable to the path to your toolchain and its prefix:

PREFIX:=/path/to/toolchain/gcc/aarch64-none-elf-

And finally, to actually build the kernel, simply do make.

Testing

To test the kernel, do make test.

License

The optimized routines (located under arm-routines) by Arm Limited are licensed under a MIT license. The rest of the code is licensed under the same MIT license.

Great part of the current code is based on the raspberry-pi-os tutorial by @s-matyukevich and the raspi3-tutorial by @btzsrc.

About

@nobody5050 and me after reading OSDev tutorials and random PDFs on the BCM.

License:MIT License


Languages

Language:Assembly 84.9%Language:C 13.6%Language:Makefile 1.5%