A simple operating system written from scratch for RISC-V.
This is a rough roadmap for the project, it can and will change regularly. Goal is to build features incrementally, making sure it just works, improving later.
- Kernel init
- Simple trap handling
- Physical Memory Manager
- Kernel Heap (kmalloc)
- UART input (poll LSR, read bytes)
- Shell
- Line reader (buffered input, backspace handling)
- Command parser (tokenize input)
- Built-in commands
- Virtual Memory and Paging
- Multitasking and Context Switching
- Hardware timer
- Timer interrupt handler
- Process queue
- Context switch
- With nix
direnv allow
runThis creates the enviroment with devenv and runs the project in qemu virtual machine.
- Without nix
cargo build
qemu-system-riscv64 \
-machine virt \
-cpu rv64 \
-nographic \
-bios default \
-serial mon:stdio \
--no-reboot \
-kernel target/riscv64gc-unknown-none-elf/debug/nios-kernel- With nix
direnv allow
checkThis creates the enviroment with devenv and runs the tests in qemu virtual machine.
- Without nix
TEST_BIN=$(cargo build --tests --message-format=json | jq -r 'select(.executable != null) | .executable')
qemu-system-riscv64 \
-machine virt \
-cpu rv64 \
-nographic \
-bios default \
-serial mon:stdio \
--no-reboot \
-kernel $TEST_BINThose tests need to run on RISC-V machine, therefore vm is required for testing.
The --message-format flag is needed to get the name of test executable that cargo build produces, as it needs to be loaded as a kernel into qemu vm.