diff --git a/bios/seabios-debug.config b/bios/seabios-debug.config index 53850099..0de83cd3 100644 --- a/bios/seabios-debug.config +++ b/bios/seabios-debug.config @@ -13,7 +13,8 @@ CONFIG_QEMU_HARDWARE=y CONFIG_XEN=y CONFIG_THREADS=y # CONFIG_RELOCATE_INIT is not set -# CONFIG_BOOTMENU is not set +CONFIG_BOOTMENU=y +# CONFIG_BOOTSPLASH is not set CONFIG_BOOTORDER=y CONFIG_HOST_BIOS_GEOMETRY=y CONFIG_ENTRY_EXTRASTACK=y diff --git a/bios/seabios.config b/bios/seabios.config index 6eb62b61..1e25cd04 100644 --- a/bios/seabios.config +++ b/bios/seabios.config @@ -13,7 +13,8 @@ CONFIG_QEMU_HARDWARE=y CONFIG_XEN=y CONFIG_THREADS=y # CONFIG_RELOCATE_INIT is not set -# CONFIG_BOOTMENU is not set +CONFIG_BOOTMENU=y +# CONFIG_BOOTSPLASH is not set CONFIG_BOOTORDER=y CONFIG_HOST_BIOS_GEOMETRY=y CONFIG_ENTRY_EXTRASTACK=y diff --git a/src/browser/starter.js b/src/browser/starter.js index cb1f769f..48154093 100644 --- a/src/browser/starter.js +++ b/src/browser/starter.js @@ -234,6 +234,7 @@ V86.prototype.continue_init = async function(emulator, options) settings.vga_memory_size = options.vga_memory_size || 8 * 1024 * 1024; settings.boot_order = boot_order; settings.fastboot = options.fastboot || false; + settings.bootmenu = options.bootmenu || false; settings.fda = undefined; settings.fdb = undefined; settings.uart1 = options.uart1; diff --git a/src/const.js b/src/const.js index a4a51020..a672ca47 100644 --- a/src/const.js +++ b/src/const.js @@ -118,6 +118,7 @@ export const FW_CFG_SIGNATURE = 0x00; export const FW_CFG_ID = 0x01; export const FW_CFG_RAM_SIZE = 0x03; export const FW_CFG_NB_CPUS = 0x05; +export const FW_CFG_BOOT_MENU = 0x0E; export const FW_CFG_MAX_CPUS = 0x0F; export const FW_CFG_NUMA = 0x0D; export const FW_CFG_FILE_DIR = 0x19; diff --git a/src/cpu.js b/src/cpu.js index 6306c04a..58451299 100644 --- a/src/cpu.js +++ b/src/cpu.js @@ -2,7 +2,7 @@ import { LOG_CPU, LOG_BIOS, FW_CFG_SIGNATURE, FW_CFG_SIGNATURE_QEMU, WASM_TABLE_SIZE, WASM_TABLE_OFFSET, FW_CFG_ID, - FW_CFG_RAM_SIZE, FW_CFG_NB_CPUS, FW_CFG_MAX_CPUS, + FW_CFG_RAM_SIZE, FW_CFG_NB_CPUS, FW_CFG_MAX_CPUS, FW_CFG_BOOT_MENU, FW_CFG_NUMA, FW_CFG_FILE_DIR, FW_CFG_FILE_START, FW_CFG_CUSTOM_START, FLAGS_DEFAULT, MMAP_BLOCK_BITS, MMAP_BLOCK_SIZE, MMAP_MAX, @@ -1107,6 +1107,10 @@ CPU.prototype.init = function(settings, device_bus) { this.fw_value = i32(1); } + else if(value === FW_CFG_BOOT_MENU) + { + this.fw_value = i32(+settings.bootmenu); + } else if(value === FW_CFG_NUMA) { this.fw_value = new Uint8Array(16); diff --git a/v86.d.ts b/v86.d.ts index 6918cfcf..5aa96489 100644 --- a/v86.d.ts +++ b/v86.d.ts @@ -563,6 +563,12 @@ export interface V86Options { */ fastboot?: boolean; + /** + * Enable the boot menu (seabios) + * @default false + */ + bootmenu?: boolean; + /** * Create a virtio balloon device * @default false