Mastering C for Kernel Development is a free, open textbook that teaches the
C programming language through the lens of 64-bit operating system kernel development. Each
concept—types and portability, pointers, structures, inline assembly, interrupts, paging,
and dynamic memory—is paired with real code from a small x86-64 teaching kernel, so readers
with basic C experience learn to read and write actual kernel code. Written by Joseph Anthony C.
Hermocilla for CMSC 125 (Operating Systems) at the University of the Philippines Los Baños,
and released under the CC BY 4.0 license.
Table of Contents
1Types and Portability
2Structures, Packing, and Hardware Interaction
3Pointers and Memory
4Inline Assembly and Talking to Hardware
5Interrupts, Function Pointers, and Event-Driven Programming
Yes. It is free to read and download under the Creative Commons Attribution 4.0 (CC BY 4.0) license, so you may share and adapt it with attribution.
Who is it for?
Students and programmers who already know basic C and want to read and write real kernel code. It was written for CMSC 125 (Operating Systems) at UP Los Baños.
What does it cover?
Types, pointers, structures, inline assembly, interrupts, paging and virtual memory, heap allocation, linking C with assembly, and the freestanding C environment — across 16 chapters and 3 appendices.
What codebase does it use?
A small 64-bit x86-64 teaching kernel. Every concept is tied to real source files you can build and run.
What format is it in?
A PDF of roughly 209 pages, with the source available on GitHub.
How to Cite the Book
APA
Hermocilla, J. A. C. (2026). Mastering C for kernel development. Retrieved from
https://jachermocilla.org/publications/books/mckd/ (Licensed under CC BY 4.0)
BibTeX
@book{hermocilla2026masteringc,
author = {Hermocilla, Joseph Anthony C.},
title = {Mastering C for Kernel Development},
year = {2026},
publisher = {Self-published},
url = {https://jachermocilla.org/publications/books/mckd/},
note = {Licensed under CC BY 4.0}
}