worker.js 514 B

12345678910111213141516171819202122232425262728
  1. importScripts("../build/libv86.js");
  2. var emulator = new V86Starter({
  3. memory_size: 32 * 1024 * 1024,
  4. vga_memory_size: 2 * 1024 * 1024,
  5. bios: {
  6. url: "../bios/seabios.bin",
  7. },
  8. vga_bios: {
  9. url: "../bios/vgabios.bin",
  10. },
  11. cdrom: {
  12. url: "../images/linux.iso",
  13. },
  14. autostart: true,
  15. });
  16. emulator.add_listener("serial0-output-char", function(chr)
  17. {
  18. this.postMessage(chr);
  19. }.bind(this));
  20. this.onmessage = function(e)
  21. {
  22. emulator.serial0_send(e.data);
  23. };