From 06e382afcbf199e5e4ec92574a3872ab04fb6e9e Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Thu, 4 Sep 2014 15:16:13 +0200 Subject: Improved physical memory manager and cleaning up. --- kernel/kernel.c | 105 ++++++++++++++++---------------------------------------- 1 file changed, 29 insertions(+), 76 deletions(-) (limited to 'kernel/kernel.c') diff --git a/kernel/kernel.c b/kernel/kernel.c index 0b87b64..1688017 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -11,18 +11,10 @@ #include "floppy.h" #endif -/////// -// interrupt handler prototypes -// todo: move somewhere else!? -void int_clock_handler(); -void int_kb_handler(); - -uint32_t read_eip(); +// some multiprocessor shit that should move away uint32_t c1,c2,c3; - volatile uint8_t proc; - uint32_t cpu_counter[SMP_MAX_PROC]; void kernel_ap() @@ -31,6 +23,7 @@ void kernel_ap() uint8_t p=proc; while(1)cpu_counter[p]++; } + // // KERNEL MAIN @@ -52,29 +45,18 @@ void kernel_main(uint32_t initial_stack, int mp) proc=c1=c2=c3=0; for(int i=0;i 32) - int_install_ir(32, 0b10001110, 0x08,&int_clock_handler); - - // install keyboard interrupt handler (irq 1 => 33) - int_install_ir(33, 0b10001110, 0x08,&int_kb_handler); - -#ifdef FOOLOS_COMPILE_FLOPPY - // install floppy interrupt handler (irq 6 => 38) - int_install_ir(38, 0b10001110, 0x08,&int_floppy_handler); -#endif - - // now we can enable interrupts back again - x86_int_enable(); // // 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! + // we know that here, the bootloader placed the mamory map and + // number of entries. mem_init(0x7c00+0x400,*((uint16_t *)(0x7c00+0x600))); @@ -174,13 +131,13 @@ void kernel_main(uint32_t initial_stack, int mp) 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); + //smp_start_aps(&procdata); ///////////////////// // paging (pass the vesa physbase address for identity mapping) - //vmem_init(vesa_physbase); + // vmem_init(vesa_physbase); ////////////////////// @@ -190,17 +147,15 @@ void kernel_main(uint32_t initial_stack, int mp) // We are interested in the E1000 Network Adapter in particular // Its driver will be hopefully implemented one day ;) // - - pci_init(); + // pci_init(); // - // Initialize Floppy Disk - // - - #ifdef FOOLOS_COMPILE_FLOPPY - floppy_init(); - #endif + // Initialize Floppy Disk if activated in config.h + // + //#ifdef FOOLOS_COMPILE_FLOPPY + //floppy_init(); + //#endif // @@ -209,7 +164,6 @@ void kernel_main(uint32_t initial_stack, int mp) // Will process input from the keyboard but will be completely // redesigned soon. // - shell_init(); @@ -219,7 +173,6 @@ void kernel_main(uint32_t initial_stack, int mp) // For now this starts two tasks which are scheduled // round robin style. // - task_init(); -- cgit v1.2.3