Booting/README.md
Welcome to the boot journey of the Linux kernel, from power-on to the first instruction of the decompressed kernel. This chapter walks the complete boot path step by step from the moment you power on your computer to the moment the Linux kernel loaded in the memory of your machine.
This chapter assumes you are comfortable with basic computer architecture and have a light familiarity with C programming language and x86_64 assembly syntax. You do not need to be a kernel expert, but being able to read short code snippets and recognize hardware terms will help.
Each part of this chapter focuses on one boot phase. Read in order the first time, then revisit individual steps as references when you want to map a specific symbol or register setup to its place in the sequence. It is quite useful to have the source code of Linux kernel on your local computer to follow the details. You can obtain the source code using the following command:
git clone [email protected]:torvalds/linux.git
During reading this and other chapters, you may encounter special notation:
CS, DS, SS, CR0, CR3, CR4, EFER - refer to x86 segment and control registers0x... - denotes hexadecimal valuesentry_* and startup_* - are common prefixes for early boot symbolssetup code refers to the early part of the Linux kernel which executes preparation to load the kernel code itself into memorydecompressor refers to the part of the setup code that inflates the compressed kernel image into memoryThis chapter corresponds to Linux kernel v6.19.