]> Devi Nivas Git - cs3210-lab1.git/commitdiff
Some comments
authorFrans Kaashoek <kaashoek@206.sub-75-194-151.myvzw.com>
Fri, 12 Aug 2011 11:31:52 +0000 (07:31 -0400)
committerFrans Kaashoek <kaashoek@206.sub-75-194-151.myvzw.com>
Fri, 12 Aug 2011 11:31:52 +0000 (07:31 -0400)
main.c

diff --git a/main.c b/main.c
index dabca19644168d788c84ed7d1a67c5eac83837dd..8f95559ef89c4235731163fbb3cfa6043fab5439 100644 (file)
--- 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);