4 ms·
CR2 holds the address that the access was attempted on that faulted. So for example, if you attempt to access 0x23456789 and that faults because there is no pag
by DSMan195276 10y ago
CR2 holds the address that the access was attempted on that faulted. So for example, if you attempt to access 0x23456789 and that faults because there is no page, CR2 contains that 0x23456789. But that might not be an "invalid" address - the OS may simply not have mapped the page in yet (Which is what happens with dynamic paging). So the OS checks the CR2, and if it is valid address the OS maps the correct page in and then returns back to the code that the program attempted to execute (Which now works).