--- qemu/roms/seabios/src/post.c 2018/04/24 19:24:03 1.1.1.6 +++ qemu/roms/seabios/src/post.c 2018/04/24 19:43:44 1.1.1.7 @@ -26,6 +26,7 @@ #include "xen.h" // xen_probe_hvm_info #include "ps2port.h" // ps2port_setup #include "virtio-blk.h" // virtio_blk_setup +#include "virtio-scsi.h" // virtio_scsi_setup /**************************************************************** @@ -103,7 +104,7 @@ ram_probe(void) if (CONFIG_COREBOOT) { coreboot_setup(); } else if (usingXen()) { - xen_setup(); + xen_setup(); } else { // On emulators, get memory size from nvram. u32 rs = ((inb_cmos(CMOS_MEM_EXTMEM2_LOW) << 16) @@ -150,8 +151,7 @@ ram_probe(void) add_e820(0xfffbc000, 4*4096, E820_RESERVED); } - dprintf(1, "Ram Size=0x%08x (0x%08x%08x high)\n" - , RamSize, (u32)(RamSizeOver4G >> 32), (u32)RamSizeOver4G); + dprintf(1, "Ram Size=0x%08x (0x%016llx high)\n", RamSize, RamSizeOver4G); } static void @@ -162,8 +162,8 @@ init_bios_tables(void) return; } if (usingXen()) { - xen_copy_biostables(); - return; + xen_copy_biostables(); + return; } create_pirtable(); @@ -190,6 +190,7 @@ init_hw(void) cbfs_payload_setup(); ramdisk_setup(); virtio_blk_setup(); + virtio_scsi_setup(); } // Begin the boot process by invoking an int0x19 in 16bit mode. @@ -333,10 +334,25 @@ reloc_init(void) func(); } -// Start of Power On Self Test (POST) - the BIOS initilization phase. -// This function does the setup needed for code relocation, and then -// invokes the relocation and main setup code. +// Setup for code relocation and then call reloc_init void VISIBLE32INIT +dopost(void) +{ + HaveRunPost = 1; + + // Detect ram and setup internal malloc. + qemu_cfg_port_probe(); + ram_probe(); + malloc_setup(); + + // Relocate initialization code and call maininit(). + reloc_init(); +} + +// Entry point for Power On Self Test (POST) - the BIOS initilization +// phase. This function makes the memory at 0xc0000-0xfffff +// read/writable and then calls dopost(). +void VISIBLE32FLAT handle_post(void) { debug_serial_setup(); @@ -356,13 +372,7 @@ handle_post(void) // Allow writes to modify bios area (0xf0000) make_bios_writable(); - HaveRunPost = 1; - // Detect ram and setup internal malloc. - qemu_cfg_port_probe(); - ram_probe(); - malloc_setup(); - - // Relocate initialization code and call maininit(). - reloc_init(); + // Now that memory is read/writable - start post process. + dopost(); }