A Simple RISC-V OS Kernel, Inspired by rCore-Tutorial-v3.
🚧 Work In Progress
- Architecture: RISC-V 64
- Platform: QEMU, K210
- Colorful logging
- FIFO / RR scheduler
- SV39 3-level page table
- Easy File System (Triple indirect pointer)
- Multi-thread
- Synchronization
- VirtIO blk/input/gpu drivers
- Test framework (unit test and integration test)
- MLFQ/CFS scheduler
- VirtIO net drivers
- K210 platform support for
ch1
-ch7
- Refactor file system
- A detailed documentation or step-by-step tutorial
- Stricter code style enforced with
#[deny(clippy::all, clippy::pedantic)]
. - Replaces
Makefile
andbuild.rs
with Just for build automation. - Implementation of multi-level directories, file deletion, and file metadata.
- Test framework (unit test and integration test)
- Data structure design enhancements, such as:
MapArea
'sdata_frames
are designed to be placed directly in thePageTable
.BlockCacheManager
usesVec
instead ofVecDeque
.- ...
- Module naming and organization changes, such as:
os
module has been renamed to kernel.TaskControlBlock
is located intcb.rs
instead oftask.rs
to avoid using#[allow(clippy::module_inception)]
.ProcessControlBlock
is placed inpcb.rs
rather thanprocess.rs
.- User library modules are named consistently with kernel modules.
- User programs and test cases are separated from
user_lib
. - ...
- No need to manually append
\0
to strings. - Adoption of newer crates and RustSBI versions.
- Use of clap for command-line argument parsing in easy-fs-fuse.
- More comprehensive shell application featuring:
- Command input and output redirection.
- Prompt displaying the current path.
- Entering the directory name allows for direct navigation to the directory.
- ...
- More command-line applications.
- ...
.
├── apps # user applications
├── bootloader # RustSBI
├── easy-fs-fuse # command-line tool to create EFS image
├── easy-fs-root # Root directory structure for the EFS image
├── easy-fs # easy file system
├── kernel # os kernel
│ ├── assets # static data, images, fonts, or other binary assets
│ └── src # source code of the kernel
│ ├── boards # board support Packages (BSPs) for different hardware platforms
│ ├── drivers # device drivers
│ ├── fs # file system management
│ ├── mm # memory management
│ ├── sync # synchronization primitives
│ ├── syscall # system calls
│ ├── task # task management
│ └── trap # trap handling
├── tests # integration tests
├── user # user library
└── ...
Rust is a prerequisite for this project. Install it by following the official guide.
This will also install cargo
, Rust's package manager, which is used for dependency management and project building.
Just is a handy command runner that simplifies the execution of project-specific commands. Install it by following the instructions on its GitHub page. This tool is used for setting up the environment, building, and running the project with predefined commands.
Run the following command to set up the required environment for the project. This command adds the necessary Rust targets, installs essential Rust tools, and sets up other required components.
just env
QEMU is a generic and open source machine emulator and virtualizer. Install QEMU to emulate the hardware environment for this project. The installation instructions can vary depending on your operating system. Please refer to the QEMU Documentation for detailed installation instructions.
just run
If you need to enable GPU support for the project, you can run:
just run on
For the latest updates and adaptations for the K210 platform, switch to the feature/k210, which is based on the updates from the ch8 branch.
git switch feature/k210
just run
just unit-tests
just integration-tests