From: Peter Dinda Date: Mon, 1 Jul 2013 22:05:46 +0000 (-0500) Subject: Allow selection of different BIOSes for the PC hardware class X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=179cda8c3c2686bb4605f67ec6d525d2951c618f;hp=3fabab980b69bbe1824b102077bc92d32bc251d2;p=palacios.git Allow selection of different BIOSes for the PC hardware class --- diff --git a/Kconfig b/Kconfig index 7e231b0..71b85eb 100644 --- a/Kconfig +++ b/Kconfig @@ -456,18 +456,77 @@ endmenu menu "BIOS Selection" -config ROMBIOS_PATH - string "Path to pre-built ROMBIOS binary" +choice + prompt "Boot Code Selection" + default SEABIOS + help + Select which BIOSes to map into the default PC Class Hardware Configuration + +config SEABIOS + bool "Use the SEABIOS and SEABIOS-VGA Boot Code" + help + Use the SEABIOS and SEABIOS-VGA Boot code + + +config BOCHSBIOS + bool "Use the BOCHS BIOS and BOCHS BIOS-compatible VGA Boot Code" + help + Use the BOCHS BIOS and BOCHS-BIOS-compatible VGA Boot Code + + +config OTHERBIOS + bool "Use a user-specified BIOS" + help + Use a user-specified BIOS + + +endchoice + + +config SEABIOS_PATH + string "Path to pre-built SEABIOS binary" + depends on SEABIOS + default "./bios/seabios/out/bios.bin" + help + Path to the SEABIOS binary to use + +config SEABIOSVGA_PATH + string "Path to pre-built SEABIOS-VGA binary" + depends on SEABIOS + default "./bios/seabios-vga/VGABIOS-lgpl-latest.bin" + help + This is the SEABIOS-compatible vgabios that will be used for the guest + +config BOCHSBIOS_PATH + string "Path to pre-built BOCHS BIOS binary" + depends on BOCHSBIOS default "./bios/rombios/BIOS-bochs-latest" help This is the rombios that will be used for the guests -config VGABIOS_PATH - string "Path to pre-built VGABIOS binary" +config BOCHSBIOSVGA_PATH + string "Path to pre-built BOCHS-compatible VGABIOS binary" + depends on BOCHSBIOS default "./bios/vgabios/VGABIOS-lgpl-latest.bin" help This is the vgabios that will be used for the guests +config OTHERBIOS_PATH + string "Path to user-specified Boot Code" + depends on OTHERBIOS + help + This is a completely user-determined blob that will be mapped into the guest + No VGA BIOS will be mapped! + +config BIOS_START + hex "Starting address (linear address) of BIOS" + range 0xe0000 0xe0000 if SEABIOS + range 0xf0000 0xf0000 if BOCHSBIOS + help + This is the starting address (linear address) of the BIOS code + + + config VMXASSIST_PATH string "Path to pre-built VMXASSIST binary" depends on VMX diff --git a/palacios/src/palacios/vmm_binaries.S b/palacios/src/palacios/vmm_binaries.S index b834952..cca75ef 100644 --- a/palacios/src/palacios/vmm_binaries.S +++ b/palacios/src/palacios/vmm_binaries.S @@ -29,20 +29,33 @@ v3_vmxassist_start: v3_vmxassist_end: #endif - +#if V3_CONFIG_SEABIOS || V3_CONFIG_BOCHSBIOS .globl v3_vgabios_start v3_vgabios_start: -.incbin V3_CONFIG_VGABIOS_PATH +#if V3_CONFIG_SEABIOS +.incbin V3_CONFIG_SEABIOSVGA_PATH +#endif +#if V3_CONFIG_BOCHSBIOS +.incbin V3_CONFIG_BOCHSBIOSVGA_PATH +#endif .global v3_vgabios_end v3_vgabios_end: +#endif .globl v3_rombios_start v3_rombios_start: -.incbin V3_CONFIG_ROMBIOS_PATH +#if V3_CONFIG_SEABIOS +.incbin V3_CONFIG_SEABIOS_PATH +#endif +#if V3_CONFIG_ROMBIOS +.incbin V3_CONFIG_BOCHBIOS_PATH +#endif +#if V3_CONFIG_OTHERBIOS +.incbin V3_CONFIG_OTHERBIOS_PATH +#endif .globl v3_rombios_end v3_rombios_end: - #ifdef V3_CONFIG_USE_PXE_BIOS .globl pxebios_start pxebios_start: diff --git a/palacios/src/palacios/vmm_config_class.h b/palacios/src/palacios/vmm_config_class.h index bdd85f4..8d87c18 100644 --- a/palacios/src/palacios/vmm_config_class.h +++ b/palacios/src/palacios/vmm_config_class.h @@ -45,9 +45,12 @@ static int post_config_pc_core(struct guest_info * info, v3_cfg_tree_t * cfg) { static int post_config_pc(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { +# + + +#if defined(V3_CONFIG_SEABIOS) || defined(V3_CONFIG_ROMBIOS) + #define VGABIOS_START 0x000c0000 -#define ROMBIOS_START 0x000e0000 - /* layout vgabios */ { extern uint8_t v3_vgabios_start[]; @@ -62,26 +65,31 @@ static int post_config_pc(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) { memcpy(vgabios_dst, v3_vgabios_start, v3_vgabios_end - v3_vgabios_start); } +#endif + + /* layout rombios */ { extern uint8_t v3_rombios_start[]; extern uint8_t v3_rombios_end[]; void * rombios_dst = 0; - if (v3_gpa_to_hva(&(vm->cores[0]), ROMBIOS_START, (addr_t *)&rombios_dst) == -1) { + if (v3_gpa_to_hva(&(vm->cores[0]), V3_CONFIG_BIOS_START, (addr_t *)&rombios_dst) == -1) { PrintError(vm, VCORE_NONE, "Could not find ROMBIOS destination address\n"); return -1; } memcpy(rombios_dst, v3_rombios_start, v3_rombios_end - v3_rombios_start); - // SEABIOS gets mapped into end of 4GB region +#ifdef V3_CONFIG_SEABIOS + // SEABIOS is also mapped into end of 4GB region if (v3_add_shadow_mem(vm, V3_MEM_CORE_ANY, 0xfffe0000, 0xffffffff, (addr_t)V3_PAddr(rombios_dst)) == -1) { PrintError(vm, VCORE_NONE, "Error mapping SEABIOS to end of memory\n"); return -1; } +#endif }