A freestanding Rust binary upon which OS abstractions can be built on top of.
- Make sure that you're running the
nightly
version of the Rust compiler. If you're unsure if you haverustup
installed or not, you can install it from here. Once that's done, runrustup toolchain install nightly
to install thenightly
toolchain, then switch to it by runningrustup default nightly
. - Fork the repo, then clone it onto your local machine.
- Download and install QEMU, which is the virtual environment
we'll be running our OS in (you may need to add it to your path). You can check
that QEMU was correctly installed by running
qemu-system-x86_64
and making sure an empty window QEMU window pops up. cd
into the root of thesimple-os
project.- We'll need to add Rust's
core
andcompiler_builtins
libraries locally. Do this by runningrustup component add rust-src
. - We'll need to install some additional prerequisites through
cargo
, namely thebootimage
andllvm-tools-preview
dependencies. You can add these by runningcargo install bootimage
andrustup component add llvm-tools-preview
. - Run
cargo build
to see if everything compiles without issue. - Run
cargo run
. If everything is working correctly, a QEMU window should pop up with"Hello World!"
printed inside of it. - Run
cargo test
. The output should include, among other things, five passing tests that look like the following:
simple_os::vga_buffer::test_println_simple... [ok]
simple_os::vga_buffer::test_println_many... [ok]
simple_os::vga_buffer::test_println_output... [ok]
simple_os::vga_buffer::test_println... [ok]
should_panic::should_fail... [ok]
If you see these statements in your cargo test
output, then everything worked,
and you should be good to go! If you see something different, reach out and let me know
so we can look into it.