

Ask HN: Resources to get started writing user space over a (linux) kernel? - collinglass

I&#x27;d like to start hacking away at my own OS over the linux kernel, how do I get started? I&#x27;ve looked at tons of kernel hacking resources, is this it? I&#x27;d like a resource that distinguishes &quot;user space&quot; from kernel space.
======
JoshTriplett
Assuming you want to start from scratch, perhaps as a learning exercise,
without leveraging glibc and similar:

First, try running a kernel directly within a VM such as KVM. Then read about
the initramfs format and how to construct one, and build a simple one with a
single statically linked executable. Explore what you can do with that.

[http://www.muppetlabs.com/~breadbox/software/tiny/teensy.htm...](http://www.muppetlabs.com/~breadbox/software/tiny/teensy.html)
might provide you with more insight into the syscall interface and the ELF
format. From there, look into the ELF "interpreter" mechanism and the dynamic
linker. Then, write a C program that doesn't link to glibc, and instead makes
syscalls directly.

