diff options
Diffstat (limited to 'kernel/smp.c')
| -rw-r--r-- | kernel/smp.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/kernel/smp.c b/kernel/smp.c index 01230cf..a57b4b9 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -34,19 +34,22 @@ void smp_main_generic(bool bsp) { if(!bsp) // for the bsp this was already done beforehand { + struct pdirectory_struct *dir=vmem_kernel_dir(); + x86_set_page_directory(dir); + x86_paging_enable(); + + klog("Just setup Paging on CPU with lapic_id=0x%x",apic_id()); + klog("Install Interrupt Vector Table (IVT) on CPU with lapic_id=0x%x ...",apic_id()); interrupts_install(); klog("Install Global Descriptor Table (GDT) on CPU with lapic_id=0x%x ...",apic_id()); gdt_init(); - klog("Setup Paging on CPU with lapic_id=0x%x ...",apic_id()); - struct pdirectory_struct *dir=vmem_kernel_dir(); - x86_set_page_directory(dir); - x86_paging_enable(); } // setup stack and jump to kernel_ap(); + fixme("we hate iniline assembly!"); uint32_t ebp=VMEM_CPU_STACK_TOP; asm volatile("mov %0, %%ebp"::"r"(ebp)); asm volatile("mov %ebp, %esp"); @@ -58,7 +61,7 @@ void run_smp() apic_enable(); klog("Setup the LAPIC Timer on CPU with lapic_id=0x%x ...",apic_id()); - apic_init_timer(3);// freq x HZ + apic_init_timer(FOOLOS_APIC_FREQ);// freq x HZ klog("Enable Interrupts on CPU with lapic_id=0x%x ...",apic_id()); asm_smp_unlock(); @@ -67,13 +70,6 @@ void run_smp() smp_set(1000,'a'+apic_id()); smp_set(SMP_SCHEDULER_INIT,1); - if(apic_id()==0) - { -// apic_sipi(1,0x7); -// apic_sipi(2,0x7); -// apic_sipi(3,0x7); - } - x86_sti(); while(1)asm("hlt"); // wait for scheduler to kick in |
