More verbose multicore debugging
[akaros.git] / kern / src / init.c
index 91b73aa..8ceff5c 100644 (file)
 #include <syscall.h>
 #include <kclock.h>
 #include <manager.h>
+#include <testing.h>
+#include <kmalloc.h>
+
+#include <arch/init.h>
+#include <arch/bitmask.h>
+#include <slab.h>
+#include <kfs.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.
@@ -48,24 +58,33 @@ void kernel_init(multiboot_info_t *mboot_info)
        // 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*SAFE)(void*TRUSTED)((physaddr_t)mboot_info + KERNBASE));
-       
-       multiboot_print_memory_map((multiboot_info_t*COUNT(1))KADDR((physaddr_t)mboot_info));
+       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();
+       kmem_cache_init();
+       kmalloc_init();
+       cache_color_alloc_init();
+       colored_page_alloc_init();
        page_check();
 
-       env_init();
-
        idt_init();
        sysenter_init();
        timer_init();
-
-       // this returns when all other cores are done and ready to receive IPIs
-       smp_boot();
+       
+       // At this point our boot paths diverge based on arch. 
+       arch_init();
+               
+//     printk("Starting tests....\n");
+//     test_color_alloc();
+//     printk("Testing complete....\n");
+
+       // zra: let's Ivy know we're done booting
+       booting = 0;
 
        manager();
 }