コード例 #1
0
ファイル: setup.c プロジェクト: mikesun/xen-cow-checkpointing
static void __init start_of_day(void)
{
    init_IRQ();

    scheduler_init();

    /* create idle domain */
    idle_domain = domain_create(IDLE_DOMAIN_ID, 0, 0);
    if ((idle_domain == NULL) || (alloc_vcpu(idle_domain, 0, 0) == NULL))
        BUG();
    set_current(idle_domain->vcpu[0]);
    idle_vcpu[0] = current;

    initialize_keytable();
    /* Register another key that will allow for the the Harware Probe
     * to be contacted, this works with RiscWatch probes and should
     * work with Chronos and FSPs */
    register_keyhandler('^', key_hw_probe_attn, "Trap to Hardware Probe");

    /* allow the dumping of the devtree */
    register_keyhandler('D', key_ofdump , "Dump OF Devtree");

    timer_init();
    rcu_init();
    serial_init_postirq();
    do_initcalls();
}
コード例 #2
0
ファイル: main.c プロジェクト: JiakangJ/cs370
/*
 * Ok, the machine is now initialized. None of the devices
 * have been touched yet, but the CPU subsystem is up and
 * running, and memory and process management works.
 *
 * Now we can finally start doing some real work..
 */
static void __init do_basic_setup(void)
{
	/* drivers will send hotplug events */
	init_workqueues();
	usermodehelper_init();
	driver_init();
	init_irq_proc();
	do_initcalls();
}
コード例 #3
0
void dde_kit_subsys_linux_init(void)
{
  /* invoked in vfs_cache_init in Linux */
  chrdev_init();
  driver_init(); 

  __dde_call_machine_init();
  do_initcalls();
}
コード例 #4
0
ファイル: main.c プロジェクト: souljaboy11792/ZCF-kernel
/*
 * Ok, the machine is now initialized. None of the devices
 * have been touched yet, but the CPU subsystem is up and
 * running, and memory and process management works.
 *
 * Now we can finally start doing some real work..
 */
static void __init do_basic_setup(void)
{
	rcu_init_sched(); /* needed by module_init stage. */
	init_workqueues();
	usermodehelper_init();
	driver_init();
	init_irq_proc();
	do_initcalls();
}
コード例 #5
0
ファイル: dde_main.c プロジェクト: chyyuu/ucore-arch-arm
void dde_init()
{
    /* invoked in vfs_cache_init in Linux */
    chrdev_init();

    driver_init();
    dde_call_machine_init();
    do_initcalls();

    loadable_module_init();
}
コード例 #6
0
/*
 * Ok, the machine is now initialized. None of the devices
 * have been touched yet, but the CPU subsystem is up and
 * running, and memory and process management works.
 *
 * Now we can finally start doing some real work..
 */
static void __init do_basic_setup(void)
{
	init_workqueues();
	cpuset_init_smp();
	usermodehelper_init();
	init_tmpfs();
	driver_init();
	init_irq_proc();
	do_ctors();
	do_initcalls();
}
コード例 #7
0
/*
 * Ok, the machine is now initialized. None of the devices
 * have been touched yet, but the CPU subsystem is up and
 * running, and memory and process management works.
 *
 * Now we can finally start doing some real work..
 */
static void __init do_basic_setup(void)
{
	/* drivers will send hotplug events */
	init_workqueues();
	usermodehelper_init();
	driver_init();

#ifdef CONFIG_SYSCTL
	sysctl_init();
#endif

	do_initcalls();
}
コード例 #8
0
ファイル: oi_main.c プロジェクト: OS2World/DRV-LXAPI32
/*
 * Ok, the machine is now initialized. None of the devices
 * have been touched yet, but the CPU subsystem is up and
 * running, and memory and process management works.
 *
 * Now we can finally start doing some real work..
 */
static void __init do_basic_setup(void)
{
   driver_init();

#ifdef CONFIG_SYSCTL
   sysctl_init();
#endif

   /* Networking initialization needs a process context */
   sock_init();

   init_workqueues();
   do_initcalls();
}
コード例 #9
0
ファイル: io.c プロジェクト: LastRitter/mcuio
int bathos_setup(void)
{
	CPU_PRESCALE(0);

	console_early_init();

	/* Turn red led on */
	timer_init();
	events_init();

	do_initcalls();

	/* Interrupts are enabled by the calling assembly code */
	return 0;
}
コード例 #10
0
ファイル: main.c プロジェクト: kzlin129/tt-gpl
/*
 * Ok, the machine is now initialized. None of the devices
 * have been touched yet, but the CPU subsystem is up and
 * running, and memory and process management works.
 *
 * Now we can finally start doing some real work..
 */
