Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rCore-Tutorial-Book-v3/chapter4/9answer #175

Open
utterances-bot opened this issue Mar 16, 2023 · 8 comments
Open

rCore-Tutorial-Book-v3/chapter4/9answer #175

utterances-bot opened this issue Mar 16, 2023 · 8 comments
Labels
comments An area where readers can discuss related topics after every article.

Comments

@utterances-bot
Copy link

练习参考答案 - rCore-Tutorial-Book-v3 3.6.0-alpha.1 文档

http://rcore-os.cn/rCore-Tutorial-Book-v3/chapter4/9answer.html

Copy link

在使用高级语言编写用户程序的时候,手动用嵌入汇编的方法随机访问一个不在当前程序逻辑地址范围内的地址,比如向该地址读/写数据。该用户程序执行的时候可能会生什么?
可能会报出缺页异常.

缺页异常是否有些不合适呢?题设给出的是访问超出当前程序逻辑地址范围内的地址,那么这种访问会在MMU进行逻辑地址检查时候就会出现异常,这种异常叫做内存异常是否会更好一些呢?

@wyfcyx wyfcyx added the comments An area where readers can discuss related topics after every article. label Jun 2, 2023
Copy link

kayoch1n commented Jun 4, 2023

为何使用虚拟内存之后 sys_get_time 会失效?我理解 sys_get_time 最终只是读取 0xC01 的CSR,并没有读写内存的操作,不太理解?

@kayoch1n
Copy link

kayoch1n commented Jun 4, 2023

为何使用虚拟内存之后 sys_get_time 会失效?我理解 sys_get_time 最终只是读取 0xC01 的CSR,并没有读写内存的操作,不太理解?

我之前看漏了,原来 sys_get_time 是有一个指针参数的 😂 还有一个疑问就是编程题第二题 “任务和操作系统内核共用同一张页表的单页表机制”,按照我的理解是不是就只能放到同一个地址空间里了?让不同的任务用不同的区域,这样好像就变回了第四章之前的物理内存布局

@wyfcyx
Copy link
Collaborator

wyfcyx commented Jun 4, 2023

@kayoch1n 不是的,是说每个进程一个页表,低地址空间为应用的数据,高地址空间为内核的数据。所有进程共享高地址空间的内核数据,但低地址空间的应用数据每个应用是不同的。

Copy link

页式虚拟存储还可以同时解决内存外碎片。提高空间利用率。

这个说法是否不太严谨?页式虚存能够解决外碎片,但是只能在一定程度上缓解内碎片的产生,但不能根治吧,它相对于固定分区的情形肯定是在内碎片上优化了很多,但还是会有内碎片。

@wyfcyx
Copy link
Collaborator

wyfcyx commented Oct 26, 2023

@chestNutLsj 确实不太严谨,已修改。

Copy link

TL-SN commented Jan 15, 2024

问答题第五题,页目录表(一级页表)不应该一直长驻内存吗,二级、三级也变可能会缺页,但一级页表不会发生缺页吧

Copy link

我想请问一下,我该怎么触发缺页异常呢,按照我的理解我们在qemu上模拟的时候都没有单独模拟磁盘,我现在想通过使用有效位和第54位(预留位)来表示页面是否位于内存中,但是使用预留位之后我在更新TLB的sfence.vma指令处,程序就没法执行了,感谢解答

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comments An area where readers can discuss related topics after every article.
Projects
None yet
Development

No branches or pull requests

7 participants