debug.html 13 KB

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