static void __init do_basic_setup(void)
{
    /* drivers will send hotplug events */
    init_workqueues();
    usermodehelper_init();
    driver_init();

#ifdef CONFIG_SYSCTL
    sysctl_init();
#endif

    /* Networking initialization needs a process context */
    sock_init();

    do_initcalls();
}
コード例 #11
0
ファイル: main.c プロジェクト: DentonGentry/gfiber-gfrg100
/*
 * Ok, the machine is now initialized. None of the devices
 * have been touched yet, but the CPU subsystem is up and
 * running, and memory and process management works.
 *
 * Now we can finally start doing some real work..
 */
static void __init do_basic_setup(void)
{
	/* drivers will send hotplug events */
	init_workqueues();
	usermodehelper_init();
	driver_init();
	init_irq_proc();
	do_initcalls();

#ifdef CONFIG_OPENRG
	/* Instruct mmap and do_mmap not to verify there are free pages before
	 * doing the mapping. This is useful when trying to load an executable
	 * that is larger than the current free memory. We let the swap
	 * mechanism to handle such cases because very little of the executable
	 * pages are really needed in ram at the same time. */
	sysctl_overcommit_memory = OVERCOMMIT_ALWAYS;
#endif
}
コード例 #12
0
ファイル: init.c プロジェクト: gdarcy/scaraOS
/* Init task - the job of this task is to initialise all
 * installed drivers, mount the root filesystem and
 * bootstrap the system */
int init_task(void *priv)
{
	uint32_t ret;
	struct file *file;
	char buf[20];
	int rval;

	/* Initialise kernel subsystems */
	blk_init();
	vfs_init();
	pci_init();

	do_initcalls();

	/* Mount the root filesystem etc.. */
	if ( vfs_mount_root("ext2", "floppy0") ) {
		panic("Unable to mount root filesystem\n");
	}

	file = kernel_open("/test.txt", 0);
	if ( NULL == file ) {
		printk("init_task: open failed, returned %u\n", -1);
	} else {
		rval = kernel_read(file, buf, 16);
		if ( rval < 0 )
			printk("read error: %d\n", rval);
		else if ( rval == 0 )
			printk("read returned EOF\n");
		else {
			buf[rval] = '\0';
			printk("read: %s.\n", buf);
		}
		rval = kernel_write(file, buf, 16);
		kernel_close(file);
	}

	ret = _kernel_exec("/bin/bash");
	ret = _kernel_exec("/sbin/init");
	ret = _kernel_exec("/bin/cat");
	printk("exec: /sbin/init: %i\n", (int)ret);

	return ret;
}
コード例 #13
0
ファイル: init.c プロジェクト: jinlan100130/BTPhone
/*******************************************************************************
 * @brief   driver library initialization
 *
 * should be called on start-up step, to initial interrupt module 
 * and register hardware as camera, lcd...etc.
 * @author  xuchang
 * @date    2008-01-21
 * @return  T_VOID
*******************************************************************************/
T_VOID drv_init(T_PDRIVE_INITINFO drv_info)
{
    memcpy(&g_drv_info, drv_info, sizeof(g_drv_info));

    clk_set_pll(DEF_PLL_VAL);
#if (CHIP_SEL_10C > 0 && DRV_SIMU_UART == 0)
    uart_init(uiUART2, 115200);
#endif
    //init function move to prog_manage of platform
    //pmu_init();
    timer_init();
    gpio_init();
#ifndef BURN_TOOL
    //init function move to prog_manage of platform
    //analog_init();
    //detector_init();
#endif
    //l2_initial();
#if !(USB_VAR_MALLOC > 0)
    DrvModule_Init();
#endif
    //device module registeration init
    do_initcalls();
    drv_print(VERSION, 0, AK_TRUE);

    //close VDDIO3V3 and VDD1V2 unstabitily detect
    //REG32(REG_PMU_CTRL1) |= (PMU_PD_PWR_VCC | PMU_PD_PWR_VDD);

#if DRV_SUPPORT_CAMERA > 0
#if (CAMERA_GC6113 > 0)
    camera_gc6113_reg();
#endif
#if (CAMERA_GC0308 > 0)
    camera_gc0308_reg();
#endif
#endif

#if (CHIP_SEL_10C > 0)
    //pwm32k 是给RDA芯片用的,如果FM工作不好,用32K晶振试下
    pwm_start_32k_square();
#endif
}
コード例 #14
0
ファイル: main.c プロジェクト: kamejoko80/xboot
int xboot_main(int argc, char * argv[])
{
	struct runtime_t rt;

	/* Create runtime */
	runtime_create_save(&rt, 0, 0, 0, 0);

	/* Do initial kobj */
	do_init_kobj();

	/* Do all initial calls */
	do_initcalls();

	/* Mount root filesystem */
	do_system_rootfs();

	/* Display system logo */
	do_system_logo();

	/* System autoboot */
	do_system_autoboot();

	/* Run loop */
	while(1)
	{
		/* Run shell */
		run_shell();
	}

	/* Do all exit calls */
	do_exitcalls();

	/* Destroy runtime */
	runtime_destroy_restore(&rt, 0);

	/* Xboot return */
	return 0;
}
コード例 #15
0
ファイル: init.c プロジェクト: iofish/scaraOS
/* Init task - the job of this task is to initialise all
 * installed drivers, mount the root filesystem and
 * bootstrap the system */
int init_task(void *priv)
{
	uint32_t ret;

	/* Initialise kernel subsystems */
	blk_init();
	vfs_init();
	pci_init();

	do_initcalls();

	/* Mount the root filesystem etc.. */
	if ( vfs_mount_root("ext2", "floppy0") ) {
		panic("Unable to mount root filesystem\n");
	}

	ret = _kernel_exec("/bin/bash");
	ret = _kernel_exec("/sbin/init");
	ret = _kernel_exec("/bin/cat");
	printk("exec: /sbin/init: %i\n", (int)ret);

	return ret;
}
コード例 #16
0
ファイル: init.c プロジェクト: davidgao/AIMv6
void __noreturn master_init(void)
{
	__attribute__ ((aligned(16)))
	uint8_t bootstrap_pool[BOOTSTRAP_POOL_SIZE];

	jump_handlers_apply();
	kputs("KERN: We are in high address.\n");

	arch_init();

	/*
	 * Page allocator requires arbitrary size allocation to allocate
	 * struct pages, while arbitrary size allocation depends on
	 * page allocator to actually give out memory.
	 *
	 * We break such circular dependency by
	 * (1) bootstrap a small virtual memory allocator which works on the
	 *     stack.
	 * (2) initialize a page allocator which works on the bootstrap
	 *     allocator obtained in (1).
	 * (3) initialize a real virtual memory allocator which depend
	 *     on (2).
	 * (4) make the page allocator depend on (3) instead.
	 *
	 * TODO: move the following piece of code to kern/mm
	 */
	simple_allocator_bootstrap(bootstrap_pool, BOOTSTRAP_POOL_SIZE);
	kputs("KERN: Simple allocator bootstrapping.\n");
	page_allocator_init();
	kputs("KERN: Page allocator initialized.\n");
	add_memory_pages();
	kputs("KERN: Pages added.\n");
	kprintf("KERN: Free memory: 0x%p\n", (size_t)get_free_memory());
	struct simple_allocator old;
	get_simple_allocator(&old);
	simple_allocator_init();
	kputs("KERN: Simple allocator initialized.\n");
	page_allocator_move(&old);
	kputs("KERN: Page allocator moved.\n");

	trap_init();
	kputs("KERN: Traps initialized.\n");

	/* temporary test */
	extern void trap_test(void);
	trap_test();

	kputs("KERN: Traps test passed.\n");

	/* do early initcalls, one by one */
	do_early_initcalls();

	mm_init();
	kputs("KERN: Memory management component initialized.\n");

	extern void mm_test(void);
	mm_test();

	/* allocate per-cpu context and kworker */
//	proc_init();

	/* do initcalls, one by one */
	do_initcalls();

	/* temporary tests */
	struct allocator_cache cache = {
		.size = 1024,
		.align = 1024,
		.flags = 0,
		.create_obj = NULL,
		.destroy_obj = NULL
	};
	cache_create(&cache);
	void *a, *b, *c;
	a = cache_alloc(&cache);
	kprintf("DEBUG: a = 0x%08x\n", a);
	b = cache_alloc(&cache);
	kprintf("DEBUG: b = 0x%08x\n", b);
	c = cache_alloc(&cache);
	kprintf("DEBUG: c = 0x%08x\n", c);
	cache_free(&cache, a);
	cache_free(&cache, b);
	cache_free(&cache, c);
	a = cache_alloc(&cache);
	kprintf("DEBUG: a = 0x%08x\n", a);
	cache_free(&cache, a);
	int ret = cache_destroy(&cache);
	kprintf("DEBUG: cache_destroy returned %d.\n", ret);
	cache_create(&cache);
	a = cache_alloc(&cache);
	kprintf("DEBUG: a = 0x%08x\n", a);

	/* startup smp */

	/*
	 * do initcalls, one by one.
	 * They may fork or sleep or reschedule.
	 * In case any initcalls issue a fork, there MUST be EXACTLY one return
	 * from each initcall.
	 */

	/* initialize or cleanup namespace */


	panic("Test done, all is well.\n");
}

