Beispiel #1
0
void
qemu_platform_setup(void)
{
    if (!CONFIG_QEMU)
        return;

    if (runningOnXen()) {
        pci_probe_devices();
        xen_hypercall_setup();
        xen_biostable_setup();
        return;
    }

    // Initialize pci
    pci_setup();
    smm_device_setup();
    smm_setup();

    // Initialize mtrr and smp
    mtrr_setup();
    smp_setup();

    // Create bios tables
    pirtable_setup();
    mptable_setup();
    smbios_setup();

    if (CONFIG_FW_ROMFILE_LOAD) {
        int loader_err;

        dprintf(3, "load ACPI tables\n");

        loader_err = romfile_loader_execute("etc/table-loader");

        RsdpAddr = find_acpi_rsdp();

        if (RsdpAddr)
            return;

        /* If present, loader should have installed an RSDP.
         * Not installed? We might still be able to continue
         * using the builtin RSDP.
         */
        if (!loader_err)
            warn_internalerror();
    }

    acpi_setup();
}
Beispiel #2
0
// Main setup code.
static void
maininit(void)
{
    // Setup romfile items.
    qemu_cfg_romfile_setup();
    coreboot_cbfs_setup();

    // Setup ivt/bda/ebda
    init_ivt();
    init_bda();

    // Init base pc hardware.
    pic_setup();
    timer_setup();
    mathcp_setup();

    // Initialize pci
    pci_setup();
    smm_init();

    // Initialize mtrr
    mtrr_setup();

    // Setup Xen hypercalls
    xen_init_hypercalls();

    // Initialize internal tables
    boot_setup();

    // Start hardware initialization (if optionrom threading)
    if (CONFIG_THREADS && CONFIG_THREAD_OPTIONROMS)
        init_hw();

    // Find and initialize other cpus
    smp_probe();

    // Setup interfaces that option roms may need
    bios32_setup();
    pmm_setup();
    pnp_setup();
    kbd_setup();
    mouse_setup();
    init_bios_tables();

    // Run vga option rom
    vga_setup();

    // Do hardware initialization (if running synchronously)
    if (!CONFIG_THREADS || !CONFIG_THREAD_OPTIONROMS) {
        init_hw();
        wait_threads();
    }

    // Run option roms
    optionrom_setup();

    // Run BCVs and show optional boot menu
    boot_prep();

    // Finalize data structures before boot
    cdemu_setup();
    pmm_finalize();
    malloc_finalize();
    memmap_finalize();

    // Setup bios checksum.
    BiosChecksum -= checksum((u8*)BUILD_BIOS_ADDR, BUILD_BIOS_SIZE);

    // Write protect bios memory.
    make_bios_readonly();

    // Invoke int 19 to start boot process.
    startBoot();
}