馃敡This is a template that can help you quickly build your own OS using rust.
馃HanabiOS is built on it.
馃檹I hope that everyone can use it to understand and learn the underlying principles of computers and the operation of operating systems without barriers!
-
馃寵Use the following command to install the
nightly version of rust,馃榾because we may need to use some features that only this version provides.
rustup install nightly-
馃敡Then set the toolchain used in this project to
nightlyversion of rust.馃敪In the future we can enable some experimental features by adding feature flags at the beginning of
main.rs,馃槴such as adding
#![feature(asm)]to enable experimental introverted compilation.
rustup override add nightly-
馃敡Configure your
target.json,馃摐here we only provide
target.jsonto help you build the system for thex86_64architecture platform.馃榾If you have other written
target.json,welcome to submit it to us!
-
馃摝Install xbuild and bootimage,
馃彮they can help you quickly build an operating system image.
rustup component add rust-src
rustup component add llvm-tools-preview
cargo install cargo-xbuild
cargo install bootimage-
鉁岶rom now on you can directly start writing the code of the operating system!
The entry point of this operating system is the
_startfunction inmain.rs!
cargo bootimage --target target.json
qemu-system-x86_64 -drive format=raw,file=./target/target/debug/bootimage-os_template.bin-
馃槴You will not be able to use anything in
std::,馃敤you need to construct your own api and call it.
-
馃摐The
target.jsongiven here can only help you build an operating system for thex86_64 platform,鉁峱lease write your own for other platforms!
馃If you have
target.jsonfor other platforms,馃ぃplease submit it to us!
鉂hank you!