Skip to content
NikodemMarekPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

107 Commits

Folders and files

Repository files navigation

nios

A simple operating system written from scratch for RISC-V.

Roadmap

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

Running

  1. With nix
direnv allow
run

This creates the enviroment with devenv and runs the project in qemu virtual machine.

  1. 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

Running tests

  1. With nix
direnv allow
check

This creates the enviroment with devenv and runs the tests in qemu virtual machine.

  1. 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_BIN

Those 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages