Sodium Updated +Created
William Shakespeare Updated +Created
Disease Updated +Created
Mole (unit) Updated +Created
Robert Noyce Updated +Created
DNA paternity testing Updated +Created
Hierarchical Data Format Updated +Created
Journey to the West character Updated +Created
Seymour Cray Updated +Created
Chemistry bibliography Updated +Created
Chengyu Updated +Created
How to Fix a Drug Scandal (2020) Updated +Created
Nobel disease Updated +Created
Recreational drug Updated +Created
Centralized Updated +Created
Child prodigy Updated +Created
x86 Paging Tutorial / Page faults Updated +Created
What if Process 1 tries to access 0x00003000, which is not present?
The hardware notifies the software via a Page Fault Exception.
When an exception happens, the CPU jumps to an address that the OS had previously registered as the fault handler. This is usually done at boot time by the OS.
This could happen for example due to a programming error:
int *is = malloc(1);
is[2] = 1;
but there are cases where it is not a bug, for example in Linux when:
  • the program wants to increase its stack.
    It just tries to accesses a certain byte in a given possible range, and if the OS is happy it adds that page to the process address space, otherwise, it sends a signal to the process.
  • the page was swapped to disk.
    The OS will need to do some work behind the processes back to get the page back into RAM.
    The OS can discover that this is the case based on the contents of the rest of the page table entry, since if the present flag is clear, the other entries of the page table entry are completely left for the OS to to what it wants.
    On Linux for example, when present = 0:
    • if all the fields of the page table entry are 0, invalid address.
    • else, the page has been swapped to disk, and the actual values of those fields encode the position of the page on the disk.
In any case, the OS needs to know which address generated the Page Fault to be able to deal with the problem. This is why the nice IA32 developers set the value of cr2 to that address whenever a Page Fault occurs. The exception handler can then just look into cr2 to get the address.
GIF Updated +Created
Video 1.
It's pronounced GIF by Jehtt (2022)
Source.
Magnetic vector potential Updated +Created
Piezoelectricity Updated +Created

Unlisted articles are being shown, click here to show only listed articles.