Reputation:
Can we show page table address using c program? what is the difference between page table and extended page table?
Upvotes: 1
Views: 8900
Reputation: 1380
1] What is second level Page Table Extended page tables are a mechanism to allow each virtual machine to manage its page table, without giving access to the underlying host machine's MMU - Hardware. Have a quick look at the link below. It should give an idea http://www.cs.cmu.edu/~dga/15-440/F10/lectures/vm-ucsd.pdf
2] Is it possible to print Page Table using a C program? - Its perfectly possible. There will be an MMU driver in your system. MMU driver will be setting up the Page Tables in some part of RAM. You need to know that location. In conventional operating systems [linux,windows etc] . This memory area would be privileged, so applications may not get direct access. If your platform is an embedded system with a micro-kernel running on it, probably you will be able to access this table.
Upvotes: 4
Reputation: 137398
Can we show page table address using c program?
Not using a plain-old C program, no you can't. User-mode programs run in virtual memory, which is provided by the kernel, using paging mechanisms. All of this is abstracted away so userspace knows nothing about it.
The Linux kernel does provide a mechanism for userspace to observe the pagetables however, as indicated at this question.
what is the difference between page table and extended page table?
"Extended page tables" are Intel's implementation of Second Level Address Translation (SLAT), also known as nested paging, which is used to more efficiently virtualize the memory of guest VMs.
Basically, guest virtual addresses are first translated to guest physical addresses, which are then translated to host physical addresses. This is all done in hardware (by the MMU) to avoid extra work needing to be done in software by the VMM.
Upvotes: 8