summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2011-08-12 09:26:23 -0400
committerRobert Morris <[email protected]>2011-08-12 09:26:23 -0400
commite0d1ba0d7470f84b94c6eedbf220152a805881a7 (patch)
tree93b246e70430eccfa3488289c60642507d5121e5
parent2e59046362f532748711b9acaceee1cda969cc50 (diff)
parente577a62f0dc5a1b22ac5687204ec720bb4d8a367 (diff)
downloadxv6-labs-e0d1ba0d7470f84b94c6eedbf220152a805881a7.tar.gz
xv6-labs-e0d1ba0d7470f84b94c6eedbf220152a805881a7.tar.bz2
xv6-labs-e0d1ba0d7470f84b94c6eedbf220152a805881a7.zip
Merge branch 'master' of git+ssh://amsterdam.csail.mit.edu/home/am0/6.828/xv6
-rw-r--r--main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main.c b/main.c
index dabca19..8f95559 100644
--- a/main.c
+++ b/main.c
@@ -82,7 +82,13 @@ bootothers(void)
continue;
// Tell bootother.S what stack to use, the address of mpboot and pgdir;
- stack = boot_alloc(); // We need a stack below 4Mbyte with bootpgdir
+ // We cannot use kpgdir yet, because the AP processor is running in low
+ // memory, so we use bootpgdir for the APs too. kalloc can return addresses
+ // above 4Mbyte (the machine may have much more physical memory than 4Mbyte), which
+ // aren't mapped by bootpgdir, so we must allocate a stack using boot_alloc();
+ // This introduces the constraint that xv6 cannot invoke until after these last boot_alloc
+ // invocations.
+ stack = boot_alloc();
*(void**)(code-4) = stack + KSTACKSIZE;
*(void**)(code-8) = mpboot;
*(int**)(code-12) = (void *) v2p(bootpgdir);