debug.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <!doctype html>
  2. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  3. <title>Virtual x86 (debug)</title>
  4. <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
  5. <script>
  6. "use strict";
  7. var CORE_FILES =
  8. "const.js config.js log.js lib.js buffer.js cpu.js debug.js " +
  9. "io.js main.js ide.js pci.js floppy.js " +
  10. "memory.js dma.js pit.js vga.js ps2.js pic.js rtc.js uart.js acpi.js apic.js ioapic.js hpet.js sb16.js " +
  11. "ne2k.js state.js virtio.js bus.js elf.js kernel.js";
  12. var BROWSER_FILES = "main.js screen.js keyboard.js mouse.js speaker.js serial.js network.js starter.js worker_bus.js print_stats.js filestorage.js";
  13. var LIB_FILES = "";
  14. // jor1k stuff
  15. LIB_FILES += " jor1k.js 9p.js filesystem.js marshall.js utf8.js";
  16. var BUILD_FILES = "capstone-x86.min.js libwabt.js";
  17. var to_load = [];
  18. load_scripts(CORE_FILES, "src/");
  19. load_scripts(BROWSER_FILES, "src/browser/");
  20. load_scripts(LIB_FILES, "lib/");
  21. load_scripts(BUILD_FILES, "build/");
  22. function load_scripts(resp, path)
  23. {
  24. var files = resp.split(" ");
  25. for(var i = 0; i < files.length; i++)
  26. {
  27. if(!files[i])
  28. {
  29. continue;
  30. }
  31. to_load.push(path + files[i]);
  32. }
  33. }
  34. load_next();
  35. function load_next()
  36. {
  37. let s = to_load.shift();
  38. if(!s)
  39. {
  40. return;
  41. }
  42. var script = document.createElement("script");
  43. script.src = s;
  44. script.onload = load_next;
  45. script.onerror = function() {
  46. console.warn("trying to ignore script " + s + ", which failed to load");
  47. load_next();
  48. };
  49. document.head.appendChild(script);
  50. }
  51. </script>
  52. <link rel="stylesheet" href="v86.css">
  53. <div>
  54. <div id="boot_options">
  55. <h4>Debugger</h4>
  56. <input type="button" value="ReactOS" id="start_reactos">
  57. <input type="button" value="ReactOS (boot)" id="start_reactos-boot">
  58. <input type="button" value="Hiren's Boot CD" id="start_hirens">
  59. <br>
  60. <input type="button" value="MS-DOS" id="start_msdos">
  61. <input type="button" value="FreeDOS" id="start_freedos">
  62. <input type="button" value="FreeDOS with FreeGEM" id="start_freegem">
  63. <input type="button" value="FreeDOS CD with games" id="start_fdgame">
  64. <input type="button" value="FreeDOS with QBasic" id="start_qbasic">
  65. <br>
  66. <input type="button" value="Windows 1.01" id="start_windows1">
  67. <input type="button" value="Windows 3.0" id="start_windows30">
  68. <input type="button" value="Windows 3.1" id="start_windows31">
  69. <input type="button" value="Windows 95" id="start_windows95">
  70. <input type="button" value="Windows 95 (boot)" id="start_windows95-boot">
  71. <br>
  72. <input type="button" value="Windows 98" id="start_windows98">
  73. <input type="button" value="Windows 98 (boot)" id="start_windows98-boot">
  74. <input type="button" value="Windows NT 3.1" id="start_windowsnt3">
  75. <input type="button" value="Windows NT 4.0" id="start_windowsnt4">
  76. <input type="button" value="Windows 2000" id="start_windows2000">
  77. <input type="button" value="Windows 2000 (boot)" id="start_windows2000-boot">
  78. <br>
  79. <input type="button" value="Linux 2.6 (Buildroot)" id="start_linux26">
  80. <input type="button" value="Linux 3.18 (Buildroot)" id="start_linux3">
  81. <input type="button" value="Linux 4.16 (Buildroot)" id="start_linux4">
  82. <input type="button" value="Linux 5.6 (Buildroot)" id="start_buildroot">
  83. <input type="button" value="Tiny Core" id="start_tinycore">
  84. <input type="button" value="OpenWRT" id="start_openwrt">
  85. <br>
  86. <input type="button" value="Arch Linux" id="start_archlinux">
  87. <input type="button" value="Arch Linux (boot)" id="start_archlinux-boot">
  88. <input type="button" value="Damn Small Linux" id="start_dsl">
  89. <br>
  90. <input type="button" value="FreeBSD" id="start_freebsd">
  91. <input type="button" value="FreeBSD (boot)" id="start_freebsd-boot">
  92. <input type="button" value="OpenBSD" id="start_openbsd">
  93. <input type="button" value="NetBSD" id="start_netbsd">
  94. <br>
  95. <input type="button" value="Haiku" id="start_haiku">
  96. <input type="button" value="Haiku (boot)" id="start_haiku-boot">
  97. <input type="button" value="Minix" id="start_minix">
  98. <input type="button" value="SerenityOS" id="start_serenity">
  99. <input type="button" value="QNX" id="start_qnx">
  100. <input type="button" value="9front" id="start_9front">
  101. <br>
  102. <input type="button" value="Oberon" id="start_oberon">
  103. <input type="button" value="KolibriOS" id="start_kolibrios">
  104. <input type="button" value="Solar OS" id="start_solos">
  105. <input type="button" value="Bootchess" id="start_bootchess">
  106. <input type="button" value="HelenOS" id="start_helenos">
  107. <input type="button" value="MikeOS" id="start_mikeos">
  108. <br>
  109. <!--
  110. <hr>
  111. Restore state: <input type="file" id="restore_state">
  112. -->
  113. <br>
  114. <hr>
  115. <table>
  116. <tr>
  117. <td width="350"><label for="cd_image">CD image</label></td>
  118. <td>
  119. <input type="file" id="cd_image">
  120. </td>
  121. </tr>
  122. <tr>
  123. <td><label for="floppy_image">Floppy disk image</label></td>
  124. <td> <input type="file" id="floppy_image"><br></td>
  125. </tr>
  126. <tr>
  127. <td><label for="hda_image">Hard drive disk image</label></td>
  128. <td><input type="file" id="hda_image"><br></td>
  129. </tr>
  130. <tr>
  131. <td>Second hard drive disk image</td>
  132. <td><input type="file" id="hdb_image"><br></td>
  133. </tr>
  134. <tr>
  135. <td><label for="multiboot_image">Multiboot kernel image (experimental)</label></td>
  136. <td><input type="file" id="multiboot_image"><br></td>
  137. </tr>
  138. <tr>
  139. <td><label for="bzimage">Kernel image (bzimage)</label></td>
  140. <td><input type="file" id="bzimage"><br></td>
  141. </tr>
  142. <tr>
  143. <td><label for="initrd">initrd</label></td>
  144. <td><input type="file" id="initrd"><br></td>
  145. </tr>
  146. <tr>
  147. <td colspan="2"><small>Disk images are not uploaded to the server</small><hr></td>
  148. </tr>
  149. <tr>
  150. <td><label for="memory_size">Memory size</label></td>
  151. <td>
  152. <input id="memory_size" type="number" value="128" min="16" max="2048" step="16"> MB<br>
  153. </td>
  154. </tr>
  155. <tr>
  156. <td><label for="video_memory_size">Video Memory size</label></td>
  157. <td>
  158. <input id="video_memory_size" type="number" value="8" min="1" max="128" step="1"> MB<br>
  159. </td>
  160. </tr>
  161. <tr>
  162. <td><label for="networking_proxy">Networking proxy (leave blank to disable)</label></td>
  163. <td>
  164. <input id="networking_proxy" type="text" value="wss://relay.widgetry.org/">
  165. </td>
  166. </tr>
  167. <tr>
  168. <td colspan="2"><hr></td>
  169. </tr>
  170. <tr>
  171. <td><label for="disable_audio">Disable audio</label></td>
  172. <td>
  173. <input id="disable_audio" type="checkbox"><br>
  174. </td>
  175. </tr>
  176. <tr>
  177. <td><label for="enable_acpi">Enable ACPI (experimental)</label></td>
  178. <td>
  179. <input id="enable_acpi" type="checkbox"><br>
  180. </td>
  181. </tr>
  182. <tr>
  183. <td colspan="2"><hr></td>
  184. </tr>
  185. <tr>
  186. <td><label for="boot_order">Boot order</label></td>
  187. <td>
  188. <select id="boot_order">
  189. <option value="213">CD / Floppy / Hard Disk</option>
  190. <option value="123">CD / Hard Disk / Floppy</option>
  191. <option value="231">Floppy / CD / Hard Disk</option>
  192. <option value="321">Floppy / Hard Disk / CD</option>
  193. <option value="312">Hard Disk / Floppy / CD</option>
  194. <option value="132">Hard Disk / CD / Floppy</option>
  195. </select>
  196. </td>
  197. </tr>
  198. </table>
  199. <br>
  200. <button id="start_emulation">Start Emulation</button>
  201. <br>
  202. <br>
  203. </div>
  204. <div id="runtime_options" style="display: none">
  205. <input type="button" value="Dump Registers" id="dump_regs">
  206. <input type="button" value="Dump GDT/LDT" id="dump_gdt">
  207. <input type="button" value="Dump IDT" id="dump_idt">
  208. <input type="button" value="Dump page tables" id="dump_pt">
  209. <input type="button" value="Dump log" id="dump_log">
  210. <br>
  211. <input type="button" value="Pause" id="run">
  212. <input type="button" value="Reset" id="reset">
  213. <input type="button" value="Exit" id="exit">
  214. <input type="button" value="Send Ctrl-Alt-Del" id="ctrlaltdel">
  215. <input type="button" value="Send Alt-Tab" id="alttab">
  216. <input type="button" value="Get floppy image" id="get_fda_image">
  217. <input type="button" value="Get second floppy image" id="get_fdb_image">
  218. <input type="button" value="Get hard disk image" id="get_hda_image">
  219. <input type="button" value="Get second hard disk image" id="get_hdb_image">
  220. <input type="button" value="Get cdrom image" id="get_cdrom_image">
  221. <input type="button" value="Save State" id="save_state">
  222. <input type="button" value="Load State" id="load_state"> <input type="file" style="display: none" id="load_state_input">
  223. <input type="button" value="Memory Dump" id="memory_dump">
  224. <input type="button" value="Capture network traffic" id="capture_network_traffic">
  225. <input type="button" value="Disable mouse" id="toggle_mouse">
  226. <input type="button" value="Lock mouse" id="lock_mouse">
  227. <input type="button" value="Go fullscreen" id="fullscreen">
  228. <input type="button" value="Take screenshot" id="take_screenshot">
  229. <input type="button" value="Mute" id="mute">
  230. <label>
  231. Scale:
  232. <input type="number" min="0.25" step="0.25" value="1.0" id="scale" style="width: 50px">
  233. </label>
  234. <br>
  235. <label id="change_fda" style="display: none">
  236. Change floppy:
  237. <input type="file">
  238. </label>
  239. <label id="change_cdrom" style="display: none">
  240. Change CD:
  241. <input type="file">
  242. </label>
  243. </div>
  244. <pre style="margin: 0" id="log_levels"></pre>
  245. <pre style="display: none" id="loading"></pre>
  246. <br>
  247. </div>
  248. <div id="screen_container" style="display: none">
  249. <div id="screen"></div>
  250. <canvas id="vga"></canvas>
  251. <div style="position: absolute; top: 0; z-index: 10">
  252. <textarea class="phone_keyboard"></textarea>
  253. </div>
  254. </div>
  255. <div id="runtime_infos" style="display: none">
  256. Running: <span id="running_time">0s</span> <br>
  257. Speed: <span id="speed">0</span> mIPS<br>
  258. Avg speed: <span id="avg_speed">0</span> mIPS<br>
  259. <br>
  260. <div id="info_storage" style="display: none">
  261. <b>IDE device (HDA or CDROM)</b><br>
  262. Sectors read: <span id="info_storage_sectors_read">0</span><br>
  263. Bytes read: <span id="info_storage_bytes_read">0</span><br>
  264. Sectors written: <span id="info_storage_sectors_written">0</span><br>
  265. Bytes written: <span id="info_storage_bytes_written">0</span><br>
  266. Status: <span id="info_storage_status"></span><br>
  267. <br>
  268. </div>
  269. <div id="info_filesystem" style="display: none">
  270. <b>9p Filesystem</b><br>
  271. Bytes read: <span id="info_filesystem_bytes_read">0</span><br>
  272. Bytes written: <span id="info_filesystem_bytes_written">0</span><br>
  273. <div style="white-space: nowrap; overflow-x: hidden">Last file: <span id="info_filesystem_last_file"></span></div>
  274. Status: <span id="info_filesystem_status"></span><br>
  275. <br>
  276. </div>
  277. <div id="info_network" style="display: none">
  278. <b>Network</b><br>
  279. Bytes received: <span id="info_network_bytes_received">0</span><br>
  280. Bytes transmitted: <span id="info_network_bytes_transmitted">0</span><br>
  281. <br>
  282. </div>
  283. <b>VGA</b><br>
  284. Mode: <span id="info_vga_mode"></span><br>
  285. Resolution: <span id="info_res">-</span><br>
  286. BPP: <span id="info_bpp">-</span><br>
  287. <br>
  288. Mouse: <span id="info_mouse_enabled">No</span><br>
  289. </div>
  290. <div id="filesystem_panel" style="display: none">
  291. <label>
  292. Send files to emulator<br>
  293. <input type="file" id="filesystem_send_file" multiple>
  294. </label>
  295. <br><br>
  296. <label>
  297. Get file from emulator<br>
  298. <input type="text" id="filesystem_get_file" placeholder="Absolute path">
  299. </label>
  300. </div>
  301. <div id="debug_panel" style="display: none">
  302. </div>
  303. <br style="clear: both"><br>
  304. <textarea spellcheck="false" cols="40" rows="12" id="serial" style="display: none">
  305. </textarea>
  306. <div id="terminal"></div>