Featured image of post Linux Study Note

Linux Study Note

In this post, I explore the Linux boot process—from powering on the system to reaching the login screen. I’ll break down each stage, including BIOS/UEFI, bootloader, kernel initialization, and the transition to user space. This is the beginning of my journey into understanding the inner mechanics of Linux.

Let’s begin

Initially, BIOS (Basic Input/Output System) will load 512 bytes data (aka MBR: Master Boot Record) from the disk into memory at address 0x7c00. BIOS then hands off execution to the bootloader.

1
2
3
4
5
BOOTSEG  = 0x07c0			! original address of boot-sector
...
start:
	mov	ax,#BOOTSEG
	mov	ds,ax

This section of code simply moves 0x07c0 into ds register. So next time when we access ds register with an offset, the result will be (0x07c0 « 4) + offset => 0x7c00 + offset. Hence, Linux will be able to execute start-up area code with ds register plus an offset.

References:

  1. dibingfa (no date) flash-linux0.11-talk. GitHub. Available at: https://github.com/dibingfa/flash-linux0.11-talk (Accessed: 21 April 2025).
  2. lewischeng-ms (no date) linux. GitHub. Available at: https://github.com/lewischeng-ms/linux (Accessed: 21 April 2025).
Built with Hugo
Theme Stack designed by Jimmy