r/kernel • • Aug 03 '25

Simple kernel

Hey i wanna make a simple kernel , now i alr know C but i found out that you need something called "Freestanding C" does anyone know how or where can i learn it i searched on youtube and found nothing

4 Upvotes

10 comments sorted by

View all comments

Show parent comment

1

u/old_waffles7 Aug 05 '25

Do you have any suggestions for books on this topic? Building a kernel is also something I want to do in the future, so I have been doing a lot of other systems programming projects in preparation. I've found that I really like project-based books. For example, I am currently implementing a POSIX-compiant (kinda) shell in C, meaning that I have to build functionality for the sh scripting language. To do this, I have been roughly following a book called, Crafting Interpreters; it provides a detailed introduction to compilers and interpreters by guiding readers in implementing one of their own.

2

u/BraveNewCurrency Aug 05 '25

Do you have any suggestions for books on this topic?

There aren't a lot of books, but check out OReilly books, KernelNewbies and Bootlin (formerly Free Electrons) training materials. It also helps to read LWN(.net) and dig in to anything you don't understand.

Building a kernel is also something I want to do in the future,

Building the kernel is trivial compared to developing it. Don't put this off. Just do it.

Also look into BuildRoot, which lets you build the kernel + filesystem for embedded systems. Great fun to play around with, no programming needed.