需要前置 C 和 Linux 知识
- x86, bootstrap, kernel mode
- protection mode, multi process, process control, memory management, file system, io device control
- inter process communication, network
- virtualization, containerization, cluster
stages:
- get familiar with linux clis
- use glibc or syscall to write applications
- learn the kernel mechanism
- read kernel source code
- customize linux modules
commands
system calls
framework
sys init
x86
- 地址总线 (16, 32) 内存地址的范围
- 数据总线 - 每次最多能从内存取到多少数据
bootstrap
ROM -> BIOS
start kernel
- TASK_INIT(init_task)
- process 0
- trap_init()
- interrupts
- mm_init() - memory
- sched_init() - schedulers
- rest_init()
- kernel_thread(kernel_init, NULL, CLONE_FS) - process 1
- kernel_thread(kthreadd, NULL, CLONE_FS|CLONE_FILES) - process 2
four layers of process (execute permission) ring
- ring0 kernel mode
- ring3 user mode
syscall of open
process control
memory control
file system
io system
IPC
network
virtualization
containerization
practices
references
- 趣谈 Linux 操作系统 - 极客时间