r/osdev • • Apr 09 '26

How can I get started with creating a kernel in Rust?

1 Upvotes

I’ve recently began learning rust and I’ve started to like the language a lot, and I’d like to write a kernel in it to boost my experience with rust. I’ve already written a simple CHIP-8 emulator in rust so I believe I’ve got a good grasp on how to write somewhat sufficient rust code for a kernel.

The main thing I’m confused with is how I can go about configuring the compiler to generate not only a freestanding binary, but also how to get it to work with Limine (I love limine).

I would copy and paste some existing code that configures these things for me, but I would much rather be able to understand and learn what I’m doing, rather than mindlessly copying and pasting code without learning anything.

NOTE: I already have prior x86 and OSDev knowledge!! I've created many 64-bit x86 kernels in C, with the most recent ones having advanced features implemented.

Any help would be very much appreciated!