<< Chapter < Page | Chapter >> Page > |
The most common solution is a technique that is sometimes called a shadow table. The idea of a shadow is simple (and familiar toFortran programmers!):
For example, consider the hardware defined page table to be an array of structures:
struct Page_Entry {
unsigned PageFrame_hi : 10; // 42-bit page frame numberunsigned PageFrame_mid : 16;
unsigned PageFrame_low : 16;unsigned UserRead : 1;
unsigned UserWrite : 1;unsigned KernelRead : 1;
unsigned KernelWrite : 1;unsigned Reference : 1;
unsigned Dirty : 1;unsigned Valid : 1;
}struct Page_Entry pageTable[TABLESIZE];
If you wanted to added a couple of data members, you cannot simply change it to the following:
struct Page_Entry {
unsigned PageFrame_hi : 10;unsigned PageFrame_mid : 16;
unsigned PageFrame_low : 16;unsigned UserRead : 1;
unsigned UserWrite : 1;unsigned KernelRead : 1;
unsigned KernelWrite : 1;unsigned Reference : 1;
unsigned Dirty : 1;unsigned Valid : 1;
Time_t lastRefTime;PageList *shared;
}
Instead, you would define a a second array based on this type:
struct Page_Entry { struct PE_Shadow {
unsigned PageFrame_hi : 10; Time_t lastRefTime;unsigned PageFrame_mid : 16; PageList *shared;
unsigned PageFrame_low : 16; }unsigned UserRead : 1;
unsigned UserWrite : 1;unsigned KernelRead : 1;
unsigned KernelWrite : 1;unsigned Reference : 1;
unsigned Dirty : 1;unsigned Valid : 1;
}struct Page_Entry pageTable[TABLESIZE];struct PE_Shadow pageShadow[TABLESIZE];
Problem: how does the operating system get information from user memory? E.g. I/O buffers, parameter blocks. Note that theuser passes the OS a virtual address.
Notification Switch
Would you like to follow the 'Operating systems' conversation and receive update notifications?