From 347ee926fd09d7fb45025f2c4e4a4eeab83459c9 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Mon, 1 Sep 2014 13:26:52 +0200 Subject: Added kernel_entry for APs --- kernel/kernel.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'kernel/kernel.c') diff --git a/kernel/kernel.c b/kernel/kernel.c index 5a32c95..7bbfcce 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -21,9 +21,27 @@ uint32_t read_eip(); // this is the very heart of our operating system! // -void kernel_main(uint32_t initial_stack) +void kernel_main(uint32_t initial_stack, int mp) { + + // catch the APs (Application Processors) + if(mp==1) + { + uint16_t c3=0; + while(1) + { + + + c3++; + asm("cli"); + + PutString("cpu2: %03d", 200,560,0b1111100000000000, c3/100); + + asm("sti"); + } + } + // // We want to get output to the screen as fast as possible! // @@ -44,6 +62,7 @@ void kernel_main(uint32_t initial_stack) // our video memory // + uint32_t vesa_physbase=vesa_init(0x8300,0x8400,0x7200); @@ -53,6 +72,8 @@ void kernel_main(uint32_t initial_stack) log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"initial esp: 0x%08X",initial_stack); + log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"mp: %d",mp); + // // Initialize other processors // @@ -72,6 +93,7 @@ void kernel_main(uint32_t initial_stack) log(FOOLOS_MODULE_NAME,FOOLOS_LOG_INFO,"setting up PIC."); pic_setup(); + //while(1); // // Configuring the PIT timer. @@ -130,7 +152,7 @@ void kernel_main(uint32_t initial_stack) // Initialize Floppy Disk // - floppy_init(); + // floppy_init(); // -- cgit v1.2.3