3 ms·
This is all great advice. > probably involves reading some books about modern OSes in general as a primer > I started long enough ago that I have a hard time
by livueta 4y ago
This is all great advice.
> probably involves reading some books about modern OSes in general as a primer
> I started long enough ago that I have a hard time recommending any specific resources.
Having gotten into kernel programming in the last decade I'd just like to offer a specific recommendation that really helped me out: https://www.amazon.com/Design-Implementation-FreeBSD-Operating-System-ebook/dp/B00O56CFEE https://www.amazon.com/Design-Implementation-FreeBSD-Operati...
I started out literally just reading stuff in the source tree/man(9) (which was informative!) but then my employer gave me a copy of this book, and I found it to be a super-helpful aid in understanding the general organization and motivation of the kernel: what kinds of tasks and problems each component needs to address, how components interact with each other, and the basic building blocks by which these things get done. I found that having a higher-level understanding of the what/why of each bit, covering algorithm/data structure details but probably not the exact code implementation, made grasping the actual kernel code a lot easier.
Oh, also: dtrace is a very fun and interactive way of getting a live peek into FreeBSD kernel structures without doing a whole bunch of scary recompilation. You can e.g. start digging around in `curthread->td_proc` on a process you control and you'll discover a whole lot about how the kernel manages processes.