Rust Bare Bones

From OSDev.wiki
Revision as of 10:20, 14 June 2016 by osdev>Lfairy (rustc no longer adds stack checks -- see https://github.com/rust-lang/rust/pull/27338)
Jump to navigation Jump to search
This page is a work in progress.
This page may thus be incomplete. Its content may be changed in the near future.
Kernel Designs
Models
Other Concepts

WAIT! Have you read Getting Started, Beginner Mistakes, and some of the related OS theory?

Notes

  • The rust libcore can easily be included in a kernel, it's analogous to C's freestanding headers
  • Enable `--gc-sections` in ld to avoid having to define symbols you don't need (e.g. floating point math functions)
  • Always use a target json file (Flexible Target Specifications)
  • If you're building a UEFI app, disable function sections as well
    • rustc puts every item in its own section by default. The PE format has a limit of 96 sections. So unless you disable function sections, your project will most likely fail to load.


Examples