diff options
Diffstat (limited to 'kernel/kernel.c')
| -rw-r--r-- | kernel/kernel.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/kernel/kernel.c b/kernel/kernel.c index 17bf9b7..e20d2e1 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -25,12 +25,13 @@ void kernel_main(uint32_t eax,uint32_t ebx) serial_init(); klog("FOOL-OS ver-%s (%s)",GIT_REVISION,__DATE__); - // while(1); + klog("Global Descriptor Table (GDT) init ..."); + gdt_init(); klog("Interrupt Vector Table (IVT) init ..."); interrupts_init(0x08); - klog("Setting up PIC"); + klog("Remapping & (not yet Disabling) PIC ..."); asm_pic_setup(); klog("Keyboard init ..."); @@ -39,24 +40,27 @@ void kernel_main(uint32_t eax,uint32_t ebx) klog("Mouse init ..."); mouse_init(); - klog("Global Descriptor Table (GDT) init ..."); - gdt_init(); - - klog("Multiboot Structures init ... "); + // gather some info (before we start paging) + klog("Search / Read Multiboot Structures ... "); multiboot_information *info; info=get_multiboot(eax, ebx); + klog("Search / Read ACPI Structures... "); + smp_processors procdata; + bool acpi_found=acpi_find(&procdata); + + klog("Search / Read MP Structures... "); + smp_processors procdata2; + bool mp_found=mp_find(&procdata2); + // + + // memory management klog("Memory init ... "); uint32_t kernel_blocks=mem_init(info); - klog("Symmetrical Multi Processing (SMP) init ... "); - smp_processors procdata; - if(!acpi_find(&procdata)) - if(!mp_find(&procdata))kpanic("No ACPI and no MP found!"); - - // searching for ACPI etc.. in physical mem has to be performed before that. klog("Vritual Memory / Paging init ... "); pdirectory *dir=vmem_init(kernel_blocks,(uint32_t)info->framebuffer_addr,procdata.local_apic_address); + // klog("Ram Filesystem init ... "); fs_mount(info); @@ -81,16 +85,12 @@ void kernel_main(uint32_t eax,uint32_t ebx) uint64_t unixtime=timer_init(); klog("Unix Time = %u seconds)",unixtime); - klog("Setting Interrupt Flag on BSP ..."); + klog("Enable Interrupts & Unlock application processors ... "); asm_smp_unlock(); - x86_sti(); // this will start processing hardware interrupts. - - // TODO : pray that this is reached BEFORE scheduler kicks in!? - - klog("Unlock application processors ... "); + // TODO : bsp sti needs to happen before ap sti? seriously? why? is this guaranteed now? + // TODO: switch to ioapic + x86_sti(); // this will start processing hardware interrupts - while(1){ // now just wait until our scheduler kicks in. -// klog("bsp"); - asm("hlt"); - } + // now just wait until our scheduler kicks in. + while(1)asm("hlt"); } |
