Learning stuff by building a tiny OS with Rust.
- Install macFUSE (required for compiling grub on macOS).
- Download rust standard library source code:
rustup component add rust-src
# Build kernel
$> make
# Run kernel
$> make run
Target Configuration can be found in x86_64-rust-os.json.
It replicates x86_64-unknown-linux-gnu
, with the following differences:
os=none
(rust-os
is its own unknown OS)panic-strategy=abort
(disable stack unwinding, as it is not supported withno_std
)disable-redzone=true
(disable redzone stack pointer optimization to prevent stack corruption)features=-mmx,-sse,+soft-float
(disable SIMD for better performance during interrupts, and use software-emulated floats since it requires SIMD registers otherwise)linker-flavor=ld.lld
andlinker=rust-lld
(use lld cross-platform linker)
For more details, refer to: