From d85b6209f37b4d886f9e85fd9592c9d7cf25deb9 Mon Sep 17 00:00:00 2001 From: Michal Idziorek Date: Wed, 27 Aug 2014 15:56:52 +0200 Subject: further cleanup of bootloader --- kernel/kernel.c | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) (limited to 'kernel/kernel.c') diff --git a/kernel/kernel.c b/kernel/kernel.c index 05a4f9f..efa703b 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -5,7 +5,8 @@ // TODO: cleanup . how can i compile it without the includes!?? /////// - +// interrupt handler prototypes +// todo: move somewhere else!? void int_def_handler(); void int_clock_handler(); void int_kb_handler(); @@ -14,7 +15,9 @@ void int_floppy_handler(); ////////// KERNEL MAIN///// ///// // -// test handler +// just a test handler for software interrupt 88, todo: remove and +// implement some syscalls! +// void int_test_handler() { X86_IRQ_BEGIN @@ -26,22 +29,23 @@ void int_test_handler() } +// heart of our operating system void kernel_main() { // clear console - scr_clear(); +//! scr_clear(); // hello message - scr_put_string_nl(KERNEL_HELLO_MESSAGE); - scr_put_string_nl(""); +//! scr_put_string_nl(KERNEL_HELLO_MESSAGE); +//! scr_put_string_nl(""); //pit config - //timer_init(); + timer_init(); // we know that here the bootloader placed the mamory map! - mem_init(0x7c00+0x400,*((uint16_t *)(0x7c00+0x600))); - //mem_init(0x9000); +//! mem_init(0x7c00+0x400,*((uint16_t *)(0x7c00+0x600))); + mem_init(0x9000); // we know that here the bootloader placed the mamory map! vmem_init(); @@ -72,34 +76,33 @@ void kernel_main() // now we can enable interrupts back again int_enable(); - scr_put_string_nl("interrupts: Interrupts are up and running"); +//! scr_put_string_nl("interrupts: Interrupts are up and running"); // pci pci_init(); + // floppy + floppy_init(); + // vesa init vesa_init(0x8300,0x8400); - // floppy - floppy_init(); - scr_put_string_nl(""); +//! scr_put_string_nl(""); //init shell shell_init(); // kernel main loop - uint8_t t=0; - uint8_t o=0; // while(1) // { //} - //uint8_t rawfont[]={0xff,0xff,0xc3,0xc3,0xff,0xff,0xc3,0xc3}; - //uint8_t rawfont[]={0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xff,0xff,}; - uint8_t *rawfont=0xb000; // here the floppy_init puts first sector - // after 0x8000 (font data :)) + // put some text on monitor! + + uint8_t *rawfont=0xb000; // here the floppy_init puts first sector + // after 0x8000 (font data :)) PutString(rawfont,"Welcome to Fool OS 001",10,10,0xff00); PutString(rawfont,"Welcome to Fool OS 001",20,20,0xf00); -- cgit v1.2.3