kern

annotate src/main.c @ 52:fa65b4f45366

picking this up again, let's fix it
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 07 Aug 2011 06:42:00 +0300
parents f65b348780e3
children 0fe6eef16335
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@52 42 /* create the first process and switch to it */
nuclear@47 43 init_proc();
nuclear@47 44
nuclear@52 45 /* XXX unreachable */
nuclear@31 46
nuclear@2 47 for(;;) {
nuclear@43 48 halt_cpu();
nuclear@2 49 }
nuclear@0 50 }