这里是我的问题:我想从运行在Linux内核空间中的代码中对数据文件的一部分进行内存映射。我想稍后也从Linux内核空间中运行的代码中撤销相同的内存映射。如何执行这些操作?它们与在用户空间中使用mmap(2)/munmap(2)有何不同?
我试图在没有用户进程的内核空间中做到这一点。
我浏览了网络搜索和Linux内核书籍,包括Bovet和Cesati的"Understanding the Linux Kernel“。一本好书,但没有回答我的问题。
考虑一台具有64 MB物理内存和32位虚拟地址空间的机器.如果页面大小为4KB,那么页面表的大致大小是多少?
我的解决方案:
Number of pages in physical memory = (size of physical memory)/(size of page)
= 64 * 2^10 / 4
= 2^14
Number of pages in virtual memory = (size of virtual memory)/(size