Welcome to cheetos
project. This a a simple operating system framework for the x86_64
architecture.
cheetos
relies on bootloader
crate for most of the heavy lifting. bootloader
creates a bootable disk image, create page tables, does the memory mapping, etc, so that we can focus on developing the kernel itself.
The structure of the project is highly inspired by the pintos project. However, since the original project was written in C, some parts of the code are not idiomatic in Rust. cheetos
tries to address this issue by rewriting some of the code to match the interface from the standard library of Rust. (e.g. Mutex
for synchonization, GlobalAlloc
for memory allocation, etc.)
cheetos
is still under development!
TODO: Add more description
- Install Rust.
- Install
qemu
for running the operating system in a virtual machine.
Build the project and run it in a qemu virtual machine.
cargo run
Under the hood, it works like this:
cargo run
will first attempt to build the project, if not already built.- Since
Cargo.toml
markskernel
as thebuild-dependencies
, it will build thekernel
crate, which is our operating system. - In
build.rs
, we depend on thebootloader
crate, which will:- Build the kernel into an ELF file.
- Compile the bootloader as a standalone executable.
- Links the bytes of kernel ELF file into the bootloader executable.
- The
bootloader
crate will then generate abootimage
file, which is a bootable disk image. - In
src/main.rs
, we use the built disk image to run the operating system in a qemu virtual machine. - Only if the sources in
kernel
crate is changed,cargo
will rebuild the project.
You can use gdb
to debug pintos
. The following command will start cheetos
in a qemu virtual machine, and wait for gdb
to connect to it.
cargo run -- -g
pintos
contains a rich test suite (it is an educational operating system project, after all). cheetos
ported the test suite to Rust, and you can run it with the following command.
cargo test
This project is highly inspired by the following projects:
Simply said, cheetos
is an attempt to port Pintos into Rust.
Also, the following crates were referenced in this project.
cheetos
do not use these crates as direct dependency, but rather uses sources derived from them.
This project is licensed under the MIT License - see the LICENSE file for details