async_load.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!doctype html>
  2. <title>Asynchronous loading of disk images</title>
  3. <script src="../build/libv86.js"></script>
  4. <script>
  5. "use strict";
  6. window.onload = function()
  7. {
  8. // Async loading of the iso image
  9. // Note how the emulation starts without downloading the 50MB image
  10. // Support of the "Range: bytes=..." header is required on the server, CORS
  11. // is required if the server is on a different host
  12. var emulator = new V86Starter({
  13. wasm_path: "../build/v86.wasm",
  14. memory_size: 64 * 1024 * 1024,
  15. vga_memory_size: 2 * 1024 * 1024,
  16. screen_container: document.getElementById("screen_container"),
  17. bios: {
  18. url: "../bios/seabios.bin",
  19. },
  20. vga_bios: {
  21. url: "../bios/vgabios.bin",
  22. },
  23. cdrom: {
  24. url: "../images/dsl-4.11.rc2.iso",
  25. async: true,
  26. // size can be determined automatically, but costs an extra request
  27. // and might not work reliably
  28. size: 52824064,
  29. },
  30. autostart: true,
  31. });
  32. }
  33. </script>
  34. <div id="screen_container">
  35. <div style="white-space: pre; font: 14px monospace; line-height: 14px"></div>
  36. <canvas style="display: none"></canvas>
  37. </div>