Update Readme for A Minimal Rust Kernel post

This commit is contained in:
Philipp Oppermann
2019-01-27 16:58:42 +01:00
parent 858a2f94c6
commit f013172dd7

View File

@@ -1,24 +1,50 @@
# Blog OS (A Freestanding Rust Binary) # Blog OS (A Minimal Rust Kernel)
[![Build Status](https://travis-ci.org/phil-opp/blog_os.svg?branch=post-01)](https://travis-ci.org/phil-opp/blog_os/branches) [![Build Status](https://travis-ci.org/phil-opp/blog_os.svg?branch=post-02)](https://travis-ci.org/phil-opp/blog_os/branches)
This repository contains the source code for the [A Freestanding Rust Binary][post] post of the [Writing an OS in Rust](https://os.phil-opp.com) series. This repository contains the source code for the [A Minimal Rust Kernel][post] post of the [Writing an OS in Rust](https://os.phil-opp.com) series.
[post]: https://os.phil-opp.com/freestanding-rust-binary/ [post]: https://os.phil-opp.com/minimal-rust-kernel/
**Check out the [master branch](https://github.com/phil-opp/blog_os) for more information.** **Check out the [master branch](https://github.com/phil-opp/blog_os) for more information.**
## Building ## Building
You need a nightly Rust compiler. To build the project on Linux, run: You need a nightly Rust compiler. First you need to install the `cargo-xbuild` and `bootimage` tools:
``` ```
cargo rustc -- -Z pre-link-arg=-nostartfiles cargo install cargo-xbuild bootimage
``` ```
The entry point and the build command differ slightly on macOS and Windows. See the [post] for more information. Then you can build the project by running:
```
bootimage build
```
This creates a bootable disk image in the `target/x86_64-blog_os/debug` directory.
Please file an issue if you have any problems. Please file an issue if you have any problems.
## Running
You can run the disk image in [QEMU] through:
[QEMU]: https://www.qemu.org/
```
bootimage run
```
Of course [QEMU] needs to be installed for this.
You can also write the image to an USB stick for booting it on a real machine. On Linux, the command for this is:
```
dd if=target/x86_64-blog_os/debug/bootimage-blog_os.bin of=/dev/sdX && sync
```
Where `sdX` is the device name of your USB stick. **Be careful** to choose the correct device name, because everything on that device is overwritten.
## License ## License
The source code is dual-licensed under MIT or the Apache License (Version 2.0). The source code is dual-licensed under MIT or the Apache License (Version 2.0).