Step 4 - 二级页表 + 缺页 + FIFO

This commit is contained in:
2026-04-14 08:34:17 +08:00
parent bda18464c8
commit 38aa8e9bf4
11 changed files with 605 additions and 10 deletions
+10 -10
View File
@@ -102,22 +102,22 @@
### TODO
- [ ] 新建 `TwoLevelPageTable.cs`:`Dictionary<L1, Dictionary<L2, PTE>>`
- [ ] 新建 `PageTableEntry.cs`:`PFN / present / dirty(可选)`
- [ ] 新建 `PhysicalMemoryManager.cs`:空闲帧管理 + FIFO 队列
- [ ] 缺页时分配空闲帧;无空闲帧时 FIFO 淘汰
- [ ] 淘汰后同步页表项状态(`present = false`)
- [x] 新建 `TwoLevelPageTable.cs`:`Dictionary<L1, Dictionary<L2, PTE>>`
- [x] 新建 `PageTableEntry.cs`:`PFN / present / dirty(可选)`
- [x] 新建 `PhysicalMemoryManager.cs`:空闲帧管理 + FIFO 队列
- [x] 缺页时分配空闲帧;无空闲帧时 FIFO 淘汰
- [x] 淘汰后同步页表项状态(`present = false`)
### 行为要求
- [ ] 页表命中:TLB 未命中后,页表中有 `present = true` 映射
- [ ] 缺页:页表不存在或 `present = false`
- [ ] 装入页面后写回页表并更新 TLB
- [x] 页表命中:TLB 未命中后,页表中有 `present = true` 映射
- [x] 缺页:页表不存在或 `present = false`
- [x] 装入页面后写回页表并更新 TLB
### 完成标准
- [ ] 能稳定运行大量访问(例如 `N=10000`)无崩溃
- [ ] FIFO 次序可从日志中验证
- [x] 能稳定运行大量访问(例如 `N=10000`)无崩溃
- [x] FIFO 次序可从日志中验证
## 6. Step 5 - 翻译引擎(单步状态机)