From 54d36998da2e98039b960a3a9e6fb82e09717991 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Mon, 17 Nov 2014 14:56:01 +0100 Subject: trying to reactivate multitasking. --- kernel/kernel.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'kernel/kernel.c') diff --git a/kernel/kernel.c b/kernel/kernel.c index 6cc4500..5628e84 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -22,6 +22,8 @@ #include "fs/fs.h" #include "fs/ext2.h" +#include "task.h" + #ifdef FOOLOS_COMPILE_FLOPPY #include "floppy.h" @@ -77,6 +79,11 @@ void kernel_main(uint32_t initial_stack, int mp) /////////////////// BULLSHIT ABOVE THIS LINE: TODO: CLEANUP + // + // init system log ringbugger + // + log_init(); + // // The System Time // @@ -93,17 +100,12 @@ void kernel_main(uint32_t initial_stack, int mp) // mem_init(0x7c00+1,*((uint16_t *)(0x7c00))); - // - // init system log ringbugger - // - log_init(); - // // init output to screen // console_init(); - // self-log message of logger :P + // log buffered messages to console log_log(); // @@ -135,11 +137,15 @@ void kernel_main(uint32_t initial_stack, int mp) // Gather Info about other processors. (APs) // ACPI or MP // + // + + /* smp_processors procdata; if(!acpi_find(&procdata)) if(!mp_find(&procdata)) panic(FOOLOS_MODULE_NAME,"ACPI and MP search failed! I do not want to continue!"); + */ // init spinlocks init_spinlocks(); @@ -153,14 +159,14 @@ void kernel_main(uint32_t initial_stack, int mp) //smp_log_procdata(&procdata); //smp_start_aps(&procdata,0x80000); // starts at 0x80000 // 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); + //vmem_init(vesa_physbase); // // Scan the PCI Bus @@ -184,20 +190,15 @@ void kernel_main(uint32_t initial_stack, int mp) // For now this starts three "tasks" which are scheduled // round robin style. // - //task_init(); + task_init(); // //vesa_init_doublebuff(); - ext2_check(EXT2_RAM_ADDRESS); - syscall_execve(15,0,0); // Just hang around here, if its reached. // we do our tasks anyway. on the next clock tick. - while(1) - { - - } + while(1); } -- cgit v1.2.3