void start_kernel(void) { printk("Mirage: start_kernel\n"); /* Set up events. */ init_events(); /* Enable event delivery. This is disabled at start of day. */ local_irq_enable(); setup_xen_features(); /* Init memory management. * Needed for malloc. */ init_mm(); /* Init time and timers. Needed for block_domain. */ init_time(); /* Init the console driver. * We probably do need this if we want printk to send notifications correctly. */ init_console(); /* Init grant tables. */ init_gnttab(); #if 1 /* Call our main function directly, without using Mini-OS threads. */ app_main_thread(NULL); #else /* Init scheduler. */ /* Needed if you want to use create_thread, but we can get away without it. */ init_sched(); /* Init XenBus */ /* Using Mini-OS's XenBus support requires threads. */ init_xenbus(); /* Respond to "xl shutdown". Requires XenBus. */ create_thread("shutdown", shutdown_thread, NULL); create_thread("ocaml", app_main_thread, NULL); /* Everything initialised, start idle thread */ run_idle_thread(); #endif }
void start_kernel(void) { /* Set up events. */ init_events(); /* ENABLE EVENT DELIVERY. This is disabled at start of day. */ local_irq_enable(); setup_xen_features(); /* Init memory management. */ init_mm(); /* Init GDT */ init_gdt(); /* Init time and timers. */ init_time(); /* Init the console driver. */ init_console(); /* Init grant tables */ init_gnttab(); /* Init scheduler. */ init_sched(); /* Init XenBus */ init_xenbus(); /* Init futexes */ init_futex(); #ifdef CONFIG_XENBUS create_thread("shutdown", shutdown_thread, NULL); #endif /* Call (possibly overridden) app_main() */ app_main(&start_info); /* Everything initialised, start idle thread */ run_idle_thread(); }
/* * INITIAL C ENTRY POINT. */ void start_kernel(start_info_t *si) { static char hello[] = "Bootstrapping...\n"; (void)HYPERVISOR_console_io(CONSOLEIO_write, strlen(hello), hello); setup_xen_features(); pvh_early_init(); arch_init(si); trap_init(); /* print out some useful information */ printk("Xen Minimal OS!\n"); printk(" start_info: %p(VA)\n", si); printk(" nr_pages: 0x%lx\n", si->nr_pages); printk(" shared_inf: 0x%08lx(MA)\n", si->shared_info); printk(" pt_base: %p(VA)\n", (void *)si->pt_base); printk("nr_pt_frames: 0x%lx\n", si->nr_pt_frames); printk(" mfn_list: %p(VA)\n", (void *)si->mfn_list); printk(" mod_start: 0x%lx(VA)\n", si->mod_start); printk(" mod_len: %lu\n", si->mod_len); printk(" flags: 0x%x\n", (unsigned int)si->flags); printk(" cmd_line: %s\n", si->cmd_line ? (const char *)si->cmd_line : "NULL"); /* Set up events. */ init_events(); /* ENABLE EVENT DELIVERY. This is disabled at start of day. */ __sti(); arch_print_info(); /* Init memory management. */ init_mm(); /* Init time and timers. */ init_time(); /* Init the console driver. */ init_console(); /* Init grant tables */ init_gnttab(); /* Init scheduler. */ init_sched(); /* Init XenBus */ init_xenbus(); #ifdef CONFIG_XENBUS /* Init shutdown thread */ init_shutdown(si); #endif /* Call (possibly overridden) app_main() */ app_main(&start_info); /* Everything initialised, start idle thread */ run_idle_thread(); }