A hybrid RTOS
The goal of this project is to explore a new way to create a kernel using a hybrid architecture based on a monolithic and a microkernel, to see if it's possible to develop a kernel for an RTOS with some features of a GPOS, with real-time constraints and security from user-space and kernel-space. As this is my first real kernel, I want to make everything from scratch to really learn how a kernel works and take every chance to create something new. This includes parsing the FDT, IPC, and implementing a filesystem.
Features that are currently working:
- Platform layer using FDT or statically defined devices.
- Init drivers from platform layer.
- Sub-systems for each type of devices(serial, timer, etc).
- Machine memory handling.
- Traps handling(interruptions and exceptions handling).
Target where the kernel can build, boot, and run:
- riscv32imc-unknown-none-elf
To build the kernel, use the following command:
make buildTo run the kernel in qemu, use the following command:
makeList of other makefile commands:
# Run the kernel using config in makefile(qemu config and targeted binary)
make run
# Available flags for run commands:
# DEBUG=1 -> run qemu with gdb flags, use to debug using gdb from `make debug` command.
# DUMP_LOGS=1 -> dump logs from target binary into a out.log in logs/.
# DUMP_DTB=1 -> dump the dtb from qemu, generate a .dtb file in logs/. Make it readable using the `make dtc` command
# Build the kernel using cargo commands
make build
# Build the kernel for testing env
make test_build
# Check all kernel source code, correctly formated files and no warnings
make check
# Clean the logs and target directories
make clean
# Run gdb with target for debugging
make debug
# Run objdump and redirect output to a log.txt in logs/ dir from debug binary
make objdump
# Convert the dump DTB from qemu to a dts file
make dtc# Run clippy with target flags
cargo clipAll architecture and design choices are documented here: Documentation/.
A documentation for configuration and usage is coming soon.
The kernel code conventions is documented here: Documentation/coding_conventions.md.
- Device tree specification: https://devicetree-specification.readthedocs.io/en/stable/