1 comments

  • TheMagicHorsey2 days ago
    I had no idea there was an entire OS written in Rust that was this far along. Is all the bootstrapping from assembly directly into Rust, or do they still have a dependency on C and gcc just to get things going?
    • steveklabnik16 minutes ago
      There are pure rust, no c, embedded RTOSes, like Hubris.
    • yencabulator1 day ago
      Here, make your own &quot;kernel&quot; in a few lines: <a href="https:&#x2F;&#x2F;rust-osdev.github.io&#x2F;uefi-rs&#x2F;tutorial&#x2F;app.html" rel="nofollow">https:&#x2F;&#x2F;rust-osdev.github.io&#x2F;uefi-rs&#x2F;tutorial&#x2F;app.html</a>
    • segbrk2 days ago
      Here you go: <a href="https:&#x2F;&#x2F;gitlab.redox-os.org&#x2F;redox-os&#x2F;kernel&#x2F;-&#x2F;blob&#x2F;master&#x2F;src&#x2F;arch&#x2F;x86_shared&#x2F;start.rs" rel="nofollow">https:&#x2F;&#x2F;gitlab.redox-os.org&#x2F;redox-os&#x2F;kernel&#x2F;-&#x2F;blob&#x2F;master&#x2F;sr...</a>
      • refulgentis47 minutes ago
        Thanks for the link! For anyone else clicking through: this is the kernel entry point for x86&#x2F;x86_64. What it shows is a very thin #[naked] inline assembly trampoline (kstart) that sets up the stack and immediately jumps into unsafe extern &quot;C&quot; fn start(), which is pure Rust. So the bootstrap path here is: a few dozen lines of inline asm to Rust, no C.<p>Though it&#x27;s worth noting this is one file in one component. The kernel entry being C-free doesn&#x27;t necessarily tell the whole story. If you peek at that directory listing in the blog post, relibc&#x2F; is in recipes&#x2F;core. reblic is Redox&#x27;s libc replacement, which is mostly Rust, but has historically needed a C compiler for some POSIX compatibility shims.<p>And the bootloader, firmware handoff, and build system are all separate questions.<p>So the short answer to the original question seems to be: the kernel itself bootstraps from minimal inline asm directly into Rust, no C in the path. The full OS build story is probably more nuanced than any single source file can confirm.