All Projects → japaric-archived → eighty-six

japaric-archived / eighty-six

Licence: other
x86 bare metal Rust thing

Programming Languages

rust
11053 projects
shell
77523 projects

Build Status

eighty-six

x86 bare metal Rust thing

I'm following the intermezzOS book to get a feel about how Rust can be used for x86 kernel development. I'm particularly interested in studying the tooling involved as I heard that developers make use of Makefiles and external assembly files to build their kernels, and I feel that neither (Makefiles or external assembly files) should be necessary if one uses Cargo to build the kernel (but I might be wrong).

I have another goal: I'd love the replace rustc dependence on an external linker (usually gcc) with a lld that's embedded in rustc itself. The x86 kernel dev space is an excellent testing ground for this as its "executables" (the kernels) are free of C dependencies (libraries, startup objects, etc.). Check the lld branch for more details.

Progress

Chapter 3

I've just finished Chapter 3, and my "kernel" prints "Hello, world!" to the screen and does nothing more 🎉. Some relevant differences between my build process and intermezzOS':

# Build the kernel
$ xargo build --target x86_64
  • No external assembly files. The multiboot header (multiboot_header.asm) has been fully implemented in the linker script. And boot.asm has been implemented as Rust code (src/main.rs).
  • There's only a single line of assembly: asm!("hlt"), which can't be emitted using pure Rust code (AFAIK).
  • core is not explicitly build. Xargo takes care of compiling it without user intervention.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].