01
进程
02
虚拟内存
03
物理内存
04
调度
05
陷入
06
文件与I/O
07
并发
就绪 — 选一个实验,按「下一步」。
进程表
用户空间
task_struct
kernel
fork()
exec()
exit()
进程状态机
内核
文件描述符表
files_struct
虚拟地址空间 (mm_struct + vm_area_struct[])
48-bit VA
四级页表 (PGD→PUD→PMD→PTE)
x86-64
模拟地址翻译
PTE 64位结构 (x86-64)
64 bits
切换: swap entry
TLB 模拟
命中率: --
Copy-on-Write
写时复制
物理页帧图
-- 页使用中
struct page
64B
Buddy Allocator (free_area[0..10])
ZONE_NORMAL
分配 2^n
释放
SLUB Slab (task_struct cache)
freelist
LRU 双链表 (active / inactive)
water: high
CFS 运行队列 (红黑树 / vruntime)
当前: --
clock IRQ
调度时间线 (Gantt)
上下文切换
~1200 cycles
sched_entity
+ prio_to_weight
syscall 路径 (SYSCALL 指令 → 内核 → SYSRET)
user→kernel→user
IDT / 异常向量
256 entries
pt_regs
— 内核栈布局
硬件压栈 5 个寄存器
IRQ 上半部 / 下半部 (softirq / tasklet / workqueue)
hardirq → softirq
VFS 五层结构 (files_struct→file→dentry→inode→address_space)
VFS
单文件
dup / fork
两次 open
unlink while open
Page Cache (address_space / XArray)
-- cached
read()
write()
fsync()
ext4 i_block[15] — 间接块 vs 区段树
切换: extent tree
bio 结构 + I/O 路径
block layer
双线程时间线 (共享 mm_struct)
futex — 快路径 vs 慢路径
快路径: 0 syscall
锁内部结构 (qspinlock / mutex / RCU)
等待图 / 死锁检测
[!] 死锁
信号内部 (sigset_t / k_sigaction / rt_sigframe)
使用指南
close
从这里开始
先认几个词
导航
演示
从步骤栏选择演示,点击「下一步」逐步推进,或「运行演示」自动播放。
颜色语义
简化说明