cowos

custom OS from scratch in C
git clone git://git.daat.foo/cowos.git
Log | Files | Refs | README | LICENSE

kernel.c (611B)


      1 #include <gdt.h>
      2 #include <klibc/string.h>
      3 #include <stddef.h>
      4 #include <bootloader.h>
      5 #include <drivers/video/framebuffer.h>
      6 #include <mm/paging.h>
      7 
      8 static void
      9 hcf(void)
     10 {
     11    	for (;;) {
     12         	__asm__("hlt");
     13     	}
     14 }
     15 
     16 void
     17 kernel_main(void)
     18 {
     19         /* Make sure the bootloader understands our base revision */
     20         if (LIMINE_BASE_REVISION_SUPPORTED == 0) hcf();
     21 	
     22         /* Initialize framebuffer console */
     23         fb_init();
     24         map_vga_memory();
     25         
     26         /* Test print */
     27         fb_puts("Hello World\n");
     28         
     29         initGDT();
     30 
     31         /* done so now hang */
     32         hcf();
     33 }