Linux 分页和中断处理程序
尊敬的先生/女士, 我正在尝试在 LINUX 中为我最后一年的本科项目实现就绪升压功能。我只是在研究,发现每当发生页面错误时,CPU 都会发送中断 14。所以,我需要您对我正在考虑的以下方案的指导的: 我将创建一个中断处理程序,当中断发生时它将被激活。 该处理程序可以从cr2寄存器中提取故障的线性地址,我们可以使用LINUX页表来获取物理地址。 您认为这将是一个可行的方案吗? 此外,任何有关相同内容的教程都将受到高度赞赏。 提前感谢大家。 _问候
Dear Sir/Madam,
I am trying to implement ready boost feature in LINUX for my final year undergraduate project.I was just researching and I found out that whenever a page fault occurs the CPU sends Interrupt 14.So, I need your guidance on the foll scheme I am thinking of:
I will create an interrupt handler which will be activated when an interrupt occurs.
This handler can extract the linear address of the fault from cr2 register and we can use LINUX page table to get the physical address.
Do you think that this ,will be a feasible scheme?
Also any tutorial on the same will be highly appreciated.
Thanks to all in advance.
_Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“ReadyBoost”不就是通过在闪存盘的
/dev/sd*
设备专用文件上运行mkswap
然后运行swapon
来实现的吗?据我所知,所有必要的内核端支持都已到位。Isn't "ReadyBoost" simply implemented by running
mkswap
followed byswapon
on the/dev/sd*
device special file for the flash disk? As far as I'm aware, all the necessary kernel-side support is in place.我们不会为您完成任务。
IIUI ReadyBoost 与 swap @caf 不同。它是将磁盘内容缓存在更快的介质上,以使随机磁盘访问更快。 Linux 永远不会将磁盘支持的页面分页进行交换,它们只会被删除并从磁盘重新读取。只有匿名页面才会进行交换。
ReadyBoost 数据也被镜像到磁盘,因此 USB 驱动器可以随时移除,并且还进行了加密,因此如果密钥被移除并在另一个系统上进行分析,则不会泄露任何内容。
所以@R-The_Master 你可以为 Linux 实现类似 ReadyBoost 的东西。但它基本上与
int 14
无关。We're not going to do your assignment for you.
IIUI ReadyBoost is not the same as swap @caf. It is about caching disk content on a faster medium to make random disk accesses faster. Linux will never page disk-backed pages to swap, they will just be dropped and reread from the disk. Only anonymous pages go to swap.
Also ReadyBoost data is mirrored to disk, so the USB drive can be removed at any time, and also encrypted so if the key is removed and analysed on another system nothing is disclosed.
So @R-The_Master you could implement something like ReadyBoost for Linux. But it has basically nothing to do with
int 14
.