Paging question
Posted: Tue Dec 30, 2008 7:36 pm
Hi guys, I'm working on paging and using JamesM's tutorial and Intel manuals for reference.
I was reading over James' tutorial and I have a question about it. Here is James' code for a page:
The Intel manual defines a write-through and a cache disabled bit between the user and accessed bit in the above code. I see that these bits are moved into the unused bit field, but won't this cause the bits to be ordered incorrectly? Can anyone give me some pointers on this? Because it looks like there is something wrong with grouping 7 bits together as unused to me.
Thanks!
I was reading over James' tutorial and I have a question about it. Here is James' code for a page:
Code: Select all
typedef struct page
{
u32int present : 1; // Page present in memory
u32int rw : 1; // Read-only if clear, readwrite if set
u32int user : 1; // Supervisor level only if clear
u32int accessed : 1; // Has the page been accessed since last refresh?
u32int dirty : 1; // Has the page been written to since last refresh?
u32int unused : 7; // Amalgamation of unused and reserved bits
u32int frame : 20; // Frame address (shifted right 12 bits)
} page_t;
Thanks!