kern
annotate src/main.c @ 49:50730d42d2d3
fuck yeah, now do priviledge levels and TSS
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 30 Jul 2011 07:21:54 +0300 |
parents | 5f6c5751ae05 |
children | fa65b4f45366 |
rev | line source |
---|---|
nuclear@1 | 1 #include <stdio.h> |
nuclear@16 | 2 #include "mboot.h" |
nuclear@0 | 3 #include "vid.h" |
nuclear@1 | 4 #include "term.h" |
nuclear@16 | 5 #include "asmops.h" |
nuclear@7 | 6 #include "segm.h" |
nuclear@10 | 7 #include "intr.h" |
nuclear@36 | 8 #include "rtc.h" |
nuclear@33 | 9 #include "timer.h" |
nuclear@27 | 10 #include "mem.h" |
nuclear@16 | 11 #include "vm.h" |
nuclear@47 | 12 #include "proc.h" |
nuclear@16 | 13 |
nuclear@2 | 14 |
nuclear@16 | 15 void kmain(struct mboot_info *mbinf) |
nuclear@0 | 16 { |
nuclear@2 | 17 clear_scr(); |
nuclear@16 | 18 |
nuclear@16 | 19 /* pointless verbal diarrhea */ |
nuclear@16 | 20 if(mbinf->flags & MB_LDRNAME) { |
nuclear@16 | 21 printf("loaded by: %s\n", mbinf->boot_loader_name); |
nuclear@16 | 22 } |
nuclear@16 | 23 if(mbinf->flags & MB_CMDLINE) { |
nuclear@16 | 24 printf("kernel command line: %s\n", mbinf->cmdline); |
nuclear@16 | 25 } |
nuclear@16 | 26 |
nuclear@2 | 27 puts("kernel starting up"); |
nuclear@2 | 28 |
nuclear@7 | 29 init_segm(); |
nuclear@10 | 30 init_intr(); |
nuclear@7 | 31 |
nuclear@31 | 32 |
nuclear@26 | 33 /* initialize the physical memory manager */ |
nuclear@26 | 34 init_mem(mbinf); |
nuclear@26 | 35 /* initialize paging and the virtual memory manager */ |
nuclear@26 | 36 init_vm(); |
nuclear@19 | 37 |
nuclear@40 | 38 /* initialize the timer and RTC */ |
nuclear@40 | 39 init_timer(); |
nuclear@40 | 40 init_rtc(); |
nuclear@40 | 41 |
nuclear@27 | 42 /* initialization complete, enable interrupts */ |
nuclear@27 | 43 enable_intr(); |
nuclear@27 | 44 |
nuclear@47 | 45 init_proc(); |
nuclear@47 | 46 |
nuclear@31 | 47 |
nuclear@2 | 48 for(;;) { |
nuclear@43 | 49 halt_cpu(); |
nuclear@2 | 50 } |
nuclear@0 | 51 } |