static void __init hp_setup(void) { #ifdef CONFIG_PCI pci_setup(); #endif _machine_restart = (void (*)(char *)) hplj_restart; _machine_halt = hplj_halt; _machine_power_off = hplj_halt; board_timer_setup = hp_time_init; printk("HP SETUP\n"); }
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(); }
// 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(); }
int main(void) { const struct bios_config *bios; int acpi_enabled; /* Initialise hypercall stubs with RET, rendering them no-ops. */ memset((void *)HYPERCALL_PHYSICAL_ADDRESS, 0xc3 /* RET */, PAGE_SIZE); printf("HVM Loader\n"); init_hypercalls(); xenbus_setup(); bios = detect_bios(); printf("System requested %s\n", bios->name); printf("CPU speed is %u MHz\n", get_cpu_mhz()); apic_setup(); pci_setup(); smp_initialise(); perform_tests(); if ( bios->bios_info_setup ) bios->bios_info_setup(); if ( bios->create_smbios_tables ) { printf("Writing SMBIOS tables ...\n"); bios->create_smbios_tables(); } printf("Loading %s ...\n", bios->name); if ( bios->bios_load ) bios->bios_load(bios); else { BUG_ON(bios->bios_address + bios->image_size > HVMLOADER_PHYSICAL_ADDRESS); memcpy((void *)bios->bios_address, bios->image, bios->image_size); } if ( (hvm_info->nr_vcpus > 1) || hvm_info->apic_mode ) { if ( bios->create_mp_tables ) bios->create_mp_tables(); if ( bios->create_pir_tables ) bios->create_pir_tables(); } if ( bios->load_roms ) bios->load_roms(); acpi_enabled = !strncmp(xenstore_read("platform/acpi", "1"), "1", 1); if ( acpi_enabled ) { init_vnuma_info(); if ( bios->acpi_build_tables ) { printf("Loading ACPI ...\n"); bios->acpi_build_tables(); } acpi_enable_sci(); hvm_param_set(HVM_PARAM_ACPI_IOPORTS_LOCATION, 1); } init_vm86_tss(); cmos_write_memory_size(); printf("BIOS map:\n"); if ( SCRATCH_PHYSICAL_ADDRESS != scratch_start ) printf(" %05x-%05lx: Scratch space\n", SCRATCH_PHYSICAL_ADDRESS, scratch_start); printf(" %05x-%05x: Main BIOS\n", bios->bios_address, bios->bios_address + bios->image_size - 1); if ( bios->e820_setup ) bios->e820_setup(); if ( bios->bios_info_finish ) bios->bios_info_finish(); xenbus_shutdown(); printf("Invoking %s ...\n", bios->name); return 0; }
int main(void) { const struct bios_config *bios; int acpi_enabled; const struct hvm_modlist_entry *bios_module; /* Initialise hypercall stubs with RET, rendering them no-ops. */ memset((void *)HYPERCALL_PHYSICAL_ADDRESS, 0xc3 /* RET */, PAGE_SIZE); printf("HVM Loader\n"); BUG_ON(hvm_start_info->magic != XEN_HVM_START_MAGIC_VALUE); init_hypercalls(); memory_map_setup(); xenbus_setup(); bios = detect_bios(); printf("System requested %s\n", bios->name); printf("CPU speed is %u MHz\n", get_cpu_mhz()); apic_setup(); pci_setup(); smp_initialise(); perform_tests(); if ( bios->bios_info_setup ) bios->bios_info_setup(); if ( bios->create_smbios_tables ) { printf("Writing SMBIOS tables ...\n"); bios->create_smbios_tables(); } printf("Loading %s ...\n", bios->name); bios_module = get_module_entry(hvm_start_info, "firmware"); if ( bios_module ) { uint32_t paddr = bios_module->paddr; bios->bios_load(bios, (void*)paddr, bios_module->size); } #ifdef ENABLE_ROMBIOS else if ( bios == &rombios_config ) { bios->bios_load(bios, NULL, 0); } #endif else { /* * If there is no BIOS module supplied and if there is no embeded BIOS * image, then we failed. Only rombios might have an embedded bios blob. */ printf("no BIOS ROM image found\n"); BUG(); } if ( (hvm_info->nr_vcpus > 1) || hvm_info->apic_mode ) { if ( bios->create_mp_tables ) bios->create_mp_tables(); if ( bios->create_pir_tables ) bios->create_pir_tables(); } if ( bios->load_roms ) bios->load_roms(); acpi_enabled = !strncmp(xenstore_read("platform/acpi", "1"), "1", 1); if ( acpi_enabled ) { init_vnuma_info(); if ( bios->acpi_build_tables ) { printf("Loading ACPI ...\n"); bios->acpi_build_tables(); } acpi_enable_sci(); hvm_param_set(HVM_PARAM_ACPI_IOPORTS_LOCATION, 1); } init_vm86_tss(); cmos_write_memory_size(); printf("BIOS map:\n"); if ( SCRATCH_PHYSICAL_ADDRESS != scratch_start ) printf(" %05x-%05lx: Scratch space\n", SCRATCH_PHYSICAL_ADDRESS, scratch_start); printf(" %05x-%05x: Main BIOS\n", bios->bios_address, bios->bios_address + bios->image_size - 1); if ( bios->e820_setup ) bios->e820_setup(); if ( bios->bios_info_finish ) bios->bios_info_finish(); xenbus_shutdown(); printf("Invoking %s ...\n", bios->name); return 0; }