#include "types.h" #include "defs.h" #include "param.h" #include "mmu.h" #include "proc.h" #include "x86.h" static void bootothers(void); // Bootstrap processor starts running C code here. int main(void) { int i; static volatile int bcpu; // cannot be on stack extern char edata[], end[]; // clear BSS memset(edata, 0, end - edata); // Prevent release() from enabling interrupts. for(i=0; impstack + MPSTACK; *(void**)(code-8) = mpmain; lapic_startap(c->apicid, (uint)code); // Wait for cpu to get through bootstrap. while(c->booted == 0) ; } }