Skip to content
NekoOS-GroupPublic

About

A rust based risc-v operating system!

Topics

Resources

Stars

12 stars

Watchers

2 watching

Forks

Latest commit

 

History

38 Commits

Folders and files

Repository files navigation

Logo

NekoOS

A Rust-based RISC-V operating system kernel
Explore the docs »

Contributors Forks Stars Issues License

View Demo · Report Bug · Request Feature

About The Project

NekoOS is a Rust-based RISC-V operating system kernel focused on a small, readable codebase for learning and experimentation. It is no_std, targets bare metal, and runs on QEMU.

Built from the ground up using Rust's safety features, NekoOS provides a playground for OS development enthusiasts and a practical example of systems programming in Rust.

Project Structure

  • kernel/ — kernel crate (arch, mm, trap, task, dev, algorithms)
  • ulib/ — minimal user-space support library
  • docs/ — design notes and developer docs
  • Makefile, env.mk — build, run, and environment checks
  • Cargo.toml — workspace definition

Getting Started

Prerequisites

To build and run NekoOS, you'll need:

  1. Rust Toolchain:

    # Install rustup if you haven't already
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    
    # Install the stable toolchain
    rustup toolchain install stable
    
    # Target and components
    rustup target add riscv64gc-unknown-none-elf
    rustup component add rust-src llvm-tools-preview
    cargo install cargo-binutils
  2. QEMU:

    • Ubuntu/Debian: sudo apt install qemu-system
    • macOS: brew install qemu
  3. Debugging tools (optional):

    • GDB: sudo apt install gdb-multiarch (Ubuntu/Debian)
    • LLDB: Available with most Rust installations

Building and Running

  1. Verify your environment:

    make check-env
  2. Build the kernel:

    make build
  3. Run the kernel in QEMU:

    make run LOG=INFO

    LOG is compiled into the kernel. Change the value and rebuild to update log output.

  4. Debug the kernel:

    make debug     # Start QEMU in debug mode
    make gdb       # Connect with GDB
    # or
    make lldb      # Connect with LLDB

Docs

  • docs/STRUCTURE.md — kernel layout and boot flow notes

Todo List

  • debug/backtrace
  • dev/block
  • dev/char
  • dev/console
  • dev/cpu
  • dev/fdt
  • dev/timer
  • fs
  • mm/kernel heap (todo: oom handler)
  • mm/page table
  • mm/riscv64 (sv39; todo: sv48, sv57, sv64)
  • mm/riscv32 (sv32)
  • syscall
  • schedule (todo: restructure schedule into algorithm)
  • schedule/scheduler
  • schedule/task/abi
  • schedule/task/process
  • schedule/task/thread
  • schedule/task/idle
  • trap (arch independent)
  • ulib

🤝 Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions to NekoOS are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/amazing-feature)
  3. Commit your Changes (git commit -m 'Add some amazing feature')
  4. Push to the Branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please make sure to follow our coding standards and test your changes before submitting.

License

Distributed under the GPL-3.0 License. See LICENSE for more information.

About

A rust based risc-v operating system!

Topics

Resources

Stars

12 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages