From 600ef9b4efed894db2c0a205dbbc10d36cf28852 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Fri, 14 Nov 2014 01:07:06 +0100 Subject: switched bochs to term mode ! --- kernel/config.h | 4 ++-- kernel/console.c | 14 ++++++++++++++ kernel/kernel.c | 54 +++++++++++++++--------------------------------------- 3 files changed, 31 insertions(+), 41 deletions(-) (limited to 'kernel') diff --git a/kernel/config.h b/kernel/config.h index 848e422..39b7b90 100644 --- a/kernel/config.h +++ b/kernel/config.h @@ -6,6 +6,6 @@ //#define FOOLOS_COMPILE_FLOPPY // compile floppy drivers //#define FOOLOS_CONSOLE_AUTOBREAK // add newline automatically at end of line -#define FOOLOS_LOG_OFF // do not log anything -#define FOOLOS_CONSOLE +//#define FOOLOS_LOG_OFF // do not log anything +#define FOOLOS_CONSOLE // otherwise VESA will be used! diff --git a/kernel/console.c b/kernel/console.c index b6866a7..2fdd3c1 100644 --- a/kernel/console.c +++ b/kernel/console.c @@ -1,5 +1,19 @@ +#include "kernel/config.h" + +#ifdef FOOLOS_CONSOLE + #include "video/console.h" void console_init(){scr_clear();} void console_put_char(char c){scr_put_char(c,SCR_RED);} void console_put_str(char *s){scr_put_string(s);} + +#else + +#include "video/vesa.h" + +void console_init(){uint32_t vesa_physbase=vesa_init(0x9300,0x9400,0x168000+512);} +void console_put_char(char c){PutConsoleChar(c,0xffffff);} +void console_put_str(char *s){PutConsole(s,0xffffff);} + +#endif diff --git a/kernel/kernel.c b/kernel/kernel.c index 29159f5..6cc4500 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -27,8 +27,6 @@ #include "floppy.h" #endif - - // some multiprocessor shit that should move away TODO uint32_t c1,c2,c3; volatile uint8_t proc; @@ -80,44 +78,34 @@ void kernel_main(uint32_t initial_stack, int mp) /////////////////// BULLSHIT ABOVE THIS LINE: TODO: CLEANUP // - // system time + // The System Time // task_system_clock=0; // - // init system log ringbugger - // - log_init(); - - console_init(); - - // - // We want to get output to the screen as fast as possible! - // - // Our Fool-Boot-Loader did set up VESA already for us. - // The desired VESA mode is hardcoded in [boot/mbr.asm]. - // - // The [vesa_init(...)] function requires: + // Memory Init // - // * the addresses of the vbeinfo struct - // * the address of the vbemodeinfo struct (for selected mode). - // * Fool Font loaded inside ramimage + // after this is set up we will be able to allocate and deallocate + // blocks of physical memory :) // - // The first two paramters are hardcoded in [boot/mbr.asm], - // while the last one is set in the Makefile. The font binary - // is integrated in the kernel image. + // we know that here, the bootloader placed the mamory map and + // the number of entries. // - // this function returns the physical base address of - // our video memory + mem_init(0x7c00+1,*((uint16_t *)(0x7c00))); + // - + // init system log ringbugger + // + log_init(); - //uint32_t vesa_physbase=vesa_init(0x9300,0x9400,0x168000+512);//0x80000+0x200); + // + // init output to screen + // + console_init(); // self-log message of logger :P log_log(); - // // Print initial address of the esp stack pointer // @@ -153,18 +141,6 @@ void kernel_main(uint32_t initial_stack, int mp) if(!mp_find(&procdata)) panic(FOOLOS_MODULE_NAME,"ACPI and MP search failed! I do not want to continue!"); - - // - // 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 and - // the number of entries. - // - mem_init(0x7c00+1,*((uint16_t *)(0x7c00))); - // init spinlocks init_spinlocks(); -- cgit v1.2.3