diff options
| -rw-r--r-- | Makefile | 1 | ||||
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | bochs/bochsrc | 4 | ||||
| -rw-r--r-- | boot/stage2.asm | 2 | ||||
| -rw-r--r-- | kernel/config.h | 4 | ||||
| -rw-r--r-- | kernel/console.c | 14 | ||||
| -rw-r--r-- | kernel/kernel.c | 54 | ||||
| -rw-r--r-- | video/vesa.c | 20 | ||||
| -rw-r--r-- | video/vesa.h | 2 |
9 files changed, 58 insertions, 45 deletions
@@ -113,6 +113,7 @@ FoolData.img: binfont.bin $(MP_BIN) userspace/ext2.img # vdi image for VirtualBox FoolOS.vdi: FoolOS.img + -rm FoolOS.vdi VBoxManage convertfromraw FoolOS.img FoolOS.vdi --uuid 2f11ca11-c35d-4240-b77e-79e37d32616c # run in our local bochs (we need cirrus support for our vesa mode) @@ -43,7 +43,7 @@ Supported Platforms FoolOS is tested/developed on the following emulators/machines -* bochs 2.6.6 (compiled with: ./configure --enable-clgd54xx --enable-a20-pin --enable-debugger --enable-disasm --enable-e1000 --with-x --with-x11 --enable-smp) +* bochs 2.6.6 (compiled with: ./configure --enable-clgd54xx --enable-a20-pin --enable-debugger --enable-disasm --enable-e1000 --with-x --with-x11 --with-term --enable-smp) (add -lpthread to LIBS in the Makefile!) * qemu 1.1.2 * virtual box 4.1.18 * Acer Aspire 1810TZ (Notebook) diff --git a/bochs/bochsrc b/bochs/bochsrc index 8ad5504..4e278cc 100644 --- a/bochs/bochsrc +++ b/bochs/bochsrc @@ -53,10 +53,10 @@ #display_library: nogui #display_library: rfb, options="timeout=60" # time to wait for client #display_library: sdl #, options="fullscreen" # startup in fullscreen mode -#display_library: term +display_library: term #display_library: wx #display_library: x, options="hideIPS" # disable IPS output in status bar -display_library: x, options="gui_debug" # use GTK debugger gui +#display_library: x, options="gui_debug" # use GTK debugger gui #display_library: x diff --git a/boot/stage2.asm b/boot/stage2.asm index 215cb18..6ac0fd1 100644 --- a/boot/stage2.asm +++ b/boot/stage2.asm @@ -144,7 +144,7 @@ kernel_load: mov ax,[KERNEL_CHUNK] cmp ax,0x5 jne skip_vesa_init - ; call VesaSetup +; call VesaSetup skip_vesa_init: call switch_to_pm 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(); diff --git a/video/vesa.c b/video/vesa.c index 2addea7..0859f19 100644 --- a/video/vesa.c +++ b/video/vesa.c @@ -50,6 +50,26 @@ void vesa_set_physbase(uint32_t addr) VbeModeInfoBlock->physbase=addr; } + // + // 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: + // + // * the addresses of the vbeinfo struct + // * the address of the vbemodeinfo struct (for selected mode). + // * Fool Font loaded inside ramimage + // + // 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. + // + // this function returns the physical base address of + // our video memory + // + uint32_t vesa_init(vbeinfo *info,vbemodeinfo *mode,foolfont *rawfont) { //the only functionallu important init lines! (rest is log) diff --git a/video/vesa.h b/video/vesa.h index 89cb680..1f6c12e 100644 --- a/video/vesa.h +++ b/video/vesa.h @@ -43,3 +43,5 @@ typedef struct ModeInfoBlock { }vbemodeinfo; uint32_t vesa_init(vbeinfo *info,vbemodeinfo *mode,foolfont *rawfont); +void PutConsoleChar(char c, int color); +void PutConsole(char *str, int color); |
