summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorFrans Kaashoek <[email protected]>2011-08-09 21:47:40 -0400
committerFrans Kaashoek <[email protected]>2011-08-09 21:47:40 -0400
commit832af025a364732d2784e64fa74e516f6c2f3b0c (patch)
treeb013a37c5b33316a714d56a1be7ee45434362232 /main.c
parent66ba8079c7e376c189ccb3367b8d13825141b8ec (diff)
downloadxv6-labs-832af025a364732d2784e64fa74e516f6c2f3b0c.tar.gz
xv6-labs-832af025a364732d2784e64fa74e516f6c2f3b0c.tar.bz2
xv6-labs-832af025a364732d2784e64fa74e516f6c2f3b0c.zip
Remove jmpkstack
Diffstat (limited to 'main.c')
-rw-r--r--main.c29
1 files changed, 2 insertions, 27 deletions
diff --git a/main.c b/main.c
index 6097d55..416723e 100644
--- a/main.c
+++ b/main.c
@@ -7,9 +7,7 @@
#include "x86.h"
static void bootothers(void);
-static void mpmain(void);
-void jmpkstack(void) __attribute__((noreturn));
-void mainc(void);
+static void mpmain(void) __attribute__((noreturn));
static volatile int newpgdir;
// Bootstrap processor starts running C code here.
@@ -22,31 +20,8 @@ main(void)
mpinit(); // collect info about this machine
lapicinit(mpbcpu());
seginit(); // set up segments
- kinit(); // initialize memory allocator
- jmpkstack(); // call mainc() on a properly-allocated stack XXX ax
- mainc();
- return 0;
-}
-
-void
-jmpkstack(void)
-{
- char *kstack, *top;
-
- kstack = kalloc();
- if(kstack == 0)
- panic("jmpkstack kalloc");
- top = kstack + PGSIZE;
- asm volatile("movl %0,%%esp; call mainc" : : "r" (top));
- panic("jmpkstack");
-}
-
-// Set up hardware and software.
-// Runs only on the boostrap processor.
-void
-mainc(void)
-{
cprintf("\ncpu%d: starting xv6\n\n", cpu->id);
+ kinit(); // initialize memory allocator
picinit(); // interrupt controller
ioapicinit(); // another interrupt controller
consoleinit(); // I/O devices & their interrupts