/************************************************************************** * Control arrives here from assembly/start.asm ***************************************************************************/ void k_main() { initialize_video(); initialize_boot_console(); // Print the welcome banner kset_color(DEFAULT_COLOR); kprintf("Welcome To "); kset_color(LIGHT_BLUE); kprintf("Blue Fire OS.\n"); kset_color(DEFAULT_COLOR); kprintf("Kernel is running at virtual address: %#010x\n", (u32int)&_start); kprintf("Total System memory is: %d MB\n", (var_system_memory_amount /(1024 * 1024)) ); dump_dirty_pages(); initialize_paging(); initialize_main_console(); dbg_brk(); // We must never reach this point. PANIC("End of k_main reached."); }
void eqraos_screen() { kclear(0x13); kgoto_xy(0,0); kset_color(0x3F); kputs(" eqraOS v0.1 "); //kgoto_xy(0,1); //kputs(" Ahmad Essam [[email protected]] "); kgoto_xy(0,24); kset_color(0x3F); kputs(" "); kgoto_xy(0,3); }
void pmm_demo() { kset_color(0x12); uint32_t* b1 = (uint32_t*)pmm_alloc(); uint32_t* b2 = (uint32_t*)pmm_allocs(2); kprintf("b1 allocataed 1 block at 0x%x: \n",b1); kprintf("b2 allocataed 2 blocks at 0x%x: \n",b2); pmm_dealloc(b1); b1 = (uint32_t*)pmm_alloc(); kprintf("b1 re-allocataed at 0x%x: \n",b1); pmm_dealloc(b1); pmm_deallocs(b2,2); }
// This example add code for Paging and Virtul Memory Managment, but not use it ! int _cdecl main(multiboot_info* boot_info) { mem_info_init(boot_info); eqraos_screen(); kset_color(GRAY_ON_BLUE); kputs("eqraOS kernel executed\n"); mem_info_dump_size(); mem_info_dump_region(); hal_init(); enable_irq(); execption_init(); mem_info_blocks_stat(); return 0; }
void _cdecl kernel_panic(const char* msg,...) { disable_irq(); va_list args; va_start(args,msg); /* missing */ va_end(args); char* panic = "\nSorry, eqraOS has encountered a problem and has been shutdown.\n\n"; kclear(0x1f); kgoto_xy(0,0); kset_color(0x1f); kputs(panic); kprintf("*** STOP: %s",msg); /* hang */ for (;;) ; }