Created architecture specific init processes, fixed gcc warnings
[akaros.git] / kern / src / init.c
index 13d1ef1..95600a5 100644 (file)
@@ -1,7 +1,7 @@
 /* See COPYRIGHT for copyright information. */
 
-#ifdef __DEPUTY__
-#pragma nodeputy
+#ifdef __SHARC__
+#pragma nosharc
 #endif
 
 #ifdef __BSD_ON_CORE_0__
 #include <assert.h>
 #include <monitor.h>
 #include <pmap.h>
-#include <env.h>
-#include <testing.h>
+#include <process.h>
+#include <trap.h>
 #include <syscall.h>
 #include <kclock.h>
 #include <manager.h>
+#include <testing.h>
 
-#include <rl8168.h>
-#include <mptables.h>
-#include <pci.h>
-#include <arch/ioapic.h>
+#include <arch/init.h>
+
+// zra: flag for Ivy
+int booting = 1;
 
 void kernel_init(multiboot_info_t *mboot_info)
 {
-       extern char (BND(__this, end) edata)[], (SNT end)[];
+       extern char (RO BND(__this, end) edata)[], (RO SNT end)[];
 
        // Before doing anything else, complete the ELF loading process.
        // Clear the uninitialized global data (BSS) section of our program.
@@ -46,38 +47,33 @@ void kernel_init(multiboot_info_t *mboot_info)
 
        print_cpuinfo();
 
-       multiboot_detect_memory((multiboot_info_t*)((uint32_t)mboot_info + KERNBASE));
-       multiboot_print_memory_map((multiboot_info_t*)((uint32_t)mboot_info + KERNBASE));
+       // Old way, pre Zach's Ivy annotations
+       //multiboot_detect_memory((multiboot_info_t*)((uint32_t)mboot_info + KERNBASE));
+       //multiboot_print_memory_map((multiboot_info_t*)((uint32_t)mboot_info + KERNBASE));
+       
+       // Paul: Can't use KADDR as arg to multiboot_detect_memory
+       //  since multiboot_detect_memory is what sets npages. 
+       //  Must simulate KADDR macro (ugly).
+       multiboot_detect_memory((multiboot_info_t*CT(1))TC((physaddr_t)mboot_info + KERNBASE));
+
+       multiboot_print_memory_map((multiboot_info_t*CT(1))KADDR((physaddr_t)mboot_info));
 
        vm_init();
 
+       cache_init();
        page_init();
        page_check();
-
-       env_init();
+       //test_page_coloring();
 
        idt_init();
        sysenter_init();
        timer_init();
-       mptables_parse();
-       pci_init();
-       ioapic_init(); // MUST BE AFTER PCI/ISA INIT!
-       // this returns when all other cores are done and ready to receive IPIs
-       smp_boot();
        
-       nic_init();             
-       /*
-
-       // this returns when all other cores are done and ready to receive IPIs
-       smp_boot();
-       test_smp_call_functions();
-       test_checklists();
-       test_barrier();
-       test_print_info();
-       test_lapic_status_bit();
-       test_ipi_sending();
-       test_pit();
-       */
+       // At this point our boot paths diverge based on arch. 
+       arch_init();
+
+       // zra: let's Ivy know we're done booting
+       booting = 0;
 
        manager();
 }