Skip to content

Commit

Permalink
Hint on cr3 update
Browse files Browse the repository at this point in the history
  • Loading branch information
remzi-arpacidusseau committed Mar 12, 2018
1 parent 8867089 commit 75a96ba
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vm-xv6-intro/README.md
Expand Up @@ -69,6 +69,13 @@ or `addr` points to a region that is not currently a part of the address
space, or `len` is less than or equal to zero, return -1 and do not change
anything. Otherwise, return 0 upon success.

Hint: after changing a page-table entry, you need to make sure the hardware
knows of the change. On 32-bit x86, this is readily accomplished by updating
the `CR3` register (what we generically call the *page-table base register* in
class). When the hardware sees that you overwrote `CR3` (even with the same
value), it guarantees that your PTE updates will be used upon subsequent
accesses. The `lcr3()` function will help you in this pursuit.

## Handling Illegal Accesses

In both the cases above, you should be able to demonstrate what happens when
Expand Down

0 comments on commit 75a96ba

Please sign in to comment.