通过虚拟页表找到物理页表 找到物理页号 physical page number/physical frame number
2. 页表存在哪里
页表可以变得非常大
先假设页表存在内存里
稍后会了解到 实际上是存在虚拟内存里的...
3. 页表中究竟有什么
3.1. 线性页表 linear page table
就是一个数组
通过虚拟页号 VPN 检索该数组,通过索引查找页表项 PTE..以便找到期望的物理帧号
3.2. PTE 页表项
有效位 valid bit 指示特定地址转换是否有效
一个程序运行时 中间未分配未使用的空间都会被分配为无效...
保护位 protection bit 表明页是否可以读取、写入或执行
存在位 present bit
脏位 dirty bit
参考位 reference bit / 访问位 accessed bit
4. 分页:也很慢
内存中的页表 太大了!会让速度变慢
内存虚拟化是一个大问题...
5. 内存追踪
通过一个简单的数组循环来理解操作系统内部实际的操作...
为什么循环的复杂度是 O(n) 为什么比赛尽量避免使用 循环...
我们于是知道 即使是简单的上层行为 在下层也会引起灾难性的行为
以后也只会更复杂...
6. 作业(模拟作业)
In this homework, you will use a simple program, which is known as paging-linear-translate.py, to see if you understand how simple virtual-to-physical address translation works with linear page tables. See the README for details.
Address Space Size: Increasing the address space size while keeping the page size constant increases the number of page table entries linearly.
Page Size: Increasing the page size while keeping the address space size constant decreases the number of page table entries.