void __noreturn slave_init(void)
{
	panic("Unimplemented routine called.");
}
コード例 #17
0
ファイル: main.c プロジェクト: iPodLinux/linux-2.4.24-ipod
/*
 * Ok, the machine is now initialized. None of the devices
 * have been touched yet, but the CPU subsystem is up and
 * running, and memory and process management works.
 *
 * Now we can finally start doing some real work..
 */
static void __init do_basic_setup(void)
{

	/*
	 * Tell the world that we're going to be the grim
	 * reaper of innocent orphaned children.
	 *
	 * We don't want people to have to make incorrect
	 * assumptions about where in the task array this
	 * can be found.
	 */
	child_reaper = current;

#if defined(CONFIG_MTRR)	/* Do this after SMP initialization */
/*
 * We should probably create some architecture-dependent "fixup after
 * everything is up" style function where this would belong better
 * than in init/main.c..
 */
	mtrr_init();
#endif

#ifdef CONFIG_SYSCTL
	sysctl_init();
#endif

	/*
	 * Ok, at this point all CPU's should be initialized, so
	 * we can start looking into devices..
	 */
#if defined(CONFIG_ARCH_S390)
	s390_init_machine_check();
#endif
#ifdef CONFIG_ACPI_INTERPRETER
	acpi_init();
#endif
#ifdef CONFIG_PCI
	pci_init();
#endif
#ifdef CONFIG_SBUS
	sbus_init();
#endif
#if defined(CONFIG_PPC)
	ppc_init();
#endif
#ifdef CONFIG_MCA
	mca_init();
#endif
#ifdef CONFIG_ARCH_ACORN
	ecard_init();
#endif
#ifdef CONFIG_ZORRO
	zorro_init();
#endif
#ifdef CONFIG_DIO
	dio_init();
#endif
#ifdef CONFIG_NUBUS
	nubus_init();
#endif
#ifdef CONFIG_ISAPNP
	isapnp_init();
#endif
#ifdef CONFIG_TC
	tc_init();
#endif

	/* Networking initialization needs a process context */ 
	sock_init();

	start_context_thread();
	do_initcalls();

#ifdef CONFIG_IRDA
	irda_proto_init();
	irda_device_init(); /* Must be done after protocol initialization */
#endif
#ifdef CONFIG_PCMCIA
	init_pcmcia_ds();		/* Do this last */
#endif
}
コード例 #18
0
ファイル: main.c プロジェクト: rharter/xboot-clone
/*
 * the entry of main function.
 */
