Skip to content
This repository has been archived by the owner on Dec 9, 2018. It is now read-only.

japaric-archived/eighty-six

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

x86 bare metal Rust thing

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published