diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-09-04 16:19:52 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-09-04 16:19:52 +0200 |
| commit | 44dcbdf16674bc727503ca748f95eec847755b2f (patch) | |
| tree | 6dd5a8353ffa22170b46a2c28d5268d852224549 /kernel/kernel.c | |
| parent | 75c46037e742f07001fafc5a093b27556d2490c9 (diff) | |
cleanup and improvements in physical mem manager.
Diffstat (limited to 'kernel/kernel.c')
| -rw-r--r-- | kernel/kernel.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/kernel/kernel.c b/kernel/kernel.c index c95df11..33624ad 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -12,7 +12,7 @@ #endif -// some multiprocessor shit that should move away +// some multiprocessor shit that should move away TODO uint32_t c1,c2,c3; volatile uint8_t proc; uint32_t cpu_counter[SMP_MAX_PROC]; @@ -33,6 +33,9 @@ void kernel_ap() void kernel_main(uint32_t initial_stack, int mp) { + + /// TODO +/////// SYMMETRIC MULTIPROCESSING, APS get caought here, move it away /// // catch the APs (Application Processors) if(mp==1) { @@ -77,7 +80,6 @@ void kernel_main(uint32_t initial_stack, int mp) // this function returns the physical base address of // our video memory // - uint32_t vesa_physbase=vesa_init(0x8300,0x8400,0x90000+0x200); // self-log message of logger :P @@ -88,14 +90,12 @@ void kernel_main(uint32_t initial_stack, int mp) // log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"initial esp: 0x%08X",initial_stack); - // // Setup PIC // log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"setting up PIC."); pic_setup(); - // // Configuring the PIT timer. // @@ -106,21 +106,20 @@ void kernel_main(uint32_t initial_stack, int mp) // int_init(0x08); - // // Memory Init // // after this is set up we can allocate and deallocate blocks // of physical memory :) // - - // we know that here, the bootloader placed the mamory map and - // number of entries. + // we know that here, the bootloader placed the mamory map and + // the number of entries. + // mem_init(0x7c00+0x400,*((uint16_t *)(0x7c00+0x600))); // - // Gather Info about other processors. + // Gather Info about other processors. (APs) // ACPI or MP // smp_processors procdata; @@ -130,50 +129,55 @@ void kernel_main(uint32_t initial_stack, int mp) if(!mp_find(&procdata)) panic(FOOLOS_MODULE_NAME,"ACPI and MP search failed! I do not want to continue!"); + // // Start the other Processors (also before paging !) - smp_start_aps(&procdata,0x90000);// starts at 0x90000 but will be copied over mbr + // + smp_start_aps(&procdata,0x90000); // starts at 0x90000 + // but it will be copied over mbr - - ///////////////////// - + // + // Activate Virtual Memory (paging) + // // paging (pass the vesa physbase address for identity mapping) + // TODO: we will work on this later (not needed so urgently yet) + // // vmem_init(vesa_physbase); // // Scan the PCI Bus // // We are interested in the E1000 Network Adapter in particular - // Its driver will be hopefully implemented one day ;) + // Its driver will be hopefully implemented one day ;) TODO // // pci_init(); // // Initialize Floppy Disk if activated in config.h + // Sadly we won't use it anyway so its uncommented anyway. // //#ifdef FOOLOS_COMPILE_FLOPPY //floppy_init(); //#endif - // // "Shell" // // Will process input from the keyboard but will be completely - // redesigned soon. + // redesigned soon. TODO!! // shell_init(); - // // Initialize Multitasking // - // For now this starts two tasks which are scheduled + // For now this starts three "tasks" which are scheduled // round robin style. // task_init(); // - // Just hang here. + // Just hang around here, if its reached. + // we do our tasks anyway. on the next clock tick. // while(1)asm("hlt"); |