int xboot_main(int argc, char * argv[])
{
	/* do all init calls */
	do_initcalls();

	/* do system xtime */
	do_system_xtime();

	/* mount root filesystem */
	do_system_rootfs();

	/* load system configure */
	do_system_cfg();

	/* load system fonts */
	do_system_fonts();

	/* check battery capacity */
	do_system_battery();

	/* wait a moment */
	do_system_wait();

	/* run loop */
	while(1)
	{
		/*
		 * normal mode
		 */
		if(xboot_get_mode() == MODE_NORMAL)
		{
			run_normal_mode();
		}

		/*
		 * shell mode
		 */
		else if(xboot_get_mode() == MODE_SHELL)
		{
			run_shell_mode();
		}

		/*
		 * memu mode
		 */
		else if(xboot_get_mode() == MODE_MENU)
		{
			run_menu_mode();
		}

		/*
		 * graphic mode
		 */
		else if(xboot_get_mode() == MODE_GRAPHIC)
		{
			run_graphic_mode();
		}

		/*
		 * application mode
		 */
		else if(xboot_get_mode() == MODE_APPLICATION)
		{
			run_application_mode();
		}
	}

	/* do all exit calls */
	do_exitcalls();

	/* xboot return */
	return 0;
}
コード例 #19
0
ファイル: setup.c プロジェクト: codercold/xen-4.4
/* C entry point for boot CPU */
void __init start_xen(unsigned long boot_phys_offset,
                      unsigned long fdt_paddr,
                      unsigned long cpuid)
{
    size_t fdt_size;
    int cpus, i;
    const char *cmdline;

    setup_cache();

    percpu_init_areas();
    set_processor_id(0); /* needed early, for smp_processor_id() */

    smp_clear_cpu_maps();

    /* This is mapped by head.S */
    device_tree_flattened = (void *)BOOT_FDT_VIRT_START
        + (fdt_paddr & ((1 << SECOND_SHIFT) - 1));
    fdt_size = device_tree_early_init(device_tree_flattened, fdt_paddr);

    cmdline = device_tree_bootargs(device_tree_flattened);
    early_printk("Command line: %s\n", cmdline);
    cmdline_parse(cmdline);

    setup_pagetables(boot_phys_offset, get_xen_paddr());
    setup_mm(fdt_paddr, fdt_size);

    vm_init();
    dt_unflatten_host_device_tree();
    dt_irq_xlate = gic_irq_xlate;

    dt_uart_init();
    console_init_preirq();

    system_state = SYS_STATE_boot;

    processor_id();

    platform_init();

    smp_init_cpus();
    cpus = smp_get_max_cpus();

    init_xen_time();

    gic_init();

    set_current((struct vcpu *)0xfffff000); /* debug sanity */
    idle_vcpu[0] = current;

    init_traps();

    setup_virt_paging();

    p2m_vmid_allocator_init();

    softirq_init();

    tasklet_subsys_init();

    init_IRQ();

    gic_route_ppis();
    gic_route_spis();

    init_maintenance_interrupt();
    init_timer_interrupt();

    timer_init();

    init_idle_domain();

    rcu_init();

    arch_init_memory();

    local_irq_enable();
    local_abort_enable();

    smp_prepare_cpus(cpus);

    initialize_keytable();

    console_init_postirq();

    do_presmp_initcalls();

    for_each_present_cpu ( i )
    {
        if ( (num_online_cpus() < cpus) && !cpu_online(i) )
        {
            int ret = cpu_up(i);
            if ( ret != 0 )
                printk("Failed to bring up CPU %u (error %d)\n", i, ret);
        }
    }

    printk("Brought up %ld CPUs\n", (long)num_online_cpus());
    /* TODO: smp_cpus_done(); */

    do_initcalls();

    /* Create initial domain 0. */
    dom0 = domain_create(0, 0, 0);
    if ( IS_ERR(dom0) || (alloc_dom0_vcpu0() == NULL) )
            panic("Error creating domain 0");

    dom0->is_privileged = 1;
    dom0->target = NULL;

    if ( construct_dom0(dom0) != 0)
            panic("Could not set up DOM0 guest OS");

    /* Scrub RAM that is still free and so may go to an unprivileged domain. */
    scrub_heap_pages();

    init_constructors();

    console_endboot();

    /* Hide UART from DOM0 if we're using it */
    serial_endboot();

    system_state = SYS_STATE_active;

    domain_unpause_by_systemcontroller(dom0);

    /* Switch on to the dynamically allocated stack for the idle vcpu
     * since the static one we're running on is about to be freed. */
    memcpy(idle_vcpu[0]->arch.cpu_info, get_cpu_info(),
           sizeof(struct cpu_info));
    switch_stack_and_jump(idle_vcpu[0]->arch.cpu_info, init_done);
}
コード例 #20
0
ファイル: setup.c プロジェクト: caomw/xen
/* C entry point for boot CPU */
void __init start_xen(unsigned long boot_phys_offset,
                      unsigned long fdt_paddr,
                      unsigned long cpuid)
{
    size_t fdt_size;
    int cpus, i;
    paddr_t xen_paddr;
    const char *cmdline;
    struct bootmodule *xen_bootmodule;
    struct domain *dom0;
    struct xen_arch_domainconfig config;

    setup_cache();

    percpu_init_areas();
    set_processor_id(0); /* needed early, for smp_processor_id() */

    set_current((struct vcpu *)0xfffff000); /* debug sanity */
    idle_vcpu[0] = current;

    setup_virtual_regions(NULL, NULL);
    /* Initialize traps early allow us to get backtrace when an error occurred */
    init_traps();

    smp_clear_cpu_maps();

    /* This is mapped by head.S */
    device_tree_flattened = (void *)BOOT_FDT_VIRT_START
        + (fdt_paddr & ((1 << SECOND_SHIFT) - 1));
    fdt_size = boot_fdt_info(device_tree_flattened, fdt_paddr);

    cmdline = boot_fdt_cmdline(device_tree_flattened);
    printk("Command line: %s\n", cmdline);
    cmdline_parse(cmdline);

    /* Register Xen's load address as a boot module. */
    xen_bootmodule = add_boot_module(BOOTMOD_XEN,
                             (paddr_t)(uintptr_t)(_start + boot_phys_offset),
                             (paddr_t)(uintptr_t)(_end - _start + 1), NULL);
    BUG_ON(!xen_bootmodule);

    xen_paddr = get_xen_paddr();
    setup_pagetables(boot_phys_offset, xen_paddr);

    /* Update Xen's address now that we have relocated. */
    printk("Update BOOTMOD_XEN from %"PRIpaddr"-%"PRIpaddr" => %"PRIpaddr"-%"PRIpaddr"\n",
           xen_bootmodule->start, xen_bootmodule->start + xen_bootmodule->size,
           xen_paddr, xen_paddr + xen_bootmodule->size);
    xen_bootmodule->start = xen_paddr;

    setup_mm(fdt_paddr, fdt_size);

    /* Parse the ACPI tables for possible boot-time configuration */
    acpi_boot_table_init();

    end_boot_allocator();

    vm_init();
    dt_unflatten_host_device_tree();

    init_IRQ();

    platform_init();

    preinit_xen_time();

    gic_preinit();

    arm_uart_init();
    console_init_preirq();
    console_init_ring();

    system_state = SYS_STATE_boot;

    processor_id();

    smp_init_cpus();
    cpus = smp_get_max_cpus();

    init_xen_time();

    gic_init();

    p2m_vmid_allocator_init();

    softirq_init();

    tasklet_subsys_init();


    xsm_dt_init();

    init_maintenance_interrupt();
    init_timer_interrupt();

    timer_init();

    init_idle_domain();

    rcu_init();

    arch_init_memory();

    local_irq_enable();
    local_abort_enable();

    smp_prepare_cpus(cpus);

    initialize_keytable();

    console_init_postirq();

    do_presmp_initcalls();

    for_each_present_cpu ( i )
    {
        if ( (num_online_cpus() < cpus) && !cpu_online(i) )
        {
            int ret = cpu_up(i);
            if ( ret != 0 )
                printk("Failed to bring up CPU %u (error %d)\n", i, ret);
        }
    }

    printk("Brought up %ld CPUs\n", (long)num_online_cpus());
    /* TODO: smp_cpus_done(); */

    setup_virt_paging();

    iommu_setup();

    do_initcalls();

    /*
     * It needs to be called after do_initcalls to be able to use
     * stop_machine (tasklets initialized via an initcall).
     */
    apply_alternatives_all();

    /* Create initial domain 0. */
    /* The vGIC for DOM0 is exactly emulating the hardware GIC */
    config.gic_version = XEN_DOMCTL_CONFIG_GIC_NATIVE;
    config.nr_spis = gic_number_lines() - 32;

    dom0 = domain_create(0, 0, 0, &config);
    if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) == NULL) )
            panic("Error creating domain 0");

    dom0->is_privileged = 1;
    dom0->target = NULL;

    if ( construct_dom0(dom0) != 0)
            panic("Could not set up DOM0 guest OS");

    /* Scrub RAM that is still free and so may go to an unprivileged domain. */
    scrub_heap_pages();

    init_constructors();

    console_endboot();

    /* Hide UART from DOM0 if we're using it */
    serial_endboot();

    system_state = SYS_STATE_active;

    /* Must be done past setting system_state. */
    unregister_init_virtual_region();

    domain_unpause_by_systemcontroller(dom0);

    /* Switch on to the dynamically allocated stack for the idle vcpu
     * since the static one we're running on is about to be freed. */
    memcpy(idle_vcpu[0]->arch.cpu_info, get_cpu_info(),
           sizeof(struct cpu_info));
    switch_stack_and_jump(idle_vcpu[0]->arch.cpu_info, init_done);
}