summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2011-09-01 12:03:49 -0400
committerRobert Morris <[email protected]>2011-09-01 12:03:49 -0400
commit62e3b8a92c6f8840cec8a0db13b2bcad10192b4a (patch)
tree6186d2ac5e654ba71f8f45ae9956c560d7251dfc /main.c
parent5a236924444db768813d726ae165d263856d8bff (diff)
parentd0f3efca650eccd5179e045cd07f7d723037defc (diff)
downloadxv6-labs-62e3b8a92c6f8840cec8a0db13b2bcad10192b4a.tar.gz
xv6-labs-62e3b8a92c6f8840cec8a0db13b2bcad10192b4a.tar.bz2
xv6-labs-62e3b8a92c6f8840cec8a0db13b2bcad10192b4a.zip
Merge branch 'master' of git+ssh://amsterdam.csail.mit.edu/home/am0/6.828/xv6
Conflicts: vm.c
Diffstat (limited to 'main.c')
-rw-r--r--main.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/main.c b/main.c
index 23e0316..2e49ec3 100644
--- a/main.c
+++ b/main.c
@@ -33,7 +33,7 @@ main(void)
ideinit(); // disk
if(!ismp)
timerinit(); // uniprocessor timer
- startothers(); // start other processors (must come before kinit; must use enter_alloc)
+ startothers(); // start other processors (must come before kinit)
kinit(); // initialize memory allocator
userinit(); // first user process (must come after kinit)
// Finish setting up this processor in mpmain.
@@ -81,13 +81,14 @@ startothers(void)
if(c == cpus+cpunum()) // We've started already.
continue;
- // Tell entryother.S what stack to use, the address of mpenter and pgdir;
- // We cannot use kpgdir yet, because the AP processor is running in low
- // memory, so we use entrypgdir 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 entrypgdir, so we must allocate a stack using enter_alloc();
- // This introduces the constraint that xv6 cannot use kalloc until after these
- // last enter_alloc invocations.
+ // Tell entryother.S what stack to use, where to enter, and what
+ // pgdir to use. We cannot use kpgdir yet, because the AP processor
+ // is running in low memory, so we use entrypgdir 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
+ // entrypgdir, so we must allocate a stack using enter_alloc();
+ // this introduces the constraint that xv6 cannot use kalloc until
+ // after these last enter_alloc invocations.
stack = enter_alloc();
*(void**)(code-4) = stack + KSTACKSIZE;
*(void**)(code-8) = mpenter;