summaryrefslogtreecommitdiff
path: root/kernel/start.c
diff options
context:
space:
mode:
authorJonathan Behrens <[email protected]>2021-08-30 16:27:52 -0400
committerJonathan Behrens <[email protected]>2021-08-30 16:27:52 -0400
commit9655f71758003f93294e82926783024a7e4bcdde (patch)
treec7cc5a8d790f81d464433cfc45006bc5966d83ea /kernel/start.c
parent6de0381d619f01777d84cbcd3affa96ad376c2e1 (diff)
downloadxv6-labs-9655f71758003f93294e82926783024a7e4bcdde.tar.gz
xv6-labs-9655f71758003f93294e82926783024a7e4bcdde.tar.bz2
xv6-labs-9655f71758003f93294e82926783024a7e4bcdde.zip
Configure PMP at boot
Diffstat (limited to 'kernel/start.c')
-rw-r--r--kernel/start.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/start.c b/kernel/start.c
index 1876680..938e837 100644
--- a/kernel/start.c
+++ b/kernel/start.c
@@ -38,6 +38,11 @@ start()
w_mideleg(0xffff);
w_sie(r_sie() | SIE_SEIE | SIE_STIE | SIE_SSIE);
+ // configure Physical Memory Protection to give supervisor mode
+ // access to all of physical memory.
+ w_pmpaddr0(0x3fffffffffffffull);
+ w_pmpcfg0(0xf);
+
// ask for clock interrupts.
timerinit();