昨天CSAPP上的疑问的解答
2013-07-21 22:53
232 查看
昨天CSAPP上的疑问的解答
今天整明白了。
CSAPP英文版第2版,826页,或者中文版第2版546页,有这么一段。关于多级页表的。
"But if we had a 32-bit address space, 4KB pages, and a 4-byte PTE[page table entry, 杨注], then we would need a 4MB page table resident in memory at all time..."
其中"32-bit address space"的意思是 2^32 bytes,而不是2^32 bits,因为内存是按字节而不是按比特寻址的。
根据公式:页表尺寸 = (地址空间 / 页尺寸) * PTE入口大小........公式1
32-bit address space: 2^32 bytes (昨天误作bits)
4KB pages: 4K bytes
a 4-byte: 4 bytes
B: bytes
又
K = 2^10
M = 2^22
代入公式1的右侧,得
(2^32 bytes / 4K bytes) * 4 bytes
= 2^32 * 2^2 / (2^2 * 2^10) bytes
= 2^22 bytes
= 2^2 M bytes
= 4MB
--------------------
博客会手工同步到以下地址:
[http://giftdotyoung.blogspot.com]
[http://blog.csdn.net/younggift]
今天整明白了。
CSAPP英文版第2版,826页,或者中文版第2版546页,有这么一段。关于多级页表的。
"But if we had a 32-bit address space, 4KB pages, and a 4-byte PTE[page table entry, 杨注], then we would need a 4MB page table resident in memory at all time..."
其中"32-bit address space"的意思是 2^32 bytes,而不是2^32 bits,因为内存是按字节而不是按比特寻址的。
根据公式:页表尺寸 = (地址空间 / 页尺寸) * PTE入口大小........公式1
32-bit address space: 2^32 bytes (昨天误作bits)
4KB pages: 4K bytes
a 4-byte: 4 bytes
B: bytes
又
K = 2^10
M = 2^22
代入公式1的右侧,得
(2^32 bytes / 4K bytes) * 4 bytes
= 2^32 * 2^2 / (2^2 * 2^10) bytes
= 2^22 bytes
= 2^2 M bytes
= 4MB
--------------------
博客会手工同步到以下地址:
[http://giftdotyoung.blogspot.com]
[http://blog.csdn.net/younggift]
相关文章推荐
- 昨天CSAPP上的疑问的解答
- iOS app 疑问解答
- CS:APP二进制炸弹附加篇
- Android studio打包App报错:Error:(4) Error: "app_name" is not translated in "ar" (Arabic), "cs" (Czech)
- mac下使用pf进行端口转发的疑问与解答
- 微信小程序 1 月 9 日正式发布!张小龙解答了 10 大疑问
- js中document.write使用过程中的一点疑问解答
- 《CS:APP》开书大典
- 常见的Angular疑问解答
- 解答网友27岁不想出差,想转行做程序员的疑问
- JavaScript单线程的疑问与解答
- [CS:APP] Attack Lab
- spi一些疑问的解答
- SQLServer2008中查询语句的疑问,求网友大神解答
- CS:APP中的tsh示例
- 数据挖掘新手常见疑问解答(2)
- 负数补码和负数本身进行转换的一个好方法---解答一网友的疑问
- 微信APP支付常见开发问题解答
- Block使用中的一些疑问解答