floppy-insert-eject.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/env node
  2. "use strict";
  3. const TEST_RELEASE_BUILD = +process.env.TEST_RELEASE_BUILD;
  4. const fs = require("fs");
  5. var V86 = require(`../../build/${TEST_RELEASE_BUILD ? "libv86" : "libv86-debug"}.js`).V86;
  6. process.on("unhandledRejection", exn => { throw exn; });
  7. const emulator = new V86({
  8. bios: { url: __dirname + "/../../bios/seabios.bin" },
  9. vga_bios: { url: __dirname + "/../../bios/vgabios.bin" },
  10. hda: { url: __dirname + "/../../images/msdos.img" },
  11. network_relay_url: "<UNUSED>",
  12. autostart: true,
  13. memory_size: 32 * 1024 * 1024,
  14. filesystem: {},
  15. log_level: 0,
  16. disable_jit: +process.env.DISABLE_JIT,
  17. screen_dummy: true,
  18. });
  19. emulator.automatically([
  20. { sleep: 1 },
  21. { vga_text: "C:\\> " },
  22. { keyboard_send: "dir A:\n" },
  23. { vga_text: "Abort, Retry, Fail?" },
  24. { keyboard_send: "F" },
  25. { call: () => {
  26. emulator.set_fda({ url: __dirname + "/../../images/freedos722.img" });
  27. },
  28. },
  29. { keyboard_send: "dir A:\n" },
  30. { sleep: 1 },
  31. { vga_text: "FDOS <DIR>" },
  32. { call: () => {
  33. console.log("Passed");
  34. emulator.stop();
  35. }
  36. },
  37. ]);