v86 0.5.442 → 0.5.443

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6136,6 +6136,7 @@ $V86$$module$src$browser$starter$$.prototype.continue_init = async function($emu
6136
6136
  $settings$$.vga_memory_size = $options$jscomp$46$$.vga_memory_size || 8388608;
6137
6137
  $settings$$.boot_order = $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$;
6138
6138
  $settings$$.fastboot = $options$jscomp$46$$.fastboot || !1;
6139
+ $settings$$.bootmenu = $options$jscomp$46$$.bootmenu || !1;
6139
6140
  $settings$$.fda = void 0;
6140
6141
  $settings$$.fdb = void 0;
6141
6142
  $settings$$.uart1 = $options$jscomp$46$$.uart1;
@@ -11811,19 +11812,19 @@ $CPU$$module$src$cpu$$.prototype.create_memory = function($size$jscomp$40$$, $me
11811
11812
  this.mem8 = $view$$module$src$lib$$(Uint8Array, this.wasm_memory, $memory_offset_minimum_size$$, $size$jscomp$40$$);
11812
11813
  this.mem32s = $view$$module$src$lib$$(Uint32Array, this.wasm_memory, $memory_offset_minimum_size$$, $size$jscomp$40$$ >> 2);
11813
11814
  };
11814
- $CPU$$module$src$cpu$$.prototype.init = function($option_rom$jscomp$1_settings$jscomp$2$$, $device_bus$$) {
11815
- this.create_memory($option_rom$jscomp$1_settings$jscomp$2$$.memory_size || 67108864, $option_rom$jscomp$1_settings$jscomp$2$$.initrd ? 67108864 : 1048576, );
11816
- $option_rom$jscomp$1_settings$jscomp$2$$.disable_jit && this.set_jit_config(0, 1);
11817
- $option_rom$jscomp$1_settings$jscomp$2$$.cpuid_level && this.set_cpuid_level($option_rom$jscomp$1_settings$jscomp$2$$.cpuid_level);
11818
- this.acpi_enabled[0] = +$option_rom$jscomp$1_settings$jscomp$2$$.acpi;
11815
+ $CPU$$module$src$cpu$$.prototype.init = function($settings$jscomp$2$$, $device_bus_option_rom$jscomp$1$$) {
11816
+ this.create_memory($settings$jscomp$2$$.memory_size || 67108864, $settings$jscomp$2$$.initrd ? 67108864 : 1048576, );
11817
+ $settings$jscomp$2$$.disable_jit && this.set_jit_config(0, 1);
11818
+ $settings$jscomp$2$$.cpuid_level && this.set_cpuid_level($settings$jscomp$2$$.cpuid_level);
11819
+ this.acpi_enabled[0] = +$settings$jscomp$2$$.acpi;
11819
11820
  this.reset_cpu();
11820
11821
  var $ide_config$jscomp$2_io$jscomp$6$$ = new $IO$$module$src$io$$(this);
11821
11822
  this.io = $ide_config$jscomp$2_io$jscomp$6$$;
11822
- this.bios.main = $option_rom$jscomp$1_settings$jscomp$2$$.bios;
11823
- this.bios.vga = $option_rom$jscomp$1_settings$jscomp$2$$.vga_bios;
11823
+ this.bios.main = $settings$jscomp$2$$.bios;
11824
+ this.bios.vga = $settings$jscomp$2$$.vga_bios;
11824
11825
  this.load_bios();
11825
- if ($option_rom$jscomp$1_settings$jscomp$2$$.bzimage) {
11826
- const $option_rom$$ = $load_kernel$$module$src$kernel$$(this.mem8, $option_rom$jscomp$1_settings$jscomp$2$$.bzimage, $option_rom$jscomp$1_settings$jscomp$2$$.initrd, $option_rom$jscomp$1_settings$jscomp$2$$.cmdline || "");
11826
+ if ($settings$jscomp$2$$.bzimage) {
11827
+ const $option_rom$$ = $load_kernel$$module$src$kernel$$(this.mem8, $settings$jscomp$2$$.bzimage, $settings$jscomp$2$$.initrd, $settings$jscomp$2$$.cmdline || "");
11827
11828
  $option_rom$$ && this.option_roms.push($option_rom$$);
11828
11829
  }
11829
11830
  $ide_config$jscomp$2_io$jscomp$6$$.register_read(179, this, function() {
@@ -11871,26 +11872,30 @@ $CPU$$module$src$cpu$$.prototype.init = function($option_rom$jscomp$1_settings$j
11871
11872
  if (15 === $buffer32_value$jscomp$193$$) {
11872
11873
  this.fw_value = $i32$$(1);
11873
11874
  } else {
11874
- if (13 === $buffer32_value$jscomp$193$$) {
11875
- this.fw_value = new Uint8Array(16);
11875
+ if (14 === $buffer32_value$jscomp$193$$) {
11876
+ this.fw_value = $i32$$(+$settings$jscomp$2$$.bootmenu);
11876
11877
  } else {
11877
- if (25 === $buffer32_value$jscomp$193$$) {
11878
- $buffer32_value$jscomp$193$$ = new Int32Array(4 + 64 * this.option_roms.length);
11879
- const $buffer8$$ = new Uint8Array($buffer32_value$jscomp$193$$.buffer);
11880
- $buffer32_value$jscomp$193$$[0] = $to_be32$$(this.option_roms.length);
11881
- for (let $i$jscomp$100$$ = 0; $i$jscomp$100$$ < this.option_roms.length; $i$jscomp$100$$++) {
11882
- const {name:$name$jscomp$108$$, data:$data$jscomp$226$$} = this.option_roms[$i$jscomp$100$$], $file_struct_ptr$$ = 4 + 64 * $i$jscomp$100$$;
11883
- $dbg_assert$$module$src$log$$(65536 > 49152 + $i$jscomp$100$$);
11884
- $buffer32_value$jscomp$193$$[$file_struct_ptr$$ + 0 >> 2] = $to_be32$$($data$jscomp$226$$.length);
11885
- $buffer32_value$jscomp$193$$[$file_struct_ptr$$ + 4 >> 2] = $to_be16$$(49152 + $i$jscomp$100$$);
11886
- $dbg_assert$$module$src$log$$(56 > $name$jscomp$108$$.length);
11887
- for (let $j$jscomp$11$$ = 0; $j$jscomp$11$$ < $name$jscomp$108$$.length; $j$jscomp$11$$++) {
11888
- $buffer8$$[$file_struct_ptr$$ + 8 + $j$jscomp$11$$] = $name$jscomp$108$$.charCodeAt($j$jscomp$11$$);
11878
+ if (13 === $buffer32_value$jscomp$193$$) {
11879
+ this.fw_value = new Uint8Array(16);
11880
+ } else {
11881
+ if (25 === $buffer32_value$jscomp$193$$) {
11882
+ $buffer32_value$jscomp$193$$ = new Int32Array(4 + 64 * this.option_roms.length);
11883
+ const $buffer8$$ = new Uint8Array($buffer32_value$jscomp$193$$.buffer);
11884
+ $buffer32_value$jscomp$193$$[0] = $to_be32$$(this.option_roms.length);
11885
+ for (let $i$jscomp$100$$ = 0; $i$jscomp$100$$ < this.option_roms.length; $i$jscomp$100$$++) {
11886
+ const {name:$name$jscomp$108$$, data:$data$jscomp$226$$} = this.option_roms[$i$jscomp$100$$], $file_struct_ptr$$ = 4 + 64 * $i$jscomp$100$$;
11887
+ $dbg_assert$$module$src$log$$(65536 > 49152 + $i$jscomp$100$$);
11888
+ $buffer32_value$jscomp$193$$[$file_struct_ptr$$ + 0 >> 2] = $to_be32$$($data$jscomp$226$$.length);
11889
+ $buffer32_value$jscomp$193$$[$file_struct_ptr$$ + 4 >> 2] = $to_be16$$(49152 + $i$jscomp$100$$);
11890
+ $dbg_assert$$module$src$log$$(56 > $name$jscomp$108$$.length);
11891
+ for (let $j$jscomp$11$$ = 0; $j$jscomp$11$$ < $name$jscomp$108$$.length; $j$jscomp$11$$++) {
11892
+ $buffer8$$[$file_struct_ptr$$ + 8 + $j$jscomp$11$$] = $name$jscomp$108$$.charCodeAt($j$jscomp$11$$);
11893
+ }
11889
11894
  }
11895
+ this.fw_value = $buffer8$$;
11896
+ } else {
11897
+ 32768 <= $buffer32_value$jscomp$193$$ && 49152 > $buffer32_value$jscomp$193$$ ? this.fw_value = $i32$$(0) : 49152 <= $buffer32_value$jscomp$193$$ && $buffer32_value$jscomp$193$$ - 49152 < this.option_roms.length ? this.fw_value = this.option_roms[$buffer32_value$jscomp$193$$ - 49152].data : ($dbg_log$$module$src$log$$("Warning: Unimplemented fw index: " + $h$$module$src$lib$$($buffer32_value$jscomp$193$$)), this.fw_value = $i32$$(0));
11890
11898
  }
11891
- this.fw_value = $buffer8$$;
11892
- } else {
11893
- 32768 <= $buffer32_value$jscomp$193$$ && 49152 > $buffer32_value$jscomp$193$$ ? this.fw_value = $i32$$(0) : 49152 <= $buffer32_value$jscomp$193$$ && $buffer32_value$jscomp$193$$ - 49152 < this.option_roms.length ? this.fw_value = this.option_roms[$buffer32_value$jscomp$193$$ - 49152].data : ($dbg_log$$module$src$log$$("Warning: Unimplemented fw index: " + $h$$module$src$lib$$($buffer32_value$jscomp$193$$)), this.fw_value = $i32$$(0));
11894
11899
  }
11895
11900
  }
11896
11901
  }
@@ -11907,16 +11912,14 @@ $CPU$$module$src$cpu$$.prototype.init = function($option_rom$jscomp$1_settings$j
11907
11912
  $ide_config$jscomp$2_io$jscomp$6$$.register_write(233, this, function() {
11908
11913
  });
11909
11914
  this.devices = {};
11910
- $option_rom$jscomp$1_settings$jscomp$2$$.load_devices && (this.devices.pci = new $PCI$$module$src$pci$$(this), this.acpi_enabled[0] && (this.devices.acpi = new $ACPI$$module$src$acpi$$(this)), this.devices.rtc = new $RTC$$module$src$rtc$$(this), this.fill_cmos(this.devices.rtc, $option_rom$jscomp$1_settings$jscomp$2$$), this.devices.dma = new $DMA$$module$src$dma$$(this), this.devices.vga = new $VGAScreen$$module$src$vga$$(this, $device_bus$$, $option_rom$jscomp$1_settings$jscomp$2$$.screen, $option_rom$jscomp$1_settings$jscomp$2$$.vga_memory_size ||
11911
- 8388608), this.devices.ps2 = new $PS2$$module$src$ps2$$(this, $device_bus$$), this.devices.vmware = new $VMwareMouse$$module$src$vmware$$(this, $device_bus$$), this.devices.uart0 = new $UART$$module$src$uart$$(this, 1016, $device_bus$$), this.devices.parallel0 = new $ParallelPort$$module$src$parallel$$(this, 888, 7, 0, $device_bus$$), $option_rom$jscomp$1_settings$jscomp$2$$.uart1 && (this.devices.uart1 = new $UART$$module$src$uart$$(this, 760, $device_bus$$)), $option_rom$jscomp$1_settings$jscomp$2$$.uart2 &&
11912
- (this.devices.uart2 = new $UART$$module$src$uart$$(this, 1E3, $device_bus$$)), $option_rom$jscomp$1_settings$jscomp$2$$.uart3 && (this.devices.uart3 = new $UART$$module$src$uart$$(this, 744, $device_bus$$)), $option_rom$jscomp$1_settings$jscomp$2$$.parallel1 && (this.devices.parallel1 = new $ParallelPort$$module$src$parallel$$(this, 632, 5, 1, $device_bus$$)), this.devices.fdc = new $FloppyController$$module$src$floppy$$(this, $option_rom$jscomp$1_settings$jscomp$2$$.fda, $option_rom$jscomp$1_settings$jscomp$2$$.fdb),
11913
- $ide_config$jscomp$2_io$jscomp$6$$ = [[void 0, void 0], [void 0, void 0]], $option_rom$jscomp$1_settings$jscomp$2$$.hda && ($ide_config$jscomp$2_io$jscomp$6$$[0][0] = {buffer:$option_rom$jscomp$1_settings$jscomp$2$$.hda}, $ide_config$jscomp$2_io$jscomp$6$$[0][1] = {buffer:$option_rom$jscomp$1_settings$jscomp$2$$.hdb}), $ide_config$jscomp$2_io$jscomp$6$$[1][0] = {is_cdrom:!0, buffer:$option_rom$jscomp$1_settings$jscomp$2$$.cdrom}, this.devices.ide = new $IDEController$$module$src$ide$$(this, $device_bus$$,
11914
- $ide_config$jscomp$2_io$jscomp$6$$), this.devices.cdrom = this.devices.ide.secondary.master, this.devices.pit = new $PIT$$module$src$pit$$(this, $device_bus$$), "ne2k" === $option_rom$jscomp$1_settings$jscomp$2$$.net_device.type ? this.devices.net = new $Ne2k$$module$src$ne2k$$(this, $device_bus$$, $option_rom$jscomp$1_settings$jscomp$2$$.preserve_mac_from_state_image, $option_rom$jscomp$1_settings$jscomp$2$$.mac_address_translation) : "virtio" === $option_rom$jscomp$1_settings$jscomp$2$$.net_device.type &&
11915
- (this.devices.virtio_net = new $VirtioNet$$module$src$virtio_net$$(this, $device_bus$$, $option_rom$jscomp$1_settings$jscomp$2$$.preserve_mac_from_state_image, $option_rom$jscomp$1_settings$jscomp$2$$.net_device.mtu)), $option_rom$jscomp$1_settings$jscomp$2$$.fs9p ? this.devices.virtio_9p = new $Virtio9p$$module$lib$9p$$($option_rom$jscomp$1_settings$jscomp$2$$.fs9p, this, $device_bus$$) : $option_rom$jscomp$1_settings$jscomp$2$$.handle9p ? this.devices.virtio_9p = new $Virtio9pHandler$$module$lib$9p$$($option_rom$jscomp$1_settings$jscomp$2$$.handle9p,
11916
- this) : $option_rom$jscomp$1_settings$jscomp$2$$.proxy9p && (this.devices.virtio_9p = new $Virtio9pProxy$$module$lib$9p$$($option_rom$jscomp$1_settings$jscomp$2$$.proxy9p, this)), $option_rom$jscomp$1_settings$jscomp$2$$.virtio_console && (this.devices.virtio_console = new $VirtioConsole$$module$src$virtio_console$$(this, $device_bus$$)), $option_rom$jscomp$1_settings$jscomp$2$$.virtio_balloon && (this.devices.virtio_balloon = new $VirtioBalloon$$module$src$virtio_balloon$$(this, $device_bus$$)),
11917
- this.devices.sb16 = new $SB16$$module$src$sb16$$(this, $device_bus$$));
11918
- $option_rom$jscomp$1_settings$jscomp$2$$.multiboot && ($dbg_log$$module$src$log$$("loading multiboot", 2), $option_rom$jscomp$1_settings$jscomp$2$$ = this.load_multiboot_option_rom($option_rom$jscomp$1_settings$jscomp$2$$.multiboot, $option_rom$jscomp$1_settings$jscomp$2$$.initrd, $option_rom$jscomp$1_settings$jscomp$2$$.cmdline)) && (this.bios.main ? ($dbg_log$$module$src$log$$("adding option rom for multiboot", 2), this.option_roms.push($option_rom$jscomp$1_settings$jscomp$2$$)) : ($dbg_log$$module$src$log$$("loaded multiboot without bios",
11919
- 2), this.reg32[0] = this.io.port_read32(244)));
11915
+ $settings$jscomp$2$$.load_devices && (this.devices.pci = new $PCI$$module$src$pci$$(this), this.acpi_enabled[0] && (this.devices.acpi = new $ACPI$$module$src$acpi$$(this)), this.devices.rtc = new $RTC$$module$src$rtc$$(this), this.fill_cmos(this.devices.rtc, $settings$jscomp$2$$), this.devices.dma = new $DMA$$module$src$dma$$(this), this.devices.vga = new $VGAScreen$$module$src$vga$$(this, $device_bus_option_rom$jscomp$1$$, $settings$jscomp$2$$.screen, $settings$jscomp$2$$.vga_memory_size || 8388608),
11916
+ this.devices.ps2 = new $PS2$$module$src$ps2$$(this, $device_bus_option_rom$jscomp$1$$), this.devices.vmware = new $VMwareMouse$$module$src$vmware$$(this, $device_bus_option_rom$jscomp$1$$), this.devices.uart0 = new $UART$$module$src$uart$$(this, 1016, $device_bus_option_rom$jscomp$1$$), this.devices.parallel0 = new $ParallelPort$$module$src$parallel$$(this, 888, 7, 0, $device_bus_option_rom$jscomp$1$$), $settings$jscomp$2$$.uart1 && (this.devices.uart1 = new $UART$$module$src$uart$$(this, 760,
11917
+ $device_bus_option_rom$jscomp$1$$)), $settings$jscomp$2$$.uart2 && (this.devices.uart2 = new $UART$$module$src$uart$$(this, 1E3, $device_bus_option_rom$jscomp$1$$)), $settings$jscomp$2$$.uart3 && (this.devices.uart3 = new $UART$$module$src$uart$$(this, 744, $device_bus_option_rom$jscomp$1$$)), $settings$jscomp$2$$.parallel1 && (this.devices.parallel1 = new $ParallelPort$$module$src$parallel$$(this, 632, 5, 1, $device_bus_option_rom$jscomp$1$$)), this.devices.fdc = new $FloppyController$$module$src$floppy$$(this,
11918
+ $settings$jscomp$2$$.fda, $settings$jscomp$2$$.fdb), $ide_config$jscomp$2_io$jscomp$6$$ = [[void 0, void 0], [void 0, void 0]], $settings$jscomp$2$$.hda && ($ide_config$jscomp$2_io$jscomp$6$$[0][0] = {buffer:$settings$jscomp$2$$.hda}, $ide_config$jscomp$2_io$jscomp$6$$[0][1] = {buffer:$settings$jscomp$2$$.hdb}), $ide_config$jscomp$2_io$jscomp$6$$[1][0] = {is_cdrom:!0, buffer:$settings$jscomp$2$$.cdrom}, this.devices.ide = new $IDEController$$module$src$ide$$(this, $device_bus_option_rom$jscomp$1$$,
11919
+ $ide_config$jscomp$2_io$jscomp$6$$), this.devices.cdrom = this.devices.ide.secondary.master, this.devices.pit = new $PIT$$module$src$pit$$(this, $device_bus_option_rom$jscomp$1$$), "ne2k" === $settings$jscomp$2$$.net_device.type ? this.devices.net = new $Ne2k$$module$src$ne2k$$(this, $device_bus_option_rom$jscomp$1$$, $settings$jscomp$2$$.preserve_mac_from_state_image, $settings$jscomp$2$$.mac_address_translation) : "virtio" === $settings$jscomp$2$$.net_device.type && (this.devices.virtio_net =
11920
+ new $VirtioNet$$module$src$virtio_net$$(this, $device_bus_option_rom$jscomp$1$$, $settings$jscomp$2$$.preserve_mac_from_state_image, $settings$jscomp$2$$.net_device.mtu)), $settings$jscomp$2$$.fs9p ? this.devices.virtio_9p = new $Virtio9p$$module$lib$9p$$($settings$jscomp$2$$.fs9p, this, $device_bus_option_rom$jscomp$1$$) : $settings$jscomp$2$$.handle9p ? this.devices.virtio_9p = new $Virtio9pHandler$$module$lib$9p$$($settings$jscomp$2$$.handle9p, this) : $settings$jscomp$2$$.proxy9p && (this.devices.virtio_9p =
11921
+ new $Virtio9pProxy$$module$lib$9p$$($settings$jscomp$2$$.proxy9p, this)), $settings$jscomp$2$$.virtio_console && (this.devices.virtio_console = new $VirtioConsole$$module$src$virtio_console$$(this, $device_bus_option_rom$jscomp$1$$)), $settings$jscomp$2$$.virtio_balloon && (this.devices.virtio_balloon = new $VirtioBalloon$$module$src$virtio_balloon$$(this, $device_bus_option_rom$jscomp$1$$)), this.devices.sb16 = new $SB16$$module$src$sb16$$(this, $device_bus_option_rom$jscomp$1$$));
11922
+ $settings$jscomp$2$$.multiboot && ($dbg_log$$module$src$log$$("loading multiboot", 2), $device_bus_option_rom$jscomp$1$$ = this.load_multiboot_option_rom($settings$jscomp$2$$.multiboot, $settings$jscomp$2$$.initrd, $settings$jscomp$2$$.cmdline)) && (this.bios.main ? ($dbg_log$$module$src$log$$("adding option rom for multiboot", 2), this.option_roms.push($device_bus_option_rom$jscomp$1$$)) : ($dbg_log$$module$src$log$$("loaded multiboot without bios", 2), this.reg32[0] = this.io.port_read32(244)));
11920
11923
  this.debug_init();
11921
11924
  };
11922
11925
  $CPU$$module$src$cpu$$.prototype.load_multiboot = function($buffer$jscomp$61$$) {
@@ -6135,6 +6135,7 @@ $V86$$module$src$browser$starter$$.prototype.continue_init = async function($emu
6135
6135
  $settings$$.vga_memory_size = $options$jscomp$46$$.vga_memory_size || 8388608;
6136
6136
  $settings$$.boot_order = $add_file_boot_order_fs_url_relay_url_screen_options_virtio_console_settings$$;
6137
6137
  $settings$$.fastboot = $options$jscomp$46$$.fastboot || !1;
6138
+ $settings$$.bootmenu = $options$jscomp$46$$.bootmenu || !1;
6138
6139
  $settings$$.fda = void 0;
6139
6140
  $settings$$.fdb = void 0;
6140
6141
  $settings$$.uart1 = $options$jscomp$46$$.uart1;
@@ -11810,19 +11811,19 @@ $CPU$$module$src$cpu$$.prototype.create_memory = function($size$jscomp$40$$, $me
11810
11811
  this.mem8 = $view$$module$src$lib$$(Uint8Array, this.wasm_memory, $memory_offset_minimum_size$$, $size$jscomp$40$$);
11811
11812
  this.mem32s = $view$$module$src$lib$$(Uint32Array, this.wasm_memory, $memory_offset_minimum_size$$, $size$jscomp$40$$ >> 2);
11812
11813
  };
11813
- $CPU$$module$src$cpu$$.prototype.init = function($option_rom$jscomp$1_settings$jscomp$2$$, $device_bus$$) {
11814
- this.create_memory($option_rom$jscomp$1_settings$jscomp$2$$.memory_size || 67108864, $option_rom$jscomp$1_settings$jscomp$2$$.initrd ? 67108864 : 1048576, );
11815
- $option_rom$jscomp$1_settings$jscomp$2$$.disable_jit && this.set_jit_config(0, 1);
11816
- $option_rom$jscomp$1_settings$jscomp$2$$.cpuid_level && this.set_cpuid_level($option_rom$jscomp$1_settings$jscomp$2$$.cpuid_level);
11817
- this.acpi_enabled[0] = +$option_rom$jscomp$1_settings$jscomp$2$$.acpi;
11814
+ $CPU$$module$src$cpu$$.prototype.init = function($settings$jscomp$2$$, $device_bus_option_rom$jscomp$1$$) {
11815
+ this.create_memory($settings$jscomp$2$$.memory_size || 67108864, $settings$jscomp$2$$.initrd ? 67108864 : 1048576, );
11816
+ $settings$jscomp$2$$.disable_jit && this.set_jit_config(0, 1);
11817
+ $settings$jscomp$2$$.cpuid_level && this.set_cpuid_level($settings$jscomp$2$$.cpuid_level);
11818
+ this.acpi_enabled[0] = +$settings$jscomp$2$$.acpi;
11818
11819
  this.reset_cpu();
11819
11820
  var $ide_config$jscomp$2_io$jscomp$6$$ = new $IO$$module$src$io$$(this);
11820
11821
  this.io = $ide_config$jscomp$2_io$jscomp$6$$;
11821
- this.bios.main = $option_rom$jscomp$1_settings$jscomp$2$$.bios;
11822
- this.bios.vga = $option_rom$jscomp$1_settings$jscomp$2$$.vga_bios;
11822
+ this.bios.main = $settings$jscomp$2$$.bios;
11823
+ this.bios.vga = $settings$jscomp$2$$.vga_bios;
11823
11824
  this.load_bios();
11824
- if ($option_rom$jscomp$1_settings$jscomp$2$$.bzimage) {
11825
- const $option_rom$$ = $load_kernel$$module$src$kernel$$(this.mem8, $option_rom$jscomp$1_settings$jscomp$2$$.bzimage, $option_rom$jscomp$1_settings$jscomp$2$$.initrd, $option_rom$jscomp$1_settings$jscomp$2$$.cmdline || "");
11825
+ if ($settings$jscomp$2$$.bzimage) {
11826
+ const $option_rom$$ = $load_kernel$$module$src$kernel$$(this.mem8, $settings$jscomp$2$$.bzimage, $settings$jscomp$2$$.initrd, $settings$jscomp$2$$.cmdline || "");
11826
11827
  $option_rom$$ && this.option_roms.push($option_rom$$);
11827
11828
  }
11828
11829
  $ide_config$jscomp$2_io$jscomp$6$$.register_read(179, this, function() {
@@ -11870,26 +11871,30 @@ $CPU$$module$src$cpu$$.prototype.init = function($option_rom$jscomp$1_settings$j
11870
11871
  if (15 === $buffer32_value$jscomp$193$$) {
11871
11872
  this.fw_value = $i32$$(1);
11872
11873
  } else {
11873
- if (13 === $buffer32_value$jscomp$193$$) {
11874
- this.fw_value = new Uint8Array(16);
11874
+ if (14 === $buffer32_value$jscomp$193$$) {
11875
+ this.fw_value = $i32$$(+$settings$jscomp$2$$.bootmenu);
11875
11876
  } else {
11876
- if (25 === $buffer32_value$jscomp$193$$) {
11877
- $buffer32_value$jscomp$193$$ = new Int32Array(4 + 64 * this.option_roms.length);
11878
- const $buffer8$$ = new Uint8Array($buffer32_value$jscomp$193$$.buffer);
11879
- $buffer32_value$jscomp$193$$[0] = $to_be32$$(this.option_roms.length);
11880
- for (let $i$jscomp$100$$ = 0; $i$jscomp$100$$ < this.option_roms.length; $i$jscomp$100$$++) {
11881
- const {name:$name$jscomp$108$$, data:$data$jscomp$226$$} = this.option_roms[$i$jscomp$100$$], $file_struct_ptr$$ = 4 + 64 * $i$jscomp$100$$;
11882
- $dbg_assert$$module$src$log$$(65536 > 49152 + $i$jscomp$100$$);
11883
- $buffer32_value$jscomp$193$$[$file_struct_ptr$$ + 0 >> 2] = $to_be32$$($data$jscomp$226$$.length);
11884
- $buffer32_value$jscomp$193$$[$file_struct_ptr$$ + 4 >> 2] = $to_be16$$(49152 + $i$jscomp$100$$);
11885
- $dbg_assert$$module$src$log$$(56 > $name$jscomp$108$$.length);
11886
- for (let $j$jscomp$11$$ = 0; $j$jscomp$11$$ < $name$jscomp$108$$.length; $j$jscomp$11$$++) {
11887
- $buffer8$$[$file_struct_ptr$$ + 8 + $j$jscomp$11$$] = $name$jscomp$108$$.charCodeAt($j$jscomp$11$$);
11877
+ if (13 === $buffer32_value$jscomp$193$$) {
11878
+ this.fw_value = new Uint8Array(16);
11879
+ } else {
11880
+ if (25 === $buffer32_value$jscomp$193$$) {
11881
+ $buffer32_value$jscomp$193$$ = new Int32Array(4 + 64 * this.option_roms.length);
11882
+ const $buffer8$$ = new Uint8Array($buffer32_value$jscomp$193$$.buffer);
11883
+ $buffer32_value$jscomp$193$$[0] = $to_be32$$(this.option_roms.length);
11884
+ for (let $i$jscomp$100$$ = 0; $i$jscomp$100$$ < this.option_roms.length; $i$jscomp$100$$++) {
11885
+ const {name:$name$jscomp$108$$, data:$data$jscomp$226$$} = this.option_roms[$i$jscomp$100$$], $file_struct_ptr$$ = 4 + 64 * $i$jscomp$100$$;
11886
+ $dbg_assert$$module$src$log$$(65536 > 49152 + $i$jscomp$100$$);
11887
+ $buffer32_value$jscomp$193$$[$file_struct_ptr$$ + 0 >> 2] = $to_be32$$($data$jscomp$226$$.length);
11888
+ $buffer32_value$jscomp$193$$[$file_struct_ptr$$ + 4 >> 2] = $to_be16$$(49152 + $i$jscomp$100$$);
11889
+ $dbg_assert$$module$src$log$$(56 > $name$jscomp$108$$.length);
11890
+ for (let $j$jscomp$11$$ = 0; $j$jscomp$11$$ < $name$jscomp$108$$.length; $j$jscomp$11$$++) {
11891
+ $buffer8$$[$file_struct_ptr$$ + 8 + $j$jscomp$11$$] = $name$jscomp$108$$.charCodeAt($j$jscomp$11$$);
11892
+ }
11888
11893
  }
11894
+ this.fw_value = $buffer8$$;
11895
+ } else {
11896
+ 32768 <= $buffer32_value$jscomp$193$$ && 49152 > $buffer32_value$jscomp$193$$ ? this.fw_value = $i32$$(0) : 49152 <= $buffer32_value$jscomp$193$$ && $buffer32_value$jscomp$193$$ - 49152 < this.option_roms.length ? this.fw_value = this.option_roms[$buffer32_value$jscomp$193$$ - 49152].data : ($dbg_log$$module$src$log$$("Warning: Unimplemented fw index: " + $h$$module$src$lib$$($buffer32_value$jscomp$193$$)), this.fw_value = $i32$$(0));
11889
11897
  }
11890
- this.fw_value = $buffer8$$;
11891
- } else {
11892
- 32768 <= $buffer32_value$jscomp$193$$ && 49152 > $buffer32_value$jscomp$193$$ ? this.fw_value = $i32$$(0) : 49152 <= $buffer32_value$jscomp$193$$ && $buffer32_value$jscomp$193$$ - 49152 < this.option_roms.length ? this.fw_value = this.option_roms[$buffer32_value$jscomp$193$$ - 49152].data : ($dbg_log$$module$src$log$$("Warning: Unimplemented fw index: " + $h$$module$src$lib$$($buffer32_value$jscomp$193$$)), this.fw_value = $i32$$(0));
11893
11898
  }
11894
11899
  }
11895
11900
  }
@@ -11906,16 +11911,14 @@ $CPU$$module$src$cpu$$.prototype.init = function($option_rom$jscomp$1_settings$j
11906
11911
  $ide_config$jscomp$2_io$jscomp$6$$.register_write(233, this, function() {
11907
11912
  });
11908
11913
  this.devices = {};
11909
- $option_rom$jscomp$1_settings$jscomp$2$$.load_devices && (this.devices.pci = new $PCI$$module$src$pci$$(this), this.acpi_enabled[0] && (this.devices.acpi = new $ACPI$$module$src$acpi$$(this)), this.devices.rtc = new $RTC$$module$src$rtc$$(this), this.fill_cmos(this.devices.rtc, $option_rom$jscomp$1_settings$jscomp$2$$), this.devices.dma = new $DMA$$module$src$dma$$(this), this.devices.vga = new $VGAScreen$$module$src$vga$$(this, $device_bus$$, $option_rom$jscomp$1_settings$jscomp$2$$.screen, $option_rom$jscomp$1_settings$jscomp$2$$.vga_memory_size ||
11910
- 8388608), this.devices.ps2 = new $PS2$$module$src$ps2$$(this, $device_bus$$), this.devices.vmware = new $VMwareMouse$$module$src$vmware$$(this, $device_bus$$), this.devices.uart0 = new $UART$$module$src$uart$$(this, 1016, $device_bus$$), this.devices.parallel0 = new $ParallelPort$$module$src$parallel$$(this, 888, 7, 0, $device_bus$$), $option_rom$jscomp$1_settings$jscomp$2$$.uart1 && (this.devices.uart1 = new $UART$$module$src$uart$$(this, 760, $device_bus$$)), $option_rom$jscomp$1_settings$jscomp$2$$.uart2 &&
11911
- (this.devices.uart2 = new $UART$$module$src$uart$$(this, 1E3, $device_bus$$)), $option_rom$jscomp$1_settings$jscomp$2$$.uart3 && (this.devices.uart3 = new $UART$$module$src$uart$$(this, 744, $device_bus$$)), $option_rom$jscomp$1_settings$jscomp$2$$.parallel1 && (this.devices.parallel1 = new $ParallelPort$$module$src$parallel$$(this, 632, 5, 1, $device_bus$$)), this.devices.fdc = new $FloppyController$$module$src$floppy$$(this, $option_rom$jscomp$1_settings$jscomp$2$$.fda, $option_rom$jscomp$1_settings$jscomp$2$$.fdb),
11912
- $ide_config$jscomp$2_io$jscomp$6$$ = [[void 0, void 0], [void 0, void 0]], $option_rom$jscomp$1_settings$jscomp$2$$.hda && ($ide_config$jscomp$2_io$jscomp$6$$[0][0] = {buffer:$option_rom$jscomp$1_settings$jscomp$2$$.hda}, $ide_config$jscomp$2_io$jscomp$6$$[0][1] = {buffer:$option_rom$jscomp$1_settings$jscomp$2$$.hdb}), $ide_config$jscomp$2_io$jscomp$6$$[1][0] = {is_cdrom:!0, buffer:$option_rom$jscomp$1_settings$jscomp$2$$.cdrom}, this.devices.ide = new $IDEController$$module$src$ide$$(this, $device_bus$$,
11913
- $ide_config$jscomp$2_io$jscomp$6$$), this.devices.cdrom = this.devices.ide.secondary.master, this.devices.pit = new $PIT$$module$src$pit$$(this, $device_bus$$), "ne2k" === $option_rom$jscomp$1_settings$jscomp$2$$.net_device.type ? this.devices.net = new $Ne2k$$module$src$ne2k$$(this, $device_bus$$, $option_rom$jscomp$1_settings$jscomp$2$$.preserve_mac_from_state_image, $option_rom$jscomp$1_settings$jscomp$2$$.mac_address_translation) : "virtio" === $option_rom$jscomp$1_settings$jscomp$2$$.net_device.type &&
11914
- (this.devices.virtio_net = new $VirtioNet$$module$src$virtio_net$$(this, $device_bus$$, $option_rom$jscomp$1_settings$jscomp$2$$.preserve_mac_from_state_image, $option_rom$jscomp$1_settings$jscomp$2$$.net_device.mtu)), $option_rom$jscomp$1_settings$jscomp$2$$.fs9p ? this.devices.virtio_9p = new $Virtio9p$$module$lib$9p$$($option_rom$jscomp$1_settings$jscomp$2$$.fs9p, this, $device_bus$$) : $option_rom$jscomp$1_settings$jscomp$2$$.handle9p ? this.devices.virtio_9p = new $Virtio9pHandler$$module$lib$9p$$($option_rom$jscomp$1_settings$jscomp$2$$.handle9p,
11915
- this) : $option_rom$jscomp$1_settings$jscomp$2$$.proxy9p && (this.devices.virtio_9p = new $Virtio9pProxy$$module$lib$9p$$($option_rom$jscomp$1_settings$jscomp$2$$.proxy9p, this)), $option_rom$jscomp$1_settings$jscomp$2$$.virtio_console && (this.devices.virtio_console = new $VirtioConsole$$module$src$virtio_console$$(this, $device_bus$$)), $option_rom$jscomp$1_settings$jscomp$2$$.virtio_balloon && (this.devices.virtio_balloon = new $VirtioBalloon$$module$src$virtio_balloon$$(this, $device_bus$$)),
11916
- this.devices.sb16 = new $SB16$$module$src$sb16$$(this, $device_bus$$));
11917
- $option_rom$jscomp$1_settings$jscomp$2$$.multiboot && ($dbg_log$$module$src$log$$("loading multiboot", 2), $option_rom$jscomp$1_settings$jscomp$2$$ = this.load_multiboot_option_rom($option_rom$jscomp$1_settings$jscomp$2$$.multiboot, $option_rom$jscomp$1_settings$jscomp$2$$.initrd, $option_rom$jscomp$1_settings$jscomp$2$$.cmdline)) && (this.bios.main ? ($dbg_log$$module$src$log$$("adding option rom for multiboot", 2), this.option_roms.push($option_rom$jscomp$1_settings$jscomp$2$$)) : ($dbg_log$$module$src$log$$("loaded multiboot without bios",
11918
- 2), this.reg32[0] = this.io.port_read32(244)));
11914
+ $settings$jscomp$2$$.load_devices && (this.devices.pci = new $PCI$$module$src$pci$$(this), this.acpi_enabled[0] && (this.devices.acpi = new $ACPI$$module$src$acpi$$(this)), this.devices.rtc = new $RTC$$module$src$rtc$$(this), this.fill_cmos(this.devices.rtc, $settings$jscomp$2$$), this.devices.dma = new $DMA$$module$src$dma$$(this), this.devices.vga = new $VGAScreen$$module$src$vga$$(this, $device_bus_option_rom$jscomp$1$$, $settings$jscomp$2$$.screen, $settings$jscomp$2$$.vga_memory_size || 8388608),
11915
+ this.devices.ps2 = new $PS2$$module$src$ps2$$(this, $device_bus_option_rom$jscomp$1$$), this.devices.vmware = new $VMwareMouse$$module$src$vmware$$(this, $device_bus_option_rom$jscomp$1$$), this.devices.uart0 = new $UART$$module$src$uart$$(this, 1016, $device_bus_option_rom$jscomp$1$$), this.devices.parallel0 = new $ParallelPort$$module$src$parallel$$(this, 888, 7, 0, $device_bus_option_rom$jscomp$1$$), $settings$jscomp$2$$.uart1 && (this.devices.uart1 = new $UART$$module$src$uart$$(this, 760,
11916
+ $device_bus_option_rom$jscomp$1$$)), $settings$jscomp$2$$.uart2 && (this.devices.uart2 = new $UART$$module$src$uart$$(this, 1E3, $device_bus_option_rom$jscomp$1$$)), $settings$jscomp$2$$.uart3 && (this.devices.uart3 = new $UART$$module$src$uart$$(this, 744, $device_bus_option_rom$jscomp$1$$)), $settings$jscomp$2$$.parallel1 && (this.devices.parallel1 = new $ParallelPort$$module$src$parallel$$(this, 632, 5, 1, $device_bus_option_rom$jscomp$1$$)), this.devices.fdc = new $FloppyController$$module$src$floppy$$(this,
11917
+ $settings$jscomp$2$$.fda, $settings$jscomp$2$$.fdb), $ide_config$jscomp$2_io$jscomp$6$$ = [[void 0, void 0], [void 0, void 0]], $settings$jscomp$2$$.hda && ($ide_config$jscomp$2_io$jscomp$6$$[0][0] = {buffer:$settings$jscomp$2$$.hda}, $ide_config$jscomp$2_io$jscomp$6$$[0][1] = {buffer:$settings$jscomp$2$$.hdb}), $ide_config$jscomp$2_io$jscomp$6$$[1][0] = {is_cdrom:!0, buffer:$settings$jscomp$2$$.cdrom}, this.devices.ide = new $IDEController$$module$src$ide$$(this, $device_bus_option_rom$jscomp$1$$,
11918
+ $ide_config$jscomp$2_io$jscomp$6$$), this.devices.cdrom = this.devices.ide.secondary.master, this.devices.pit = new $PIT$$module$src$pit$$(this, $device_bus_option_rom$jscomp$1$$), "ne2k" === $settings$jscomp$2$$.net_device.type ? this.devices.net = new $Ne2k$$module$src$ne2k$$(this, $device_bus_option_rom$jscomp$1$$, $settings$jscomp$2$$.preserve_mac_from_state_image, $settings$jscomp$2$$.mac_address_translation) : "virtio" === $settings$jscomp$2$$.net_device.type && (this.devices.virtio_net =
11919
+ new $VirtioNet$$module$src$virtio_net$$(this, $device_bus_option_rom$jscomp$1$$, $settings$jscomp$2$$.preserve_mac_from_state_image, $settings$jscomp$2$$.net_device.mtu)), $settings$jscomp$2$$.fs9p ? this.devices.virtio_9p = new $Virtio9p$$module$lib$9p$$($settings$jscomp$2$$.fs9p, this, $device_bus_option_rom$jscomp$1$$) : $settings$jscomp$2$$.handle9p ? this.devices.virtio_9p = new $Virtio9pHandler$$module$lib$9p$$($settings$jscomp$2$$.handle9p, this) : $settings$jscomp$2$$.proxy9p && (this.devices.virtio_9p =
11920
+ new $Virtio9pProxy$$module$lib$9p$$($settings$jscomp$2$$.proxy9p, this)), $settings$jscomp$2$$.virtio_console && (this.devices.virtio_console = new $VirtioConsole$$module$src$virtio_console$$(this, $device_bus_option_rom$jscomp$1$$)), $settings$jscomp$2$$.virtio_balloon && (this.devices.virtio_balloon = new $VirtioBalloon$$module$src$virtio_balloon$$(this, $device_bus_option_rom$jscomp$1$$)), this.devices.sb16 = new $SB16$$module$src$sb16$$(this, $device_bus_option_rom$jscomp$1$$));
11921
+ $settings$jscomp$2$$.multiboot && ($dbg_log$$module$src$log$$("loading multiboot", 2), $device_bus_option_rom$jscomp$1$$ = this.load_multiboot_option_rom($settings$jscomp$2$$.multiboot, $settings$jscomp$2$$.initrd, $settings$jscomp$2$$.cmdline)) && (this.bios.main ? ($dbg_log$$module$src$log$$("adding option rom for multiboot", 2), this.option_roms.push($device_bus_option_rom$jscomp$1$$)) : ($dbg_log$$module$src$log$$("loaded multiboot without bios", 2), this.reg32[0] = this.io.port_read32(244)));
11919
11922
  this.debug_init();
11920
11923
  };
11921
11924
  $CPU$$module$src$cpu$$.prototype.load_multiboot = function($buffer$jscomp$61$$) {
package/build/libv86.js CHANGED
@@ -341,9 +341,9 @@ g=>new Promise(h=>{let m="v86.wasm",l="v86-fallback.wasm";a.wasm_path?(m=a.wasm_
341
341
  Q.prototype.continue_init=async function(a,b){function c(q,r){switch(q){case "hda":e.hda=r;break;case "hdb":e.hdb=r;break;case "cdrom":e.cdrom=r;break;case "fda":e.fda=r;break;case "fdb":e.fdb=r;break;case "multiboot":e.multiboot=r.buffer;break;case "bzimage":e.bzimage=r.buffer;break;case "initrd":e.initrd=r.buffer;break;case "bios":e.bios=r.buffer;break;case "vga_bios":e.vga_bios=r.buffer;break;case "initial_state":e.initial_state=r.buffer;break;case "fs9p_json":e.fs9p_json=r}}async function d(){if(e.fs9p&&
342
342
  e.fs9p_json&&!e.initial_state&&(e.fs9p.load_from_json(e.fs9p_json),b.bzimage_initrd_from_filesystem)){const {bzimage_path:q,initrd_path:r}=this.get_bzimage_initrd_from_filesystem(e.fs9p),[x,E]=await Promise.all([e.fs9p.read_file(r),e.fs9p.read_file(q)]);c.call(this,"initrd",new z(x.buffer));c.call(this,"bzimage",new z(E.buffer))}this.serial_adapter&&this.serial_adapter.show&&this.serial_adapter.show();this.virtio_console_adapter&&this.virtio_console_adapter.show&&this.virtio_console_adapter.show();
343
343
  this.v86.init(e);this.modem&&this.modem.initialize();e.initial_state&&(a.restore_state(e.initial_state),e.initial_state=void 0);b.autostart&&this.v86.run();this.emulator_bus.send("emulator-loaded")}this.bus.register("emulator-stopped",function(){this.cpu_is_running=!1;this.screen_adapter.pause()},this);this.bus.register("emulator-started",function(){this.cpu_is_running=!0;this.screen_adapter.continue()},this);var e={},f=b.boot_order?b.boot_order:b.fda?801:b.hda?786:291;if(b.modem)switch(e.modem=b.modem,
344
- b.modem.uart){case 1:b.uart1=!0;break;case 2:b.uart2=!0;break;case 3:b.uart3=!0}e.acpi=b.acpi;e.disable_jit=b.disable_jit;e.load_devices=!0;e.memory_size=b.memory_size||67108864;e.vga_memory_size=b.vga_memory_size||8388608;e.boot_order=f;e.fastboot=b.fastboot||!1;e.fda=void 0;e.fdb=void 0;e.uart1=b.uart1;e.uart2=b.uart2;e.uart3=b.uart3;e.parallel1=b.parallel1;e.cmdline=b.cmdline;e.preserve_mac_from_state_image=b.preserve_mac_from_state_image;e.mac_address_translation=b.mac_address_translation;e.cpuid_level=
345
- b.cpuid_level;e.virtio_balloon=b.virtio_balloon;e.virtio_console=!!b.virtio_console;if(f=b.network_relay_url||b.net_device&&b.net_device.relay_url)"fetch"===f?this.network_adapter=new Xb(this.bus,b.net_device):"inbrowser"===f?this.network_adapter=new rc(this.bus,b.net_device):f.startsWith("wisp://")||f.startsWith("wisps://")?this.network_adapter=new $b(f,this.bus,b.net_device):this.network_adapter=new pb(f,this.bus);e.net_device=b.net_device||{type:"ne2k"};f=b.screen||{};b.screen_container&&(f.container=
346
- b.screen_container);b.disable_keyboard||(this.keyboard_adapter=new bc(this.bus));b.disable_mouse||(this.mouse_adapter=new cc(this.bus,f.container));this.absolute_pointer_enabled=!1;this.bus.register("vmware-absolute-mouse",function(q){q&&!this.absolute_pointer_enabled&&"undefined"!==typeof document&&document.pointerLockElement&&document.exitPointerLock();this.absolute_pointer_enabled=q},this);this.screen_adapter=f.container?new va(f,()=>this.v86.cpu.devices.vga&&this.v86.cpu.devices.vga.screen_fill_buffer()):
344
+ b.modem.uart){case 1:b.uart1=!0;break;case 2:b.uart2=!0;break;case 3:b.uart3=!0}e.acpi=b.acpi;e.disable_jit=b.disable_jit;e.load_devices=!0;e.memory_size=b.memory_size||67108864;e.vga_memory_size=b.vga_memory_size||8388608;e.boot_order=f;e.fastboot=b.fastboot||!1;e.bootmenu=b.bootmenu||!1;e.fda=void 0;e.fdb=void 0;e.uart1=b.uart1;e.uart2=b.uart2;e.uart3=b.uart3;e.parallel1=b.parallel1;e.cmdline=b.cmdline;e.preserve_mac_from_state_image=b.preserve_mac_from_state_image;e.mac_address_translation=b.mac_address_translation;
345
+ e.cpuid_level=b.cpuid_level;e.virtio_balloon=b.virtio_balloon;e.virtio_console=!!b.virtio_console;if(f=b.network_relay_url||b.net_device&&b.net_device.relay_url)"fetch"===f?this.network_adapter=new Xb(this.bus,b.net_device):"inbrowser"===f?this.network_adapter=new rc(this.bus,b.net_device):f.startsWith("wisp://")||f.startsWith("wisps://")?this.network_adapter=new $b(f,this.bus,b.net_device):this.network_adapter=new pb(f,this.bus);e.net_device=b.net_device||{type:"ne2k"};f=b.screen||{};b.screen_container&&
346
+ (f.container=b.screen_container);b.disable_keyboard||(this.keyboard_adapter=new bc(this.bus));b.disable_mouse||(this.mouse_adapter=new cc(this.bus,f.container));this.absolute_pointer_enabled=!1;this.bus.register("vmware-absolute-mouse",function(q){q&&!this.absolute_pointer_enabled&&"undefined"!==typeof document&&document.pointerLockElement&&document.exitPointerLock();this.absolute_pointer_enabled=q},this);this.screen_adapter=f.container?new va(f,()=>this.v86.cpu.devices.vga&&this.v86.cpu.devices.vga.screen_fill_buffer()):
347
347
  f.ansi?new ec(f):new dc(f);e.screen=this.screen_adapter;e.screen_options=f;e.serial_console=b.serial_console||{type:"none"};b.serial_container_xtermjs?(e.serial_console.type="xtermjs",e.serial_console.container=b.serial_container_xtermjs):b.serial_container&&(e.serial_console.type="textarea",e.serial_console.container=b.serial_container);"xtermjs"===e.serial_console?.type?this.serial_adapter=new pc(e.serial_console.container,this.bus,e.serial_console.xterm_lib||window.Terminal):"textarea"===e.serial_console?.type&&
348
348
  (this.serial_adapter=new gc(e.serial_console.container,this.bus));f=b.virtio_console&&"boolean"===typeof b.virtio_console?{type:"none"}:b.virtio_console;"xtermjs"===f?.type?this.virtio_console_adapter=new qc(f.container,this.bus,f.xterm_lib||window.Terminal):"textarea"===f?.type&&(this.virtio_console_adapter=new hc(f.container,this.bus));e.modem&&(this.modem=new H(this.bus,e.modem));b.disable_speaker||(this.speaker_adapter=new jb(this.bus));var g=[];f=(q,r)=>{if(r)if(r.get&&r.set&&r.load)g.push({name:q,
349
349
  loadable:r});else{if("bios"===q||"vga_bios"===q||"initial_state"===q||"multiboot"===q||"bzimage"===q||"initrd"===q)r.async=!1;if("fda"===q||"fdb"===q)r.async=!1;r.url&&!r.async?g.push({name:q,url:r.url,size:r.size}):g.push({name:q,loadable:Da(r,this.zstd_decompress_worker.bind(this))})}};b.state&&console.warn("Warning: Unknown option 'state'. Did you mean 'initial_state'?");f("bios",b.bios);f("vga_bios",b.vga_bios);f("cdrom",b.cdrom);f("hda",b.hda);f("hdb",b.hdb);f("fda",b.fda);f("fdb",b.fdb);f("initial_state",
@@ -704,11 +704,12 @@ S.prototype.reboot_internal=function(){this.reset_cpu();this.fw_value=[];this.de
704
704
  S.prototype.create_memory=function(a,b){a<b?a=b:0>(a|0)&&(a=Math.pow(2,31)-131072);a=(a-1|131071)+1|0;console.assert(0===this.memory_size[0],"Expected uninitialised memory");this.memory_size[0]=a;b=this.allocate_memory(a);this.mem8=k(Uint8Array,this.wasm_memory,b,a);this.mem32s=k(Uint32Array,this.wasm_memory,b,a>>2)};
705
705
  S.prototype.init=function(a,b){this.create_memory(a.memory_size||67108864,a.initrd?67108864:1048576);a.disable_jit&&this.set_jit_config(0,1);a.cpuid_level&&this.set_cpuid_level(a.cpuid_level);this.acpi_enabled[0]=+a.acpi;this.reset_cpu();var c=new Ea(this);this.io=c;this.bios.main=a.bios;this.bios.vga=a.vga_bios;this.load_bios();if(a.bzimage){const e=kd(this.mem8,a.bzimage,a.initrd,a.cmdline||"");e&&this.option_roms.push(e)}c.register_read(179,this,function(){return 0});var d=0;c.register_read(146,
706
706
  this,function(){return d});c.register_write(146,this,function(e){d=e});c.register_read(1297,this,function(){return this.fw_pointer<this.fw_value.length?this.fw_value[this.fw_pointer++]:0});c.register_write(1296,this,void 0,function(e){function f(m){return new Uint8Array(Int32Array.of(m).buffer)}function g(m){return m>>8|m<<8&65280}function h(m){return m<<24|m<<8&16711680|m>>8&65280|m>>>24}sa("bios config port, index="+y(e));this.fw_pointer=0;if(0===e)this.fw_value=f(1431127377);else if(1===e)this.fw_value=
707
- f(0);else if(3===e)this.fw_value=new Uint8Array(Int32Array.of(this.memory_size[0],0).buffer);else if(5===e)this.fw_value=f(1);else if(15===e)this.fw_value=f(1);else if(13===e)this.fw_value=new Uint8Array(16);else if(25===e){e=new Int32Array(4+64*this.option_roms.length);const m=new Uint8Array(e.buffer);e[0]=h(this.option_roms.length);for(let l=0;l<this.option_roms.length;l++){const {name:n,data:p}=this.option_roms[l],q=4+64*l;e[q+0>>2]=h(p.length);e[q+4>>2]=g(49152+l);for(let r=0;r<n.length;r++)m[q+
708
- 8+r]=n.charCodeAt(r)}this.fw_value=m}else 32768<=e&&49152>e?this.fw_value=f(0):49152<=e&&e-49152<this.option_roms.length?this.fw_value=this.option_roms[e-49152].data:(sa("Warning: Unimplemented fw index: "+y(e)),this.fw_value=f(0))});this.devices={};a.load_devices&&(this.devices.pci=new Jc(this),this.acpi_enabled[0]&&(this.devices.acpi=new Gc(this)),this.devices.rtc=new hb(this),this.fill_cmos(this.devices.rtc,a),this.devices.dma=new A(this),this.devices.vga=new Y(this,b,a.screen,a.vga_memory_size||
709
- 8388608),this.devices.ps2=new Pc(this,b),this.devices.vmware=new Qc(this,b),this.devices.uart0=new Hc(this,1016,b),this.devices.parallel0=new Ic(this,888,7,0,b),a.uart1&&(this.devices.uart1=new Hc(this,760,b)),a.uart2&&(this.devices.uart2=new Hc(this,1E3,b)),a.uart3&&(this.devices.uart3=new Hc(this,744,b)),a.parallel1&&(this.devices.parallel1=new Ic(this,632,5,1,b)),this.devices.fdc=new W(this,a.fda,a.fdb),c=[[void 0,void 0],[void 0,void 0]],a.hda&&(c[0][0]={buffer:a.hda},c[0][1]={buffer:a.hdb}),
710
- c[1][0]={is_cdrom:!0,buffer:a.cdrom},this.devices.ide=new dd(this,b,c),this.devices.cdrom=this.devices.ide.secondary.master,this.devices.pit=new ib(this,b),"ne2k"===a.net_device.type?this.devices.net=new Mc(this,b,a.preserve_mac_from_state_image,a.mac_address_translation):"virtio"===a.net_device.type&&(this.devices.virtio_net=new fd(this,b,a.preserve_mac_from_state_image,a.net_device.mtu)),a.fs9p?this.devices.virtio_9p=new ld(a.fs9p,this,b):a.handle9p?this.devices.virtio_9p=new md(a.handle9p,this):
711
- a.proxy9p&&(this.devices.virtio_9p=new nd(a.proxy9p,this)),a.virtio_console&&(this.devices.virtio_console=new Nc(this,b)),a.virtio_balloon&&(this.devices.virtio_balloon=new jd(this,b)),this.devices.sb16=new D(this,b));a.multiboot&&(a=this.load_multiboot_option_rom(a.multiboot,a.initrd,a.cmdline))&&(this.bios.main?this.option_roms.push(a):this.reg32[0]=this.io.port_read32(244));this.debug_init()};S.prototype.load_multiboot=function(a){this.load_multiboot_option_rom(a,void 0,"")&&(this.reg32[0]=this.io.port_read32(244))};
707
+ f(0);else if(3===e)this.fw_value=new Uint8Array(Int32Array.of(this.memory_size[0],0).buffer);else if(5===e)this.fw_value=f(1);else if(15===e)this.fw_value=f(1);else if(14===e)this.fw_value=f(+a.bootmenu);else if(13===e)this.fw_value=new Uint8Array(16);else if(25===e){e=new Int32Array(4+64*this.option_roms.length);const m=new Uint8Array(e.buffer);e[0]=h(this.option_roms.length);for(let l=0;l<this.option_roms.length;l++){const {name:n,data:p}=this.option_roms[l],q=4+64*l;e[q+0>>2]=h(p.length);e[q+4>>
708
+ 2]=g(49152+l);for(let r=0;r<n.length;r++)m[q+8+r]=n.charCodeAt(r)}this.fw_value=m}else 32768<=e&&49152>e?this.fw_value=f(0):49152<=e&&e-49152<this.option_roms.length?this.fw_value=this.option_roms[e-49152].data:(sa("Warning: Unimplemented fw index: "+y(e)),this.fw_value=f(0))});this.devices={};a.load_devices&&(this.devices.pci=new Jc(this),this.acpi_enabled[0]&&(this.devices.acpi=new Gc(this)),this.devices.rtc=new hb(this),this.fill_cmos(this.devices.rtc,a),this.devices.dma=new A(this),this.devices.vga=
709
+ new Y(this,b,a.screen,a.vga_memory_size||8388608),this.devices.ps2=new Pc(this,b),this.devices.vmware=new Qc(this,b),this.devices.uart0=new Hc(this,1016,b),this.devices.parallel0=new Ic(this,888,7,0,b),a.uart1&&(this.devices.uart1=new Hc(this,760,b)),a.uart2&&(this.devices.uart2=new Hc(this,1E3,b)),a.uart3&&(this.devices.uart3=new Hc(this,744,b)),a.parallel1&&(this.devices.parallel1=new Ic(this,632,5,1,b)),this.devices.fdc=new W(this,a.fda,a.fdb),c=[[void 0,void 0],[void 0,void 0]],a.hda&&(c[0][0]=
710
+ {buffer:a.hda},c[0][1]={buffer:a.hdb}),c[1][0]={is_cdrom:!0,buffer:a.cdrom},this.devices.ide=new dd(this,b,c),this.devices.cdrom=this.devices.ide.secondary.master,this.devices.pit=new ib(this,b),"ne2k"===a.net_device.type?this.devices.net=new Mc(this,b,a.preserve_mac_from_state_image,a.mac_address_translation):"virtio"===a.net_device.type&&(this.devices.virtio_net=new fd(this,b,a.preserve_mac_from_state_image,a.net_device.mtu)),a.fs9p?this.devices.virtio_9p=new ld(a.fs9p,this,b):a.handle9p?this.devices.virtio_9p=
711
+ new md(a.handle9p,this):a.proxy9p&&(this.devices.virtio_9p=new nd(a.proxy9p,this)),a.virtio_console&&(this.devices.virtio_console=new Nc(this,b)),a.virtio_balloon&&(this.devices.virtio_balloon=new jd(this,b)),this.devices.sb16=new D(this,b));a.multiboot&&(b=this.load_multiboot_option_rom(a.multiboot,a.initrd,a.cmdline))&&(this.bios.main?this.option_roms.push(b):this.reg32[0]=this.io.port_read32(244));this.debug_init()};
712
+ S.prototype.load_multiboot=function(a){this.load_multiboot_option_rom(a,void 0,"")&&(this.reg32[0]=this.io.port_read32(244))};
712
713
  S.prototype.load_multiboot_option_rom=function(a,b,c){if(8192>a.byteLength){var d=new Int32Array(2048);(new Uint8Array(d.buffer)).set(new Uint8Array(a))}else d=new Int32Array(a,0,2048);for(var e=0;8192>e;e+=4){if(464367618===d[e>>2]){var f=d[e+4>>2];if(464367618+f+d[e+8>>2]|0)continue}else continue;sa("Multiboot magic found, flags: "+y(f>>>0,8),2);var g=this;this.io.register_read(244,this,function(){return 0},function(){return 0},function(){var n,p=31860;let q=0;if(c){q|=4;g.write32(31760,p);c+="\x00";
713
714
  var r=(new TextEncoder).encode(c);g.write_blob(r,p);p+=r.length}if(f&2){q|=64;r=0;g.write32(31788,0);g.write32(31792,p);var x=0;var E=!1;for(n=0;4294967296>n;n+=131072)E&&void 0!==g.memory_map_read8[n>>>17]?(g.write32(p,20),g.write32(p+4,x),g.write32(p+8,0),g.write32(p+12,n-x),g.write32(p+16,0),g.write32(p+20,1),p+=24,r+=24,E=!1):E||void 0!==g.memory_map_read8[n>>>17]||(x=n,E=!0);g.write32(31788,r)}x=r=0;if(f&65536){n=d[e+12>>2];r=d[e+16>>2];var B=d[e+20>>2];x=d[e+24>>2];E=d[e+28>>2];y(n,8);y(r,8);
714
715
  y(B,8);y(x,8);y(E,8);n=new Uint8Array(a,e-(n-r),0===B?void 0:B-r);g.write_blob(n,r);r=E|0;x=Math.max(B,x)}else if(1179403647===d[0]){E=new DataView(a);const [C,w]=Yc(E,Vc);console.assert(52===w);console.assert(1179403647===C.magic,"Bad magic");console.assert(1===C.class,"Unimplemented: 64 bit elf");console.assert(1===C.data,"Unimplemented: big endian");console.assert(1===C.version0,"Bad version0");console.assert(2===C.type,"Unimplemented type");console.assert(1===C.version1,"Bad version1");console.assert(52===
package/build/libv86.mjs CHANGED
@@ -301,8 +301,8 @@ file_name:m,lengthComputable:n.lengthComputable,total:n.total,loaded:n.loaded})}
301
301
  r.buffer;break;case "bzimage":e.bzimage=r.buffer;break;case "initrd":e.initrd=r.buffer;break;case "bios":e.bios=r.buffer;break;case "vga_bios":e.vga_bios=r.buffer;break;case "initial_state":e.initial_state=r.buffer;break;case "fs9p_json":e.fs9p_json=r}}async function d(){if(e.fs9p&&e.fs9p_json&&!e.initial_state&&(e.fs9p.load_from_json(e.fs9p_json),b.bzimage_initrd_from_filesystem)){const {bzimage_path:q,initrd_path:r}=this.get_bzimage_initrd_from_filesystem(e.fs9p),[x,E]=await Promise.all([e.fs9p.read_file(r),
302
302
  e.fs9p.read_file(q)]);c.call(this,"initrd",new z(x.buffer));c.call(this,"bzimage",new z(E.buffer))}this.serial_adapter&&this.serial_adapter.show&&this.serial_adapter.show();this.virtio_console_adapter&&this.virtio_console_adapter.show&&this.virtio_console_adapter.show();this.v86.init(e);this.modem&&this.modem.initialize();e.initial_state&&(a.restore_state(e.initial_state),e.initial_state=void 0);b.autostart&&this.v86.run();this.emulator_bus.send("emulator-loaded")}this.bus.register("emulator-stopped",
303
303
  function(){this.cpu_is_running=!1;this.screen_adapter.pause()},this);this.bus.register("emulator-started",function(){this.cpu_is_running=!0;this.screen_adapter.continue()},this);var e={},f=b.boot_order?b.boot_order:b.fda?801:b.hda?786:291;if(b.modem)switch(e.modem=b.modem,b.modem.uart){case 1:b.uart1=!0;break;case 2:b.uart2=!0;break;case 3:b.uart3=!0}e.acpi=b.acpi;e.disable_jit=b.disable_jit;e.load_devices=!0;e.memory_size=b.memory_size||67108864;e.vga_memory_size=b.vga_memory_size||8388608;e.boot_order=
304
- f;e.fastboot=b.fastboot||!1;e.fda=void 0;e.fdb=void 0;e.uart1=b.uart1;e.uart2=b.uart2;e.uart3=b.uart3;e.parallel1=b.parallel1;e.cmdline=b.cmdline;e.preserve_mac_from_state_image=b.preserve_mac_from_state_image;e.mac_address_translation=b.mac_address_translation;e.cpuid_level=b.cpuid_level;e.virtio_balloon=b.virtio_balloon;e.virtio_console=!!b.virtio_console;if(f=b.network_relay_url||b.net_device&&b.net_device.relay_url)"fetch"===f?this.network_adapter=new Xb(this.bus,b.net_device):"inbrowser"===f?
305
- this.network_adapter=new rc(this.bus,b.net_device):f.startsWith("wisp://")||f.startsWith("wisps://")?this.network_adapter=new $b(f,this.bus,b.net_device):this.network_adapter=new pb(f,this.bus);e.net_device=b.net_device||{type:"ne2k"};f=b.screen||{};b.screen_container&&(f.container=b.screen_container);b.disable_keyboard||(this.keyboard_adapter=new bc(this.bus));b.disable_mouse||(this.mouse_adapter=new cc(this.bus,f.container));this.absolute_pointer_enabled=!1;this.bus.register("vmware-absolute-mouse",
304
+ f;e.fastboot=b.fastboot||!1;e.bootmenu=b.bootmenu||!1;e.fda=void 0;e.fdb=void 0;e.uart1=b.uart1;e.uart2=b.uart2;e.uart3=b.uart3;e.parallel1=b.parallel1;e.cmdline=b.cmdline;e.preserve_mac_from_state_image=b.preserve_mac_from_state_image;e.mac_address_translation=b.mac_address_translation;e.cpuid_level=b.cpuid_level;e.virtio_balloon=b.virtio_balloon;e.virtio_console=!!b.virtio_console;if(f=b.network_relay_url||b.net_device&&b.net_device.relay_url)"fetch"===f?this.network_adapter=new Xb(this.bus,b.net_device):
305
+ "inbrowser"===f?this.network_adapter=new rc(this.bus,b.net_device):f.startsWith("wisp://")||f.startsWith("wisps://")?this.network_adapter=new $b(f,this.bus,b.net_device):this.network_adapter=new pb(f,this.bus);e.net_device=b.net_device||{type:"ne2k"};f=b.screen||{};b.screen_container&&(f.container=b.screen_container);b.disable_keyboard||(this.keyboard_adapter=new bc(this.bus));b.disable_mouse||(this.mouse_adapter=new cc(this.bus,f.container));this.absolute_pointer_enabled=!1;this.bus.register("vmware-absolute-mouse",
306
306
  function(q){q&&!this.absolute_pointer_enabled&&"undefined"!==typeof document&&document.pointerLockElement&&document.exitPointerLock();this.absolute_pointer_enabled=q},this);this.screen_adapter=f.container?new va(f,()=>this.v86.cpu.devices.vga&&this.v86.cpu.devices.vga.screen_fill_buffer()):f.ansi?new ec(f):new dc(f);e.screen=this.screen_adapter;e.screen_options=f;e.serial_console=b.serial_console||{type:"none"};b.serial_container_xtermjs?(e.serial_console.type="xtermjs",e.serial_console.container=
307
307
  b.serial_container_xtermjs):b.serial_container&&(e.serial_console.type="textarea",e.serial_console.container=b.serial_container);"xtermjs"===e.serial_console?.type?this.serial_adapter=new pc(e.serial_console.container,this.bus,e.serial_console.xterm_lib||window.Terminal):"textarea"===e.serial_console?.type&&(this.serial_adapter=new gc(e.serial_console.container,this.bus));f=b.virtio_console&&"boolean"===typeof b.virtio_console?{type:"none"}:b.virtio_console;"xtermjs"===f?.type?this.virtio_console_adapter=
308
308
  new qc(f.container,this.bus,f.xterm_lib||window.Terminal):"textarea"===f?.type&&(this.virtio_console_adapter=new hc(f.container,this.bus));e.modem&&(this.modem=new H(this.bus,e.modem));b.disable_speaker||(this.speaker_adapter=new jb(this.bus));var g=[];f=(q,r)=>{if(r)if(r.get&&r.set&&r.load)g.push({name:q,loadable:r});else{if("bios"===q||"vga_bios"===q||"initial_state"===q||"multiboot"===q||"bzimage"===q||"initrd"===q)r.async=!1;if("fda"===q||"fdb"===q)r.async=!1;r.url&&!r.async?g.push({name:q,url:r.url,
@@ -616,45 +616,45 @@ b[0]=a[0];b[1]=a[1];b[2]=a[2];b[3]=a[3];b[4]=a[4];b[8]=a[6];b[9]=a[7];b[10]=a[8]
616
616
  const c=this.memory_size[0]>>12;let d=0;for(let f=0;f<c;f++)if(a.get(f)){var e=d<<12;e=b.subarray(e,e+4096);this.mem8.set(e,f<<12);d++}};S.prototype.reboot_internal=function(){this.reset_cpu();this.fw_value=[];this.devices.virtio_9p&&this.devices.virtio_9p.reset();this.devices.virtio_console&&this.devices.virtio_console.reset();this.devices.virtio_net&&this.devices.virtio_net.reset();this.devices.ps2&&this.devices.ps2.reset();this.load_bios()};S.prototype.reset_memory=function(){this.mem8.fill(0)};
617
617
  S.prototype.create_memory=function(a,b){a<b?a=b:0>(a|0)&&(a=Math.pow(2,31)-131072);a=(a-1|131071)+1|0;console.assert(0===this.memory_size[0],"Expected uninitialised memory");this.memory_size[0]=a;b=this.allocate_memory(a);this.mem8=k(Uint8Array,this.wasm_memory,b,a);this.mem32s=k(Uint32Array,this.wasm_memory,b,a>>2)};S.prototype.init=function(a,b){this.create_memory(a.memory_size||67108864,a.initrd?67108864:1048576);a.disable_jit&&this.set_jit_config(0,1);a.cpuid_level&&this.set_cpuid_level(a.cpuid_level);
618
618
  this.acpi_enabled[0]=+a.acpi;this.reset_cpu();var c=new Ea(this);this.io=c;this.bios.main=a.bios;this.bios.vga=a.vga_bios;this.load_bios();if(a.bzimage){const e=kd(this.mem8,a.bzimage,a.initrd,a.cmdline||"");e&&this.option_roms.push(e)}c.register_read(179,this,function(){return 0});var d=0;c.register_read(146,this,function(){return d});c.register_write(146,this,function(e){d=e});c.register_read(1297,this,function(){return this.fw_pointer<this.fw_value.length?this.fw_value[this.fw_pointer++]:0});c.register_write(1296,
619
- this,void 0,function(e){function f(m){return new Uint8Array(Int32Array.of(m).buffer)}function g(m){return m>>8|m<<8&65280}function h(m){return m<<24|m<<8&16711680|m>>8&65280|m>>>24}sa("bios config port, index="+y(e));this.fw_pointer=0;if(0===e)this.fw_value=f(1431127377);else if(1===e)this.fw_value=f(0);else if(3===e)this.fw_value=new Uint8Array(Int32Array.of(this.memory_size[0],0).buffer);else if(5===e)this.fw_value=f(1);else if(15===e)this.fw_value=f(1);else if(13===e)this.fw_value=new Uint8Array(16);
620
- else if(25===e){e=new Int32Array(4+64*this.option_roms.length);const m=new Uint8Array(e.buffer);e[0]=h(this.option_roms.length);for(let l=0;l<this.option_roms.length;l++){const {name:n,data:p}=this.option_roms[l],q=4+64*l;e[q+0>>2]=h(p.length);e[q+4>>2]=g(49152+l);for(let r=0;r<n.length;r++)m[q+8+r]=n.charCodeAt(r)}this.fw_value=m}else 32768<=e&&49152>e?this.fw_value=f(0):49152<=e&&e-49152<this.option_roms.length?this.fw_value=this.option_roms[e-49152].data:(sa("Warning: Unimplemented fw index: "+
621
- y(e)),this.fw_value=f(0))});this.devices={};a.load_devices&&(this.devices.pci=new Jc(this),this.acpi_enabled[0]&&(this.devices.acpi=new Gc(this)),this.devices.rtc=new hb(this),this.fill_cmos(this.devices.rtc,a),this.devices.dma=new A(this),this.devices.vga=new Y(this,b,a.screen,a.vga_memory_size||8388608),this.devices.ps2=new Pc(this,b),this.devices.vmware=new Qc(this,b),this.devices.uart0=new Hc(this,1016,b),this.devices.parallel0=new Ic(this,888,7,0,b),a.uart1&&(this.devices.uart1=new Hc(this,760,
622
- b)),a.uart2&&(this.devices.uart2=new Hc(this,1E3,b)),a.uart3&&(this.devices.uart3=new Hc(this,744,b)),a.parallel1&&(this.devices.parallel1=new Ic(this,632,5,1,b)),this.devices.fdc=new W(this,a.fda,a.fdb),c=[[void 0,void 0],[void 0,void 0]],a.hda&&(c[0][0]={buffer:a.hda},c[0][1]={buffer:a.hdb}),c[1][0]={is_cdrom:!0,buffer:a.cdrom},this.devices.ide=new dd(this,b,c),this.devices.cdrom=this.devices.ide.secondary.master,this.devices.pit=new ib(this,b),"ne2k"===a.net_device.type?this.devices.net=new Mc(this,
623
- b,a.preserve_mac_from_state_image,a.mac_address_translation):"virtio"===a.net_device.type&&(this.devices.virtio_net=new fd(this,b,a.preserve_mac_from_state_image,a.net_device.mtu)),a.fs9p?this.devices.virtio_9p=new ld(a.fs9p,this,b):a.handle9p?this.devices.virtio_9p=new md(a.handle9p,this):a.proxy9p&&(this.devices.virtio_9p=new nd(a.proxy9p,this)),a.virtio_console&&(this.devices.virtio_console=new Nc(this,b)),a.virtio_balloon&&(this.devices.virtio_balloon=new jd(this,b)),this.devices.sb16=new D(this,
624
- b));a.multiboot&&(a=this.load_multiboot_option_rom(a.multiboot,a.initrd,a.cmdline))&&(this.bios.main?this.option_roms.push(a):this.reg32[0]=this.io.port_read32(244));this.debug_init()};S.prototype.load_multiboot=function(a){this.load_multiboot_option_rom(a,void 0,"")&&(this.reg32[0]=this.io.port_read32(244))};S.prototype.load_multiboot_option_rom=function(a,b,c){if(8192>a.byteLength){var d=new Int32Array(2048);(new Uint8Array(d.buffer)).set(new Uint8Array(a))}else d=new Int32Array(a,0,2048);for(var e=
625
- 0;8192>e;e+=4){if(464367618===d[e>>2]){var f=d[e+4>>2];if(464367618+f+d[e+8>>2]|0)continue}else continue;sa("Multiboot magic found, flags: "+y(f>>>0,8),2);var g=this;this.io.register_read(244,this,function(){return 0},function(){return 0},function(){var n,p=31860;let q=0;if(c){q|=4;g.write32(31760,p);c+="\x00";var r=(new TextEncoder).encode(c);g.write_blob(r,p);p+=r.length}if(f&2){q|=64;r=0;g.write32(31788,0);g.write32(31792,p);var x=0;var E=!1;for(n=0;4294967296>n;n+=131072)E&&void 0!==g.memory_map_read8[n>>>
626
- 17]?(g.write32(p,20),g.write32(p+4,x),g.write32(p+8,0),g.write32(p+12,n-x),g.write32(p+16,0),g.write32(p+20,1),p+=24,r+=24,E=!1):E||void 0!==g.memory_map_read8[n>>>17]||(x=n,E=!0);g.write32(31788,r)}x=r=0;if(f&65536){n=d[e+12>>2];r=d[e+16>>2];var B=d[e+20>>2];x=d[e+24>>2];E=d[e+28>>2];y(n,8);y(r,8);y(B,8);y(x,8);y(E,8);n=new Uint8Array(a,e-(n-r),0===B?void 0:B-r);g.write_blob(n,r);r=E|0;x=Math.max(B,x)}else if(1179403647===d[0]){E=new DataView(a);const [C,w]=Yc(E,Vc);console.assert(52===w);console.assert(1179403647===
627
- C.magic,"Bad magic");console.assert(1===C.class,"Unimplemented: 64 bit elf");console.assert(1===C.data,"Unimplemented: big endian");console.assert(1===C.version0,"Bad version0");console.assert(2===C.type,"Unimplemented type");console.assert(1===C.version1,"Bad version1");console.assert(52===C.ehsize,"Bad header size");console.assert(32===C.phentsize,"Bad program header size");console.assert(40===C.shentsize,"Bad section header size");[r]=Zc(new DataView(E.buffer,E.byteOffset+C.phoff,C.phentsize*C.phnum),
628
- Wc,C.phnum);Zc(new DataView(E.buffer,E.byteOffset+C.shoff,C.shentsize*C.shnum),Xc,C.shnum);E=C;n=r;r=E.entry;for(B of n)0!==B.type&&(1===B.type?B.paddr+B.memsz<g.memory_size[0]?(B.filesz&&(n=new Uint8Array(a,B.offset,B.filesz),g.write_blob(n,B.paddr)),x=Math.max(x,B.paddr+B.memsz),r===E.entry&&B.vaddr<=r&&B.vaddr+B.memsz>r&&(r=r-B.vaddr+B.paddr)):y(B.paddr):2===B.type||3===B.type||4===B.type||6===B.type||7===B.type||1685382480===B.type||1685382481===B.type||1685382482===B.type||1685382483===B.type||
629
- y(B.type))}b&&(q|=8,g.write32(31764,1),g.write32(31768,p),B=x,0!==(B&4095)&&(B=(B&-4096)+4096),x=B+b.byteLength,g.write32(p,B),g.write32(p+4,x),g.write32(p+8,0),g.write32(p+12,0),g.write_blob(new Uint8Array(b),B));g.write32(31744,q);g.reg32[3]=31744;g.cr[0]=1;g.protected_mode[0]=1;g.flags[0]=2;g.is_32[0]=1;g.stack_size_32[0]=1;for(p=0;6>p;p++)g.segment_is_null[p]=0,g.segment_offsets[p]=0,g.segment_limits[p]=4294967295,g.sreg[p]=1===p?8:16;g.instruction_pointer[0]=g.get_seg_cs()+r|0;g.update_state_flags();
630
- g.dump_state();g.dump_regs_short();return 732803074});this.io.register_write_consecutive(244,this,function(n){console.log("Test exited with code "+y(n,2));throw"HALT";},function(){},function(){},function(){});for(let n=0;15>=n;n++){function p(q){y(n);y(q,2);q?this.device_raise_irq(n):this.device_lower_irq(n)}this.io.register_write(8192+n,this,p,p,p)}const m=new Uint8Array(512);(new Uint16Array(m.buffer))[0]=43605;m[2]=1;var h=3;m[h++]=102;m[h++]=229;m[h++]=244;let l=m[h]=0;for(let n=0;n<m.length;n++)l+=
631
- m[n];m[h]=-l;return{name:"genroms/multiboot.bin",data:m}}};S.prototype.fill_cmos=function(a,b){var c=b.boot_order||291;a.cmos_write(56,1|c>>4&240);a.cmos_write(61,c&255);a.cmos_write(21,128);a.cmos_write(22,2);c=0;1048576<=this.memory_size[0]&&(c=this.memory_size[0]-1048576>>10,c=Math.min(c,65535));a.cmos_write(23,c&255);a.cmos_write(24,c>>8&255);a.cmos_write(48,c&255);a.cmos_write(49,c>>8&255);c=0;16777216<=this.memory_size[0]&&(c=this.memory_size[0]-16777216>>16,c=Math.min(c,65535));a.cmos_write(52,
632
- c&255);a.cmos_write(53,c>>8&255);a.cmos_write(91,0);a.cmos_write(92,0);a.cmos_write(93,0);a.cmos_write(20,47);a.cmos_write(95,0);b.fastboot&&a.cmos_write(63,1)};S.prototype.load_bios=function(){var a=this.bios.main,b=this.bios.vga;if(a){var c=new Uint8Array(a);this.write_blob(c,1048576-a.byteLength);if(b){var d=new Uint8Array(b);this.write_blob(d,786432);this.io.mmap_register(4272947200,1048576,function(e){e=e-4272947200|0;return e<d.length?d[e]:0},function(){})}this.io.mmap_register(4293918720,1048576,
633
- function(e){return this.mem8[e&1048575]}.bind(this),function(e,f){this.mem8[e&1048575]=f}.bind(this))}};S.prototype.codegen_finalize=function(a,b,c,d,e){const f=new Uint8Array(this.wasm_memory.buffer,d>>>0,e>>>0);WebAssembly.instantiate(f,{e:this.jit_imports}).then(g=>{this.wm.wasm_table.set(a+1024,g.instance.exports.f);this.codegen_finalize_finished(a,b,c);this.test_hook_did_finalize_wasm&&this.test_hook_did_finalize_wasm(f)})};S.prototype.log_uncompiled_code=function(){};S.prototype.dump_function_code=
634
- function(){};S.prototype.run_hardware_timers=function(a,b){const c=this.devices.pit.timer(b,!1),d=this.devices.rtc.timer(b,!1);let e=100,f=100;a&&(e=this.devices.acpi.timer(b),f=this.apic_timer(b));return Math.min(c,d,e,f)};S.prototype.debug_init=function(){};S.prototype.dump_stack=function(){};S.prototype.debug_get_state=function(){};S.prototype.dump_state=function(){};S.prototype.get_regs_short=function(){};S.prototype.dump_regs_short=function(){};S.prototype.dump_gdt_ldt=function(){};S.prototype.dump_idt=
635
- function(){};S.prototype.dump_page_structures=function(){if(this.cr[4]&32)for(var a=0;4>a;a++){var b=this.read32s(this.cr[3]+8*a);b&1&&this.dump_page_directory(b&4294963200,!0,a<<30)}else this.dump_page_directory(this.cr[3],!1,0)};S.prototype.dump_page_directory=function(){};S.prototype.get_memory_dump=function(){};S.prototype.memory_hex_dump=function(){};S.prototype.used_memory_dump=function(){};S.prototype.debug_interrupt=function(){};S.prototype.debug_dump_code=function(){};S.prototype.dump_wasm=
636
- function(){};function Oc(a,b){this.cpu=a;this.pci=a.devices.pci;this.device_id=b.device_id;this.pci_space=[244,26,b.device_id&255,b.device_id>>8,7,5,16,0,1,0,2,0,0,0,0,0,1,168,0,0,0,16,191,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,244,26,b.subsystem_device_id&255,b.subsystem_device_id>>8,0,0,0,0,64,0,0,0,0,0,0,0,0,1,0,0];this.pci_space=this.pci_space.concat(Array(256-this.pci_space.length).fill(0));this.pci_id=b.pci_id;this.pci_bars=[];this.name=b.name;this.driver_feature_select=this.device_feature_select=
637
- 0;this.device_feature=new Uint32Array(4);this.driver_feature=new Uint32Array(4);for(var c of b.common.features)this.device_feature[c>>>5]|=1<<(c&31),this.driver_feature[c>>>5]|=1<<(c&31);b.common.features.includes(32);this.features_ok=!0;this.device_status=0;this.config_has_changed=!1;this.config_generation=0;this.queues=[];for(const d of b.common.queues)this.queues.push(new Z(a,this,d));this.queue_select=0;this.queue_selected=this.queues[0];this.isr_status=0;c=[];c.push(this.create_common_capability(b.common));
638
- c.push(this.create_notification_capability(b.notification));c.push(this.create_isr_capability(b.isr_status));b.device_specific&&c.push(this.create_device_specific_capability(b.device_specific));this.init_capabilities(c);a.devices.pci.register_device(this);this.reset()}Oc.prototype.create_common_capability=function(a){return{type:1,bar:0,port:a.initial_port,use_mmio:!1,offset:0,extra:new Uint8Array(0),struct:[{bytes:4,name:"device_feature_select",read:()=>this.device_feature_select,write:b=>{this.device_feature_select=
639
- b}},{bytes:4,name:"device_feature",read:()=>this.device_feature[this.device_feature_select]||0,write:()=>{}},{bytes:4,name:"driver_feature_select",read:()=>this.driver_feature_select,write:b=>{this.driver_feature_select=b}},{bytes:4,name:"driver_feature",read:()=>this.driver_feature[this.driver_feature_select]||0,write:b=>{const c=this.device_feature[this.driver_feature_select];this.driver_feature_select<this.driver_feature.length&&(this.driver_feature[this.driver_feature_select]=b&c);this.features_ok=
640
- this.features_ok&&!(b&~c)}},{bytes:2,name:"msix_config",read:()=>65535,write:()=>{}},{bytes:2,name:"num_queues",read:()=>this.queues.length,write:()=>{}},{bytes:1,name:"device_status",read:()=>this.device_status,write:b=>{0===b&&this.reset();b&~this.device_status&4&&this.device_status&64&&this.notify_config_changes();this.features_ok||(b&=-9);this.device_status=b;if(b&~this.device_status&4)a.on_driver_ok()}},{bytes:1,name:"config_generation",read:()=>this.config_generation,write:()=>{}},{bytes:2,
641
- name:"queue_select",read:()=>this.queue_select,write:b=>{this.queue_select=b;this.queue_selected=this.queue_select<this.queues.length?this.queues[this.queue_select]:null}},{bytes:2,name:"queue_size",read:()=>this.queue_selected?this.queue_selected.size:0,write:b=>{this.queue_selected&&(b&b-1&&(b=1<<da(b-1)+1),b>this.queue_selected.size_supported&&(b=this.queue_selected.size_supported),this.queue_selected.set_size(b))}},{bytes:2,name:"queue_msix_vector",read:()=>65535,write:()=>{}},{bytes:2,name:"queue_enable",
642
- read:()=>this.queue_selected?this.queue_selected.enabled|0:0,write:b=>{this.queue_selected&&1===b&&this.queue_selected.is_configured()&&this.queue_selected.enable()}},{bytes:2,name:"queue_notify_off",read:()=>this.queue_selected?this.queue_selected.notify_offset:0,write:()=>{}},{bytes:4,name:"queue_desc (low dword)",read:()=>this.queue_selected?this.queue_selected.desc_addr:0,write:b=>{this.queue_selected&&(this.queue_selected.desc_addr=b)}},{bytes:4,name:"queue_desc (high dword)",read:()=>0,write:()=>
643
- {}},{bytes:4,name:"queue_avail (low dword)",read:()=>this.queue_selected?this.queue_selected.avail_addr:0,write:b=>{this.queue_selected&&(this.queue_selected.avail_addr=b)}},{bytes:4,name:"queue_avail (high dword)",read:()=>0,write:()=>{}},{bytes:4,name:"queue_used (low dword)",read:()=>this.queue_selected?this.queue_selected.used_addr:0,write:b=>{this.queue_selected&&(this.queue_selected.used_addr=b)}},{bytes:4,name:"queue_used (high dword)",read:()=>0,write:()=>{}}]}};Oc.prototype.create_notification_capability=
644
- function(a){const b=[];let c;c=a.single_handler?0:2;for(const [d,e]of a.handlers.entries())b.push({bytes:2,name:"notify"+d,read:()=>65535,write:e||(()=>{})});return{type:2,bar:1,port:a.initial_port,use_mmio:!1,offset:0,extra:new Uint8Array([c&255,c>>8&255,c>>16&255,c>>24]),struct:b}};Oc.prototype.create_isr_capability=function(a){return{type:3,bar:2,port:a.initial_port,use_mmio:!1,offset:0,extra:new Uint8Array(0),struct:[{bytes:1,name:"isr_status",read:()=>{const b=this.isr_status;this.lower_irq();
645
- return b},write:()=>{}}]}};Oc.prototype.create_device_specific_capability=function(a){return{type:4,bar:3,port:a.initial_port,use_mmio:!1,offset:0,extra:new Uint8Array(0),struct:a.struct}};Oc.prototype.init_capabilities=function(a){let b=this.pci_space[52]=64;var c=b;for(const e of a){a=16+e.extra.length;c=b;b=c+a;var d=e.struct.reduce((f,g)=>f+g.bytes,0);d+=e.offset;d=16>d?16:1<<da(d-1)+1;this.pci_bars[e.bar]={size:d};this.pci_space[c]=9;this.pci_space[c+1]=b;this.pci_space[c+2]=a;this.pci_space[c+
646
- 3]=e.type;this.pci_space[c+4]=e.bar;this.pci_space[c+5]=0;this.pci_space[c+6]=0;this.pci_space[c+7]=0;this.pci_space[c+8]=e.offset&255;this.pci_space[c+9]=e.offset>>>8&255;this.pci_space[c+10]=e.offset>>>16&255;this.pci_space[c+11]=e.offset>>>24;this.pci_space[c+12]=d&255;this.pci_space[c+13]=d>>>8&255;this.pci_space[c+14]=d>>>16&255;this.pci_space[c+15]=d>>>24;for(const [f,g]of e.extra.entries())this.pci_space[c+16+f]=g;c=16+4*e.bar;this.pci_space[c]=e.port&254|!e.use_mmio;this.pci_space[c+1]=e.port>>>
647
- 8&255;this.pci_space[c+2]=e.port>>>16&255;this.pci_space[c+3]=e.port>>>24&255;c=e.port+e.offset;for(const f of e.struct){let g=f.read;a=f.write;if(!e.use_mmio){d=function(l){return g(l&-2)>>((l&1)<<3)&255};const h=function(l){return g(l&-4)>>((l&3)<<3)&255},m=function(l){return g(l)};switch(f.bytes){case 4:this.cpu.io.register_read(c,this,h,void 0,g);this.cpu.io.register_read(c+1,this,h);this.cpu.io.register_read(c+2,this,h);this.cpu.io.register_read(c+3,this,h);this.cpu.io.register_write(c,this,
648
- void 0,void 0,a);break;case 2:this.cpu.io.register_read(c,this,d,g,m);this.cpu.io.register_read(c+1,this,d);this.cpu.io.register_write(c,this,void 0,a);break;case 1:this.cpu.io.register_read(c,this,g),this.cpu.io.register_write(c,this,a)}}c+=f.bytes}}this.pci_space[b]=9;this.pci_space[b+1]=0;this.pci_space[b+2]=20;this.pci_space[b+3]=5;this.pci_space[b+4]=0;this.pci_space[b+5]=0;this.pci_space[b+6]=0;this.pci_space[b+7]=0;this.pci_space[b+8]=0;this.pci_space[b+9]=0;this.pci_space[b+10]=0;this.pci_space[b+
649
- 11]=0;this.pci_space[b+12]=0;this.pci_space[b+13]=0;this.pci_space[b+14]=0;this.pci_space[b+15]=0;this.pci_space[b+16]=0;this.pci_space[b+17]=0;this.pci_space[b+18]=0;this.pci_space[b+19]=0};Oc.prototype.get_state=function(){let a=[];a[0]=this.device_feature_select;a[1]=this.driver_feature_select;a[2]=this.device_feature;a[3]=this.driver_feature;a[4]=this.features_ok;a[5]=this.device_status;a[6]=this.config_has_changed;a[7]=this.config_generation;a[8]=this.isr_status;a[9]=this.queue_select;return a=
650
- a.concat(this.queues)};Oc.prototype.set_state=function(a){this.device_feature_select=a[0];this.driver_feature_select=a[1];this.device_feature=a[2];this.driver_feature=a[3];this.features_ok=a[4];this.device_status=a[5];this.config_has_changed=a[6];this.config_generation=a[7];this.isr_status=a[8];this.queue_select=a[9];let b=0;for(const c of a.slice(10))this.queues[b].set_state(c),b++;this.queue_selected=this.queues[this.queue_select]||null};Oc.prototype.reset=function(){this.driver_feature_select=
651
- this.device_feature_select=0;this.driver_feature.set(this.device_feature);this.features_ok=!0;this.queue_select=this.device_status=0;this.queue_selected=this.queues[0];for(const a of this.queues)a.reset();this.config_has_changed=!1;this.config_generation=0;this.lower_irq()};Oc.prototype.notify_config_changes=function(){this.config_has_changed=!0;this.device_status&4&&this.raise_irq(2)};Oc.prototype.update_config_generation=function(){this.config_has_changed&&(this.config_generation++,this.config_generation&=
652
- 255,this.config_has_changed=!1)};Oc.prototype.is_feature_negotiated=function(a){return 0<(this.driver_feature[a>>>5]&1<<(a&31))};Oc.prototype.needs_reset=function(){this.device_status|=64;this.device_status&4&&this.notify_config_changes()};Oc.prototype.raise_irq=function(a){y(a);this.isr_status|=a;this.pci.raise_irq(this.pci_id)};Oc.prototype.lower_irq=function(){this.isr_status=0;this.pci.lower_irq(this.pci_id)};function Z(a,b,c){this.cpu=a;this.virtio=b;this.size_supported=this.size=c.size_supported;
653
- this.mask=this.size-1;this.enabled=!1;this.notify_offset=c.notify_offset;this.num_staged_replies=this.used_addr=this.avail_last_idx=this.avail_addr=this.desc_addr=0;this.reset()}Z.prototype.get_state=function(){const a=[];a[0]=this.size;a[1]=this.size_supported;a[2]=this.enabled;a[3]=this.notify_offset;a[4]=this.desc_addr;a[5]=this.avail_addr;a[6]=this.avail_last_idx;a[7]=this.used_addr;a[8]=this.num_staged_replies;a[9]=1;return a};Z.prototype.set_state=function(a){this.size=a[0];this.size_supported=
654
- a[1];this.enabled=a[2];this.notify_offset=a[3];this.desc_addr=a[4];this.avail_addr=a[5];this.avail_last_idx=a[6];this.used_addr=a[7];this.num_staged_replies=a[8];this.mask=this.size-1;this.fix_wrapping=1!==a[9]};Z.prototype.reset=function(){this.enabled=!1;this.num_staged_replies=this.used_addr=this.avail_last_idx=this.avail_addr=this.desc_addr=0;this.set_size(this.size_supported)};Z.prototype.is_configured=function(){return this.desc_addr&&this.avail_addr&&this.used_addr};Z.prototype.enable=function(){this.is_configured();
655
- this.enabled=!0};Z.prototype.set_size=function(a){this.size=a;this.mask=a-1};Z.prototype.count_requests=function(){this.fix_wrapping&&(this.fix_wrapping=!1,this.avail_last_idx=(this.avail_get_idx()&~this.mask)+(this.avail_last_idx&this.mask));return this.avail_get_idx()-this.avail_last_idx&65535};Z.prototype.has_request=function(){return 0!==this.count_requests()};Z.prototype.pop_request=function(){this.has_request();var a=this.avail_get_entry(this.avail_last_idx);a=new od(this,a);this.avail_last_idx=
656
- this.avail_last_idx+1&65535;return a};Z.prototype.push_reply=function(a){const b=this.used_get_idx()+this.num_staged_replies&this.mask;this.used_set_entry(b,a.head_idx,a.length_written);this.num_staged_replies++};Z.prototype.flush_replies=function(){if(0!==this.num_staged_replies){var a=this.used_get_idx()+this.num_staged_replies&65535;this.used_set_idx(a);this.num_staged_replies=0;this.virtio.is_feature_negotiated(29)?(this.avail_get_used_event(),this.virtio.raise_irq(1)):~this.avail_get_flags()&
657
- 1&&this.virtio.raise_irq(1)}};Z.prototype.notify_me_after=function(a){a=this.avail_get_idx()+a&65535;this.used_set_avail_event(a)};Z.prototype.get_descriptor=function(a,b){return{addr_low:this.cpu.read32s(a+16*b),addr_high:this.cpu.read32s(a+16*b+4),len:this.cpu.read32s(a+16*b+8),flags:this.cpu.read16(a+16*b+12),next:this.cpu.read16(a+16*b+14)}};Z.prototype.avail_get_flags=function(){return this.cpu.read16(this.avail_addr)};Z.prototype.avail_get_idx=function(){return this.cpu.read16(this.avail_addr+
619
+ this,void 0,function(e){function f(m){return new Uint8Array(Int32Array.of(m).buffer)}function g(m){return m>>8|m<<8&65280}function h(m){return m<<24|m<<8&16711680|m>>8&65280|m>>>24}sa("bios config port, index="+y(e));this.fw_pointer=0;if(0===e)this.fw_value=f(1431127377);else if(1===e)this.fw_value=f(0);else if(3===e)this.fw_value=new Uint8Array(Int32Array.of(this.memory_size[0],0).buffer);else if(5===e)this.fw_value=f(1);else if(15===e)this.fw_value=f(1);else if(14===e)this.fw_value=f(+a.bootmenu);
620
+ else if(13===e)this.fw_value=new Uint8Array(16);else if(25===e){e=new Int32Array(4+64*this.option_roms.length);const m=new Uint8Array(e.buffer);e[0]=h(this.option_roms.length);for(let l=0;l<this.option_roms.length;l++){const {name:n,data:p}=this.option_roms[l],q=4+64*l;e[q+0>>2]=h(p.length);e[q+4>>2]=g(49152+l);for(let r=0;r<n.length;r++)m[q+8+r]=n.charCodeAt(r)}this.fw_value=m}else 32768<=e&&49152>e?this.fw_value=f(0):49152<=e&&e-49152<this.option_roms.length?this.fw_value=this.option_roms[e-49152].data:
621
+ (sa("Warning: Unimplemented fw index: "+y(e)),this.fw_value=f(0))});this.devices={};a.load_devices&&(this.devices.pci=new Jc(this),this.acpi_enabled[0]&&(this.devices.acpi=new Gc(this)),this.devices.rtc=new hb(this),this.fill_cmos(this.devices.rtc,a),this.devices.dma=new A(this),this.devices.vga=new Y(this,b,a.screen,a.vga_memory_size||8388608),this.devices.ps2=new Pc(this,b),this.devices.vmware=new Qc(this,b),this.devices.uart0=new Hc(this,1016,b),this.devices.parallel0=new Ic(this,888,7,0,b),a.uart1&&
622
+ (this.devices.uart1=new Hc(this,760,b)),a.uart2&&(this.devices.uart2=new Hc(this,1E3,b)),a.uart3&&(this.devices.uart3=new Hc(this,744,b)),a.parallel1&&(this.devices.parallel1=new Ic(this,632,5,1,b)),this.devices.fdc=new W(this,a.fda,a.fdb),c=[[void 0,void 0],[void 0,void 0]],a.hda&&(c[0][0]={buffer:a.hda},c[0][1]={buffer:a.hdb}),c[1][0]={is_cdrom:!0,buffer:a.cdrom},this.devices.ide=new dd(this,b,c),this.devices.cdrom=this.devices.ide.secondary.master,this.devices.pit=new ib(this,b),"ne2k"===a.net_device.type?
623
+ this.devices.net=new Mc(this,b,a.preserve_mac_from_state_image,a.mac_address_translation):"virtio"===a.net_device.type&&(this.devices.virtio_net=new fd(this,b,a.preserve_mac_from_state_image,a.net_device.mtu)),a.fs9p?this.devices.virtio_9p=new ld(a.fs9p,this,b):a.handle9p?this.devices.virtio_9p=new md(a.handle9p,this):a.proxy9p&&(this.devices.virtio_9p=new nd(a.proxy9p,this)),a.virtio_console&&(this.devices.virtio_console=new Nc(this,b)),a.virtio_balloon&&(this.devices.virtio_balloon=new jd(this,
624
+ b)),this.devices.sb16=new D(this,b));a.multiboot&&(b=this.load_multiboot_option_rom(a.multiboot,a.initrd,a.cmdline))&&(this.bios.main?this.option_roms.push(b):this.reg32[0]=this.io.port_read32(244));this.debug_init()};S.prototype.load_multiboot=function(a){this.load_multiboot_option_rom(a,void 0,"")&&(this.reg32[0]=this.io.port_read32(244))};S.prototype.load_multiboot_option_rom=function(a,b,c){if(8192>a.byteLength){var d=new Int32Array(2048);(new Uint8Array(d.buffer)).set(new Uint8Array(a))}else d=
625
+ new Int32Array(a,0,2048);for(var e=0;8192>e;e+=4){if(464367618===d[e>>2]){var f=d[e+4>>2];if(464367618+f+d[e+8>>2]|0)continue}else continue;sa("Multiboot magic found, flags: "+y(f>>>0,8),2);var g=this;this.io.register_read(244,this,function(){return 0},function(){return 0},function(){var n,p=31860;let q=0;if(c){q|=4;g.write32(31760,p);c+="\x00";var r=(new TextEncoder).encode(c);g.write_blob(r,p);p+=r.length}if(f&2){q|=64;r=0;g.write32(31788,0);g.write32(31792,p);var x=0;var E=!1;for(n=0;4294967296>
626
+ n;n+=131072)E&&void 0!==g.memory_map_read8[n>>>17]?(g.write32(p,20),g.write32(p+4,x),g.write32(p+8,0),g.write32(p+12,n-x),g.write32(p+16,0),g.write32(p+20,1),p+=24,r+=24,E=!1):E||void 0!==g.memory_map_read8[n>>>17]||(x=n,E=!0);g.write32(31788,r)}x=r=0;if(f&65536){n=d[e+12>>2];r=d[e+16>>2];var B=d[e+20>>2];x=d[e+24>>2];E=d[e+28>>2];y(n,8);y(r,8);y(B,8);y(x,8);y(E,8);n=new Uint8Array(a,e-(n-r),0===B?void 0:B-r);g.write_blob(n,r);r=E|0;x=Math.max(B,x)}else if(1179403647===d[0]){E=new DataView(a);const [C,
627
+ w]=Yc(E,Vc);console.assert(52===w);console.assert(1179403647===C.magic,"Bad magic");console.assert(1===C.class,"Unimplemented: 64 bit elf");console.assert(1===C.data,"Unimplemented: big endian");console.assert(1===C.version0,"Bad version0");console.assert(2===C.type,"Unimplemented type");console.assert(1===C.version1,"Bad version1");console.assert(52===C.ehsize,"Bad header size");console.assert(32===C.phentsize,"Bad program header size");console.assert(40===C.shentsize,"Bad section header size");
628
+ [r]=Zc(new DataView(E.buffer,E.byteOffset+C.phoff,C.phentsize*C.phnum),Wc,C.phnum);Zc(new DataView(E.buffer,E.byteOffset+C.shoff,C.shentsize*C.shnum),Xc,C.shnum);E=C;n=r;r=E.entry;for(B of n)0!==B.type&&(1===B.type?B.paddr+B.memsz<g.memory_size[0]?(B.filesz&&(n=new Uint8Array(a,B.offset,B.filesz),g.write_blob(n,B.paddr)),x=Math.max(x,B.paddr+B.memsz),r===E.entry&&B.vaddr<=r&&B.vaddr+B.memsz>r&&(r=r-B.vaddr+B.paddr)):y(B.paddr):2===B.type||3===B.type||4===B.type||6===B.type||7===B.type||1685382480===
629
+ B.type||1685382481===B.type||1685382482===B.type||1685382483===B.type||y(B.type))}b&&(q|=8,g.write32(31764,1),g.write32(31768,p),B=x,0!==(B&4095)&&(B=(B&-4096)+4096),x=B+b.byteLength,g.write32(p,B),g.write32(p+4,x),g.write32(p+8,0),g.write32(p+12,0),g.write_blob(new Uint8Array(b),B));g.write32(31744,q);g.reg32[3]=31744;g.cr[0]=1;g.protected_mode[0]=1;g.flags[0]=2;g.is_32[0]=1;g.stack_size_32[0]=1;for(p=0;6>p;p++)g.segment_is_null[p]=0,g.segment_offsets[p]=0,g.segment_limits[p]=4294967295,g.sreg[p]=
630
+ 1===p?8:16;g.instruction_pointer[0]=g.get_seg_cs()+r|0;g.update_state_flags();g.dump_state();g.dump_regs_short();return 732803074});this.io.register_write_consecutive(244,this,function(n){console.log("Test exited with code "+y(n,2));throw"HALT";},function(){},function(){},function(){});for(let n=0;15>=n;n++){function p(q){y(n);y(q,2);q?this.device_raise_irq(n):this.device_lower_irq(n)}this.io.register_write(8192+n,this,p,p,p)}const m=new Uint8Array(512);(new Uint16Array(m.buffer))[0]=43605;m[2]=1;
631
+ var h=3;m[h++]=102;m[h++]=229;m[h++]=244;let l=m[h]=0;for(let n=0;n<m.length;n++)l+=m[n];m[h]=-l;return{name:"genroms/multiboot.bin",data:m}}};S.prototype.fill_cmos=function(a,b){var c=b.boot_order||291;a.cmos_write(56,1|c>>4&240);a.cmos_write(61,c&255);a.cmos_write(21,128);a.cmos_write(22,2);c=0;1048576<=this.memory_size[0]&&(c=this.memory_size[0]-1048576>>10,c=Math.min(c,65535));a.cmos_write(23,c&255);a.cmos_write(24,c>>8&255);a.cmos_write(48,c&255);a.cmos_write(49,c>>8&255);c=0;16777216<=this.memory_size[0]&&
632
+ (c=this.memory_size[0]-16777216>>16,c=Math.min(c,65535));a.cmos_write(52,c&255);a.cmos_write(53,c>>8&255);a.cmos_write(91,0);a.cmos_write(92,0);a.cmos_write(93,0);a.cmos_write(20,47);a.cmos_write(95,0);b.fastboot&&a.cmos_write(63,1)};S.prototype.load_bios=function(){var a=this.bios.main,b=this.bios.vga;if(a){var c=new Uint8Array(a);this.write_blob(c,1048576-a.byteLength);if(b){var d=new Uint8Array(b);this.write_blob(d,786432);this.io.mmap_register(4272947200,1048576,function(e){e=e-4272947200|0;return e<
633
+ d.length?d[e]:0},function(){})}this.io.mmap_register(4293918720,1048576,function(e){return this.mem8[e&1048575]}.bind(this),function(e,f){this.mem8[e&1048575]=f}.bind(this))}};S.prototype.codegen_finalize=function(a,b,c,d,e){const f=new Uint8Array(this.wasm_memory.buffer,d>>>0,e>>>0);WebAssembly.instantiate(f,{e:this.jit_imports}).then(g=>{this.wm.wasm_table.set(a+1024,g.instance.exports.f);this.codegen_finalize_finished(a,b,c);this.test_hook_did_finalize_wasm&&this.test_hook_did_finalize_wasm(f)})};
634
+ S.prototype.log_uncompiled_code=function(){};S.prototype.dump_function_code=function(){};S.prototype.run_hardware_timers=function(a,b){const c=this.devices.pit.timer(b,!1),d=this.devices.rtc.timer(b,!1);let e=100,f=100;a&&(e=this.devices.acpi.timer(b),f=this.apic_timer(b));return Math.min(c,d,e,f)};S.prototype.debug_init=function(){};S.prototype.dump_stack=function(){};S.prototype.debug_get_state=function(){};S.prototype.dump_state=function(){};S.prototype.get_regs_short=function(){};S.prototype.dump_regs_short=
635
+ function(){};S.prototype.dump_gdt_ldt=function(){};S.prototype.dump_idt=function(){};S.prototype.dump_page_structures=function(){if(this.cr[4]&32)for(var a=0;4>a;a++){var b=this.read32s(this.cr[3]+8*a);b&1&&this.dump_page_directory(b&4294963200,!0,a<<30)}else this.dump_page_directory(this.cr[3],!1,0)};S.prototype.dump_page_directory=function(){};S.prototype.get_memory_dump=function(){};S.prototype.memory_hex_dump=function(){};S.prototype.used_memory_dump=function(){};S.prototype.debug_interrupt=function(){};
636
+ S.prototype.debug_dump_code=function(){};S.prototype.dump_wasm=function(){};function Oc(a,b){this.cpu=a;this.pci=a.devices.pci;this.device_id=b.device_id;this.pci_space=[244,26,b.device_id&255,b.device_id>>8,7,5,16,0,1,0,2,0,0,0,0,0,1,168,0,0,0,16,191,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,244,26,b.subsystem_device_id&255,b.subsystem_device_id>>8,0,0,0,0,64,0,0,0,0,0,0,0,0,1,0,0];this.pci_space=this.pci_space.concat(Array(256-this.pci_space.length).fill(0));this.pci_id=b.pci_id;this.pci_bars=
637
+ [];this.name=b.name;this.driver_feature_select=this.device_feature_select=0;this.device_feature=new Uint32Array(4);this.driver_feature=new Uint32Array(4);for(var c of b.common.features)this.device_feature[c>>>5]|=1<<(c&31),this.driver_feature[c>>>5]|=1<<(c&31);b.common.features.includes(32);this.features_ok=!0;this.device_status=0;this.config_has_changed=!1;this.config_generation=0;this.queues=[];for(const d of b.common.queues)this.queues.push(new Z(a,this,d));this.queue_select=0;this.queue_selected=
638
+ this.queues[0];this.isr_status=0;c=[];c.push(this.create_common_capability(b.common));c.push(this.create_notification_capability(b.notification));c.push(this.create_isr_capability(b.isr_status));b.device_specific&&c.push(this.create_device_specific_capability(b.device_specific));this.init_capabilities(c);a.devices.pci.register_device(this);this.reset()}Oc.prototype.create_common_capability=function(a){return{type:1,bar:0,port:a.initial_port,use_mmio:!1,offset:0,extra:new Uint8Array(0),struct:[{bytes:4,
639
+ name:"device_feature_select",read:()=>this.device_feature_select,write:b=>{this.device_feature_select=b}},{bytes:4,name:"device_feature",read:()=>this.device_feature[this.device_feature_select]||0,write:()=>{}},{bytes:4,name:"driver_feature_select",read:()=>this.driver_feature_select,write:b=>{this.driver_feature_select=b}},{bytes:4,name:"driver_feature",read:()=>this.driver_feature[this.driver_feature_select]||0,write:b=>{const c=this.device_feature[this.driver_feature_select];this.driver_feature_select<
640
+ this.driver_feature.length&&(this.driver_feature[this.driver_feature_select]=b&c);this.features_ok=this.features_ok&&!(b&~c)}},{bytes:2,name:"msix_config",read:()=>65535,write:()=>{}},{bytes:2,name:"num_queues",read:()=>this.queues.length,write:()=>{}},{bytes:1,name:"device_status",read:()=>this.device_status,write:b=>{0===b&&this.reset();b&~this.device_status&4&&this.device_status&64&&this.notify_config_changes();this.features_ok||(b&=-9);this.device_status=b;if(b&~this.device_status&4)a.on_driver_ok()}},
641
+ {bytes:1,name:"config_generation",read:()=>this.config_generation,write:()=>{}},{bytes:2,name:"queue_select",read:()=>this.queue_select,write:b=>{this.queue_select=b;this.queue_selected=this.queue_select<this.queues.length?this.queues[this.queue_select]:null}},{bytes:2,name:"queue_size",read:()=>this.queue_selected?this.queue_selected.size:0,write:b=>{this.queue_selected&&(b&b-1&&(b=1<<da(b-1)+1),b>this.queue_selected.size_supported&&(b=this.queue_selected.size_supported),this.queue_selected.set_size(b))}},
642
+ {bytes:2,name:"queue_msix_vector",read:()=>65535,write:()=>{}},{bytes:2,name:"queue_enable",read:()=>this.queue_selected?this.queue_selected.enabled|0:0,write:b=>{this.queue_selected&&1===b&&this.queue_selected.is_configured()&&this.queue_selected.enable()}},{bytes:2,name:"queue_notify_off",read:()=>this.queue_selected?this.queue_selected.notify_offset:0,write:()=>{}},{bytes:4,name:"queue_desc (low dword)",read:()=>this.queue_selected?this.queue_selected.desc_addr:0,write:b=>{this.queue_selected&&
643
+ (this.queue_selected.desc_addr=b)}},{bytes:4,name:"queue_desc (high dword)",read:()=>0,write:()=>{}},{bytes:4,name:"queue_avail (low dword)",read:()=>this.queue_selected?this.queue_selected.avail_addr:0,write:b=>{this.queue_selected&&(this.queue_selected.avail_addr=b)}},{bytes:4,name:"queue_avail (high dword)",read:()=>0,write:()=>{}},{bytes:4,name:"queue_used (low dword)",read:()=>this.queue_selected?this.queue_selected.used_addr:0,write:b=>{this.queue_selected&&(this.queue_selected.used_addr=b)}},
644
+ {bytes:4,name:"queue_used (high dword)",read:()=>0,write:()=>{}}]}};Oc.prototype.create_notification_capability=function(a){const b=[];let c;c=a.single_handler?0:2;for(const [d,e]of a.handlers.entries())b.push({bytes:2,name:"notify"+d,read:()=>65535,write:e||(()=>{})});return{type:2,bar:1,port:a.initial_port,use_mmio:!1,offset:0,extra:new Uint8Array([c&255,c>>8&255,c>>16&255,c>>24]),struct:b}};Oc.prototype.create_isr_capability=function(a){return{type:3,bar:2,port:a.initial_port,use_mmio:!1,offset:0,
645
+ extra:new Uint8Array(0),struct:[{bytes:1,name:"isr_status",read:()=>{const b=this.isr_status;this.lower_irq();return b},write:()=>{}}]}};Oc.prototype.create_device_specific_capability=function(a){return{type:4,bar:3,port:a.initial_port,use_mmio:!1,offset:0,extra:new Uint8Array(0),struct:a.struct}};Oc.prototype.init_capabilities=function(a){let b=this.pci_space[52]=64;var c=b;for(const e of a){a=16+e.extra.length;c=b;b=c+a;var d=e.struct.reduce((f,g)=>f+g.bytes,0);d+=e.offset;d=16>d?16:1<<da(d-1)+
646
+ 1;this.pci_bars[e.bar]={size:d};this.pci_space[c]=9;this.pci_space[c+1]=b;this.pci_space[c+2]=a;this.pci_space[c+3]=e.type;this.pci_space[c+4]=e.bar;this.pci_space[c+5]=0;this.pci_space[c+6]=0;this.pci_space[c+7]=0;this.pci_space[c+8]=e.offset&255;this.pci_space[c+9]=e.offset>>>8&255;this.pci_space[c+10]=e.offset>>>16&255;this.pci_space[c+11]=e.offset>>>24;this.pci_space[c+12]=d&255;this.pci_space[c+13]=d>>>8&255;this.pci_space[c+14]=d>>>16&255;this.pci_space[c+15]=d>>>24;for(const [f,g]of e.extra.entries())this.pci_space[c+
647
+ 16+f]=g;c=16+4*e.bar;this.pci_space[c]=e.port&254|!e.use_mmio;this.pci_space[c+1]=e.port>>>8&255;this.pci_space[c+2]=e.port>>>16&255;this.pci_space[c+3]=e.port>>>24&255;c=e.port+e.offset;for(const f of e.struct){let g=f.read;a=f.write;if(!e.use_mmio){d=function(l){return g(l&-2)>>((l&1)<<3)&255};const h=function(l){return g(l&-4)>>((l&3)<<3)&255},m=function(l){return g(l)};switch(f.bytes){case 4:this.cpu.io.register_read(c,this,h,void 0,g);this.cpu.io.register_read(c+1,this,h);this.cpu.io.register_read(c+
648
+ 2,this,h);this.cpu.io.register_read(c+3,this,h);this.cpu.io.register_write(c,this,void 0,void 0,a);break;case 2:this.cpu.io.register_read(c,this,d,g,m);this.cpu.io.register_read(c+1,this,d);this.cpu.io.register_write(c,this,void 0,a);break;case 1:this.cpu.io.register_read(c,this,g),this.cpu.io.register_write(c,this,a)}}c+=f.bytes}}this.pci_space[b]=9;this.pci_space[b+1]=0;this.pci_space[b+2]=20;this.pci_space[b+3]=5;this.pci_space[b+4]=0;this.pci_space[b+5]=0;this.pci_space[b+6]=0;this.pci_space[b+
649
+ 7]=0;this.pci_space[b+8]=0;this.pci_space[b+9]=0;this.pci_space[b+10]=0;this.pci_space[b+11]=0;this.pci_space[b+12]=0;this.pci_space[b+13]=0;this.pci_space[b+14]=0;this.pci_space[b+15]=0;this.pci_space[b+16]=0;this.pci_space[b+17]=0;this.pci_space[b+18]=0;this.pci_space[b+19]=0};Oc.prototype.get_state=function(){let a=[];a[0]=this.device_feature_select;a[1]=this.driver_feature_select;a[2]=this.device_feature;a[3]=this.driver_feature;a[4]=this.features_ok;a[5]=this.device_status;a[6]=this.config_has_changed;
650
+ a[7]=this.config_generation;a[8]=this.isr_status;a[9]=this.queue_select;return a=a.concat(this.queues)};Oc.prototype.set_state=function(a){this.device_feature_select=a[0];this.driver_feature_select=a[1];this.device_feature=a[2];this.driver_feature=a[3];this.features_ok=a[4];this.device_status=a[5];this.config_has_changed=a[6];this.config_generation=a[7];this.isr_status=a[8];this.queue_select=a[9];let b=0;for(const c of a.slice(10))this.queues[b].set_state(c),b++;this.queue_selected=this.queues[this.queue_select]||
651
+ null};Oc.prototype.reset=function(){this.driver_feature_select=this.device_feature_select=0;this.driver_feature.set(this.device_feature);this.features_ok=!0;this.queue_select=this.device_status=0;this.queue_selected=this.queues[0];for(const a of this.queues)a.reset();this.config_has_changed=!1;this.config_generation=0;this.lower_irq()};Oc.prototype.notify_config_changes=function(){this.config_has_changed=!0;this.device_status&4&&this.raise_irq(2)};Oc.prototype.update_config_generation=function(){this.config_has_changed&&
652
+ (this.config_generation++,this.config_generation&=255,this.config_has_changed=!1)};Oc.prototype.is_feature_negotiated=function(a){return 0<(this.driver_feature[a>>>5]&1<<(a&31))};Oc.prototype.needs_reset=function(){this.device_status|=64;this.device_status&4&&this.notify_config_changes()};Oc.prototype.raise_irq=function(a){y(a);this.isr_status|=a;this.pci.raise_irq(this.pci_id)};Oc.prototype.lower_irq=function(){this.isr_status=0;this.pci.lower_irq(this.pci_id)};function Z(a,b,c){this.cpu=a;this.virtio=
653
+ b;this.size_supported=this.size=c.size_supported;this.mask=this.size-1;this.enabled=!1;this.notify_offset=c.notify_offset;this.num_staged_replies=this.used_addr=this.avail_last_idx=this.avail_addr=this.desc_addr=0;this.reset()}Z.prototype.get_state=function(){const a=[];a[0]=this.size;a[1]=this.size_supported;a[2]=this.enabled;a[3]=this.notify_offset;a[4]=this.desc_addr;a[5]=this.avail_addr;a[6]=this.avail_last_idx;a[7]=this.used_addr;a[8]=this.num_staged_replies;a[9]=1;return a};Z.prototype.set_state=
654
+ function(a){this.size=a[0];this.size_supported=a[1];this.enabled=a[2];this.notify_offset=a[3];this.desc_addr=a[4];this.avail_addr=a[5];this.avail_last_idx=a[6];this.used_addr=a[7];this.num_staged_replies=a[8];this.mask=this.size-1;this.fix_wrapping=1!==a[9]};Z.prototype.reset=function(){this.enabled=!1;this.num_staged_replies=this.used_addr=this.avail_last_idx=this.avail_addr=this.desc_addr=0;this.set_size(this.size_supported)};Z.prototype.is_configured=function(){return this.desc_addr&&this.avail_addr&&
655
+ this.used_addr};Z.prototype.enable=function(){this.is_configured();this.enabled=!0};Z.prototype.set_size=function(a){this.size=a;this.mask=a-1};Z.prototype.count_requests=function(){this.fix_wrapping&&(this.fix_wrapping=!1,this.avail_last_idx=(this.avail_get_idx()&~this.mask)+(this.avail_last_idx&this.mask));return this.avail_get_idx()-this.avail_last_idx&65535};Z.prototype.has_request=function(){return 0!==this.count_requests()};Z.prototype.pop_request=function(){this.has_request();var a=this.avail_get_entry(this.avail_last_idx);
656
+ a=new od(this,a);this.avail_last_idx=this.avail_last_idx+1&65535;return a};Z.prototype.push_reply=function(a){const b=this.used_get_idx()+this.num_staged_replies&this.mask;this.used_set_entry(b,a.head_idx,a.length_written);this.num_staged_replies++};Z.prototype.flush_replies=function(){if(0!==this.num_staged_replies){var a=this.used_get_idx()+this.num_staged_replies&65535;this.used_set_idx(a);this.num_staged_replies=0;this.virtio.is_feature_negotiated(29)?(this.avail_get_used_event(),this.virtio.raise_irq(1)):
657
+ ~this.avail_get_flags()&1&&this.virtio.raise_irq(1)}};Z.prototype.notify_me_after=function(a){a=this.avail_get_idx()+a&65535;this.used_set_avail_event(a)};Z.prototype.get_descriptor=function(a,b){return{addr_low:this.cpu.read32s(a+16*b),addr_high:this.cpu.read32s(a+16*b+4),len:this.cpu.read32s(a+16*b+8),flags:this.cpu.read16(a+16*b+12),next:this.cpu.read16(a+16*b+14)}};Z.prototype.avail_get_flags=function(){return this.cpu.read16(this.avail_addr)};Z.prototype.avail_get_idx=function(){return this.cpu.read16(this.avail_addr+
658
658
  2)};Z.prototype.avail_get_entry=function(a){return this.cpu.read16(this.avail_addr+4+2*(a&this.mask))};Z.prototype.avail_get_used_event=function(){return this.cpu.read16(this.avail_addr+4+2*this.size)};Z.prototype.used_get_flags=function(){return this.cpu.read16(this.used_addr)};Z.prototype.used_set_flags=function(a){this.cpu.write16(this.used_addr,a)};Z.prototype.used_get_idx=function(){return this.cpu.read16(this.used_addr+2)};Z.prototype.used_set_idx=function(a){this.cpu.write16(this.used_addr+
659
659
  2,a)};Z.prototype.used_set_entry=function(a,b,c){this.cpu.write32(this.used_addr+4+8*a,b);this.cpu.write32(this.used_addr+8+8*a,c)};Z.prototype.used_set_avail_event=function(a){this.cpu.write16(this.used_addr+4+8*this.size,a)};function od(a,b){this.cpu=a.cpu;this.virtio=a.virtio;this.head_idx=b;this.read_buffers=[];this.length_readable=this.read_buffer_offset=this.read_buffer_idx=0;this.write_buffers=[];this.length_writable=this.length_written=this.write_buffer_offset=this.write_buffer_idx=0;let c=
660
660
  a.desc_addr,d=0,e=a.size,f=!1;const g=this.virtio.is_feature_negotiated(28);do{const h=a.get_descriptor(c,b);y(h.addr_high,8);y(h.addr_low,8);y(h.len,8);y(h.flags,4);y(h.next,4);if(g&&h.flags&4)c=h.addr_low,d=b=0,e=h.len/16;else{if(h.flags&2)f=!0,this.write_buffers.push(h),this.length_writable+=h.len;else{if(f)break;this.read_buffers.push(h);this.length_readable+=h.len}d++;if(d>e)break;if(h.flags&1)b=h.next;else break}}while(1)}od.prototype.get_next_blob=function(a){let b=0,c=a.length;for(;c&&this.read_buffer_idx!==
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "v86",
3
- "version": "0.5.442+gdfa6296",
3
+ "version": "0.5.443+g7e6be1e",
4
4
  "license": "BSD-2-Clause",
5
5
  "description": "x86 PC emulator and x86-to-wasm JIT, running in the browser",
6
6
  "homepage": "https://copy.sh/v86/",
package/v86.d.ts CHANGED
@@ -563,6 +563,12 @@ export interface V86Options {
563
563
  */
564
564
  fastboot?: boolean;
565
565
 
566
+ /**
567
+ * Enable the boot menu (seabios)
568
+ * @default false
569
+ */
570
+ bootmenu?: boolean;
571
+
566
572
  /**
567
573
  * Create a virtio balloon device
568
574
  * @default false