void kmain( void* mbd, u32int magic ) { if ( magic != 0x2BADB002 ) { kprint("Error booting the kernel", COMPOSE(BB, FL)); } startup(mbd); //provoke_interrupt1(); }
// Write the codepoint at the current location. If IRM is 1 aka // Insert Mode, this codepoint is being inserted in the row, and isn't // overwriting a character. If HEM is zero, character motion is to // the right. If HEM is 1, push them left. // HOME and LIMIT bracket the valid character area. void console_write_char (uint16_t codepoint, int irm, int hem, int home, int limit) { if (col < home && col > limit) return; if (irm == 1 && hem == 0 && col < limit) { int source_start = row * CONSOLE_COLS + col; int source_end = row * CONSOLE_COLS + limit; int destination_start = row * CONSOLE_COLS + col + 1; memmove (cells + destination_start, cells + source_start, source_end - source_start); } else if (irm == 1 && hem == 1 && col > home) { int source_start = row * CONSOLE_COLS + home + 1; int source_end = row * CONSOLE_COLS + col + 1; int destination_start = row * CONSOLE_COLS + home; memmove (cells + destination_start, cells + source_start, source_end - source_start); } cells[row * CONSOLE_COLS + col] = COMPOSE (rendition, codepoint); if (hem == 0) { col++; if (col > limit) col = limit; } else { col--; if (col < home) col = home; } }
void dump_memory(mptr *addr, u32int amount) { u32int i; u32int ColumnCount=0; kprint("Memory dump address: ", COMPOSE(BB, FL)); kphex((u32int) addr, COMPOSE(BB, FL),5); kprint("\n", COMPOSE(BB, FL)); for(i=0;i<amount;i++) { if(ColumnCount<DUMPCOLUMNS) { ColumnCount++; kphex(*addr, COMPOSE(BB, FL),2); kprint(" ", COMPOSE(BB, FL)); addr += 1; } else { ColumnCount=0; kprint("\n", COMPOSE(BB, FL)); } } }