diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-11-23 20:48:34 +0100 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-11-23 20:48:34 +0100 |
| commit | 50300fa573bf2bc00f9732e812d54ab77cf03dd7 (patch) | |
| tree | 7a998723578e601b427e17f9e90e7ce8dbb7c5d2 /kernel/kernel.c | |
| parent | 61eff36a01a2639efeb515ec32f578ba99d97ff4 (diff) | |
mostly pr and cosmetics
Diffstat (limited to 'kernel/kernel.c')
| -rw-r--r-- | kernel/kernel.c | 50 |
1 files changed, 17 insertions, 33 deletions
diff --git a/kernel/kernel.c b/kernel/kernel.c index f788cee..66ca21a 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -1,22 +1,17 @@ -/* - * in freestanding mode we can just use this c lib headers - * stdbool,sddef,stdint, - * float,iso646,limits,stdarg - */ +#define FOOLOS_MODULE_NAME "kernel" #ifdef __linux__ #error "Watchout! this is not Linux but FoolOS. Use a cross-compiler" #endif -#define FOOLOS_MODULE_NAME "kernel" +#include "config.h" #include <stdint.h> -#include "config.h" #include "asm/asm.h" #include "lib/logger/log.h" -#include "lib/bool/bool.h" + #include "lib/buffer/ringbuffer.h" #include "smp.h" @@ -37,17 +32,10 @@ #include "task.h" -// -// KERNEL MAIN -// +// mp informs us if this if this is the main processor void kernel_main(uint32_t initial_stack, int mp) { // - // Configuring the PIT timer. - // - timer_init(); - - // // Memory Init // // after this is set up we will be able to allocate and deallocate @@ -59,9 +47,14 @@ void kernel_main(uint32_t initial_stack, int mp) mem_init(0x7c00+1,*((uint16_t *)(0x7c00))); // + // Configuring the PIT timer. + // + timer_init(); + + // // Activate Virtual Memory (paging) // - //vmem_init(); + vmem_init(); // // init output to screen @@ -74,7 +67,7 @@ void kernel_main(uint32_t initial_stack, int mp) // - // Setup PIC + // Setup PIC (interrupts) // pic_setup(); @@ -110,6 +103,11 @@ void kernel_main(uint32_t initial_stack, int mp) // ringbuffer for stdin! ringbuffer_init(); + // load and run inode 15 (shell) + // we will come back into the kernel only on interrupts... + syscall_execve(15,0,0); + + // // Start the other Processors (also before paging for some reason!) // @@ -118,7 +116,6 @@ void kernel_main(uint32_t initial_stack, int mp) // but it will be copied over mbr - // // Scan the PCI Bus // @@ -128,30 +125,17 @@ void kernel_main(uint32_t initial_stack, int mp) //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 - - // // Initialize Multitasking // // For now this starts three "tasks" which are scheduled // round robin style. // - syscall_execve(15,0,0); // run fool-shell! (execve needs inode id) //task_init(); - // - //vesa_init_doublebuff(); - - // Just hang around here, if its reached. // we do our tasks anyway. on the next clock tick. - while(1); + // while(1); } |
