#include "kernel.h" #include "log.h" #include "multiboot.h" multiboot_information* multiboot_read(uint32_t eax, uint32_t ebx, bool silent) { if(eax!=0x2badb002)kpanic("EAX was not set properly by your bootlaoder!"); multiboot_information *info; info=ebx; if(silent) return info; // silence is golden klog("multiboot struct at addr: 0x%08X",ebx); klog("multiboot flags: 0x%08X",info->flags); if(info->flags&&1<<0) { klog("[0] mem_lower: %d KB",info->mem_lower); klog("[0] mem_upper: %d KB",info->mem_upper); } if(info->flags&&1<<1) { klog("[1] boot-device 0x%08X",info->boot_device); } if(info->flags&&1<<2) { klog("[2] cmdline: \"%s\"",info->cmdline); } if(info->flags&&1<<3) { klog("[3] loaded modules count: %d",info->mods_count); } if(info->flags&&1<<4) { klog("[4/5] a.out kernel image symbols found"); } if(info->flags&&1<<5) { klog("[4/5] ELF table: %d entries (sized %d) at 0x%08X with strings at %d",info->syms[0],info->syms[1],info->syms[2],info->syms[3]); } if(info->flags&&1<<6) { klog("[6] Found memory map"); } if(info->flags&&1<<7) { klog("[7] Found Drives map"); } if(info->flags&&1<<8) { klog("[8] ROM Configuration Table at: 0x%08X",info->config_table); } if(info->flags&&1<<9) { klog("[9] Loaded by: \"%s\"",info->boot_loader_name); } if(info->flags&&1<<10) { klog("[10] APM Table present."); } if(info->flags&&1<<11) { klog("[11] VBE control info: 0x%08X",info->vbe_control_info); klog("[11] VBE mode info: 0x%08X",info->vbe_mode_info); klog("[11] VBE current mode (spec V3.0): 0x%08X",info->vbe_mode); } if(info->flags&&1<<12) { klog("[12] Framebuffer (type=%d) (w:%d h:%d bpp:%d) (pitch: %d) at addr=0x%08X",info->framebuffer_type,info->framebuffer_width,info->framebuffer_height,info->framebuffer_bpp,info->framebuffer_pitch,info->framebuffer_addr); } return info; }