From 4c782da79e519745db86ab996178034fcf767527 Mon Sep 17 00:00:00 2001 From: Adrien Bourmault Date: Sat, 23 Mar 2019 20:34:32 +0100 Subject: [PATCH] For the terminal stuff --- kaleid/include/kernel/base.h | 9 +++++---- kaleid/kernel/init/init.c | 24 +++++++++++++++++++++++- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/kaleid/include/kernel/base.h b/kaleid/include/kernel/base.h index 9b9ed11..a053f8f 100644 --- a/kaleid/include/kernel/base.h +++ b/kaleid/include/kernel/base.h @@ -137,14 +137,15 @@ struct BootInfo_t // Informations about the video drive struct { - ushort valid; - uint vbeControl; //vbe_control_info - uint vbeModeInfo; //vbe_mode_info + ushort vbeValid; + ushort fbuValid; + void *vbeControl; //vbe_control_info + void *vbeModeInfo; //vbe_mode_info ushort vbeMode; //vbe_mode ushort vbeInterfaceSeg; //vbe_interface_seg ushort vbeInterfaceOff; //vbe_interface_off ushort vbeInterfaceLen; //vbe_interface_len - void* framebufferAddr; //framebuffer_addr + void *framebufferAddr; //framebuffer_addr uint framebufferPitch; //framebuffer_pitch uint framebufferWidth; //framebuffer_width uint framebufferHeight; //framebuffer_height diff --git a/kaleid/kernel/init/init.c b/kaleid/kernel/init/init.c index 7941eb6..5a313de 100644 --- a/kaleid/kernel/init/init.c +++ b/kaleid/kernel/init/init.c @@ -74,7 +74,25 @@ void InitBootInfo(multiboot_info_t *mbi) GetBootInfo(memory).mapValid = 1; } - // XXX assign video infos, but unused at this time + // Retrieves video mode informations + if (GetBootInfo(btldr).grubFlags & MULTIBOOT_INFO_VBE_INFO) { + GetBootInfo(video).vbeControl = (void*)(ullong)mbi->vbe_control_info; + GetBootInfo(video).vbeModeInfo = (void*)(ullong)mbi->vbe_mode_info; + GetBootInfo(video).vbeMode = mbi->vbe_mode; + GetBootInfo(video).vbeInterfaceSeg = mbi->vbe_interface_seg; + GetBootInfo(video).vbeInterfaceOff = mbi->vbe_interface_off; + GetBootInfo(video).vbeInterfaceLen = mbi->vbe_interface_len; + GetBootInfo(video).vbeValid = 1; + } + if (GetBootInfo(btldr).grubFlags & MULTIBOOT_INFO_FRAMEBUFFER_INFO) { + GetBootInfo(video).framebufferAddr = (void*)(ullong)mbi->framebuffer_addr; + GetBootInfo(video).framebufferPitch = mbi->framebuffer_pitch; + GetBootInfo(video).framebufferWidth = mbi->framebuffer_width; + GetBootInfo(video).framebufferHeight= mbi->framebuffer_height; + GetBootInfo(video).framebufferBpp = mbi->framebuffer_bpp; + GetBootInfo(video).framebufferType = mbi->framebuffer_type; + GetBootInfo(video).fbuValid = 1; + } // Retrieves the firmware infos if (GetBootInfo(btldr).grubFlags & MULTIBOOT_INFO_CONFIG_TABLE) { @@ -99,6 +117,10 @@ void InitBootInfo(multiboot_info_t *mbi) GetBootInfo(memory).memValid ? okStr : noStr); DebugLog("[InitBootInfo] Memory map %s\n", GetBootInfo(memory).mapValid ? okStr : noStr); + DebugLog("[InitBootInfo] Video infos %s\n", + GetBootInfo(video).vbeValid ? okStr : noStr); + DebugLog("[InitBootInfo] Framebuffer %s\n", + GetBootInfo(video).fbuValid ? okStr : noStr); DebugLog("[InitBootInfo] ROM table %s\n", GetBootInfo(firmware).romValid ? okStr : noStr); DebugLog("[InitBootInfo] APM table %s\n\n",