ASMLINK void mpmain(struct m_cpu *cpu) { // gdtinit(); seginit(cpu->id); idtset(); m_xchgl(&cpu->started, 1L); /* TODO: initialise HPET; enable [rerouted] interrupts */ #if (HPET) hpetinit(); apicinitcpu(cpu->id); ioapicinit(cpu->id); tssinit(cpu->id); #endif while (1) { k_waitint(); } }
NOINLINE void schedloop(void) { /* test scheduler loop; interrupted by timer [and other] interrupts */ do { /* enable all interrupts */ #if !(APIC) outb(0x00, PICMASK1); outb(0x00, PICMASK2); #endif // kprintregs(); /* wait for interrupt */ k_waitint(); } while (1); /* NOTREACHED */ return; }