🔧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
nightly
version 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.json
to help you build the system for thex86_64
architecture 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
-
✍From now on you can directly start writing the code of the operating system!
The entry point of this operating system is the
_start
function 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.json
given here can only help you build an operating system for thex86_64 platform
,✍please write your own for other platforms!
🤝If you have
target.json
for other platforms,🤣please submit it to us!
❤Thank you!