summaryrefslogtreecommitdiff
path: root/kernel/kernel.c
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2014-11-17 23:17:51 +0100
committerMichal Idziorek <m.i@gmx.at>2014-11-17 23:17:51 +0100
commit7e2da9a580fb42ebf46096364e511ef57bc05cd8 (patch)
tree110c6f71cda7a82b08b707009a37042c899a829d /kernel/kernel.c
parentc8032c1bf3a951cbd7aaef8b9a03b12aabd1f691 (diff)
little cleanup
Diffstat (limited to 'kernel/kernel.c')
-rw-r--r--kernel/kernel.c55
1 files changed, 5 insertions, 50 deletions
diff --git a/kernel/kernel.c b/kernel/kernel.c
index a5bbfcc..2f7cfc3 100644
--- a/kernel/kernel.c
+++ b/kernel/kernel.c
@@ -29,61 +29,12 @@
#include "floppy.h"
#endif
-// some multiprocessor shit that should move away TODO
-uint32_t c1,c2,c3;
-volatile uint8_t proc;
-uint32_t cpu_counter[SMP_MAX_PROC];
-
-void kernel_ap()
-{
- proc++;
- uint8_t p=proc;
- while(1)
- {
- cpu_counter[p]++;
-
- lock_spin(0);
- if(cpu_counter[p]%1000000==0)log(FOOLOS_MODULE_NAME,FOOLOS_LOG_DEBUG,"cpu[%d] %d",p,cpu_counter[p]);
- lock_release(0);
- }
-}
-
-
-// mouse coords testing, move away
-volatile int16_t mouse_x;
-volatile int16_t mouse_y;
-
//
// KERNEL MAIN
-
-// this is the very heart of our operating system!
//
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)
- {
- uint32_t ebp=pmmngr_alloc_block()+4095;
-
- asm volatile("mov %0, %%ebp"::"r"(ebp));
- asm volatile("mov %ebp, %esp");
- asm volatile("jmp kernel_ap");
- }
-
- proc=c1=c2=c3=0;
- for(int i=0;i<SMP_MAX_PROC;i++)cpu_counter[i]=0;
-
- /////////////////// BULLSHIT ABOVE THIS LINE: TODO: CLEANUP
-
- //
- // Print initial address of the esp stack pointer
- //
- log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"initial esp: 0x%08X",initial_stack);
-
//
// Configuring the PIT timer.
//
@@ -105,13 +56,14 @@ void kernel_main(uint32_t initial_stack, int mp)
//
console_init();
+
// log buffered messages to console
log_log();
+
//
// Setup PIC
//
- log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"setting up PIC.");
pic_setup();
@@ -119,6 +71,7 @@ void kernel_main(uint32_t initial_stack, int mp)
// mouse_init();
keyboard_init();
+
//
// Setup Interrupts (code segment: 0x08)
//
@@ -141,6 +94,7 @@ void kernel_main(uint32_t initial_stack, int mp)
// init spinlocks
init_spinlocks();
+
// ringbuffer for stdin!
ringbuffer_init();
@@ -156,6 +110,7 @@ void kernel_main(uint32_t initial_stack, int mp)
//
vmem_init();
+
//
// Scan the PCI Bus
//