> For the complete documentation index, see [llms.txt](https://nskernel.gitbook.io/kernel-play-guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nskernel.gitbook.io/kernel-play-guide/master.md).

# Introduction

Read this book on <https://nskernel.gitbook.io/kernel-play-guide/>.

## Why I write this book

This book is created because RTFSC is hard and RTFM is merely impossible for Linux due to the lack of true *manuals.* For years, millions of CS students go into the System and Networking area, and most of them finally decide to go for the network. They are afraid of the Linux Kernel. When they face a million-lines-of-code project they don't know what to do. They know it in concept but when it just comes to the exact detail - the detail that is poorly documented - like adding a flag to a process's metadata, things would go totally frustrating because they simply don't know where to start. Most of the documentations of the Kernel are generated by tools and if you want to find a book it is usually too massive to even start reading. Luckily, if you RTFSC, things could be done. Just with some pain in the ass.

As a CS student doing system research, I totally understand that feeling. I have read the code so I hope you don't need to do it again. Or at least not from scratch. I hope once you have the concept and the idea of what you want to do, you can find a way to achieve your goal here.

## About this book

This book is NOT A DOCUMENTATION, and is NOT AN INTRODUCTION TO THE LINUX KERNEL. It functions as a manual, a what-to-do, instead of a how-it-works. It covers from the most fundamental things like where to find the kernel source code and how to build a custom kernel, all the way to the structures and flows in the kernel.&#x20;

Some technologies outside the Linux Kernel will be introduced as how-it-works, however, but those are written for better understanding of what-to-do in the kernel instead of and introduction.

## Should you read it

GEEK OUT. If you do not know what EXACTLY you want to find in this book then you should probably not read it. If you want to know how Linux works or even just want to learn some OS basics, then you should seek for something else. Like Apple says in their documentations of the Darwin Kernel (macOS's kernel), *there are many good introductory operating systems texts, this is not one of them*.&#x20;

To read this book I assume you have a decent knowledge of x86-64 assembly, C language and operating systems, probably a little bit of compiler as well.

## How will I write this book

I will update this book after I run into something and solve it later. It's like a blog, but more organized.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://nskernel.gitbook.io/kernel-play-guide/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
