920f
![]() |
|
|
|
|
|||||||
| FreeBSD Development Kernel development, writing drivers, coding, and questions regarding FreeBSD internals. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
The following echoes the way page tables are represented in the virtual address for FreeBSD (amd64)
Code:
// start by moving entries we care about to the bottom
vpn_table_entry = vpn >> (9*level);
// clear out any high order bits (sign extension)
vpn_table_entry &= (1ul << ((4 - level) * 9)) - 1;
// now, add in the right number of recursive PML4 entries
for (i=4; i>=(4-level); i--) {
vpn_table_entry |= (RECURSIVE << (9*i));
}
// shift up to account for size of PTE (64 bits).
table_entry = (vpn_table_entry << 3);
// add the sign extension back
table_entry |= (unsigned long)-1 << 47;
Last edited by DutchDaemon; December 6th, 2011 at 03:26. Reason: Please format your posts! |
|
#2
|
||||
|
||||
|
Quote:
Also, you should be familiar with recursion
__________________
Senior UNIX Engineer at Unix Support Nederland Experience is something you don't get until just after you need it. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Solved] How to get mac-address-table in bridge mode? | spartacus | Networking | 3 | April 22nd, 2011 16:25 |
| [Solved] White page problem with PHP page after upgrade to php5-5.3.5 | soylentgreen | Web & Network Services | 7 | February 17th, 2011 21:57 |
| ARP Table in Freebsd | ssg | Userland Programming & Scripting | 7 | August 31st, 2010 15:03 |
| HDD representation in /dev | Seeker | System Hardware | 3 | November 27th, 2009 10:10 |
| what are the static table and the dynamic table in ffs? | coopci | General | 0 | October 26th, 2009 03:39 |