v86 0.3.6 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/Readme.md +17 -6
  2. package/bios/seabios/.config +113 -0
  3. package/bios/seabios/.config.old +114 -0
  4. package/bios/seabios/.gitignore +4 -0
  5. package/bios/seabios/COPYING +674 -0
  6. package/bios/seabios/COPYING.LESSER +165 -0
  7. package/bios/seabios/Makefile +286 -0
  8. package/bios/seabios/README +17 -0
  9. package/bios/seabios/docs/Build_overview.md +104 -0
  10. package/bios/seabios/docs/Contributing.md +20 -0
  11. package/bios/seabios/docs/Debugging.md +111 -0
  12. package/bios/seabios/docs/Developer_Documentation.md +25 -0
  13. package/bios/seabios/docs/Developer_links.md +86 -0
  14. package/bios/seabios/docs/Download.md +27 -0
  15. package/bios/seabios/docs/Execution_and_code_flow.md +178 -0
  16. package/bios/seabios/docs/Linking_overview.md +160 -0
  17. package/bios/seabios/docs/Mailinglist.md +8 -0
  18. package/bios/seabios/docs/Memory_Model.md +253 -0
  19. package/bios/seabios/docs/README +5 -0
  20. package/bios/seabios/docs/Releases.md +482 -0
  21. package/bios/seabios/docs/Runtime_config.md +193 -0
  22. package/bios/seabios/docs/SeaBIOS.md +17 -0
  23. package/bios/seabios/docs/SeaVGABIOS.md +39 -0
  24. package/bios/seabios/out/autoconf.h +117 -0
  25. package/bios/seabios/out/include/config/acpi/dsdt.h +0 -0
  26. package/bios/seabios/out/include/config/acpi.h +0 -0
  27. package/bios/seabios/out/include/config/ahci.h +0 -0
  28. package/bios/seabios/out/include/config/apmbios.h +0 -0
  29. package/bios/seabios/out/include/config/ata/dma.h +0 -0
  30. package/bios/seabios/out/include/config/ata/pio32.h +0 -0
  31. package/bios/seabios/out/include/config/ata.h +0 -0
  32. package/bios/seabios/out/include/config/auto.conf +69 -0
  33. package/bios/seabios/out/include/config/auto.conf.cmd +9 -0
  34. package/bios/seabios/out/include/config/boot.h +0 -0
  35. package/bios/seabios/out/include/config/bootorder.h +0 -0
  36. package/bios/seabios/out/include/config/build/vgabios.h +0 -0
  37. package/bios/seabios/out/include/config/call32/smm.h +0 -0
  38. package/bios/seabios/out/include/config/cdrom/boot.h +0 -0
  39. package/bios/seabios/out/include/config/cdrom/emu.h +0 -0
  40. package/bios/seabios/out/include/config/debug/level.h +0 -0
  41. package/bios/seabios/out/include/config/drives.h +0 -0
  42. package/bios/seabios/out/include/config/entry/extrastack.h +0 -0
  43. package/bios/seabios/out/include/config/esp/scsi.h +0 -0
  44. package/bios/seabios/out/include/config/flash/floppy.h +0 -0
  45. package/bios/seabios/out/include/config/floppy.h +0 -0
  46. package/bios/seabios/out/include/config/fw/romfile/load.h +0 -0
  47. package/bios/seabios/out/include/config/hardware/irq.h +0 -0
  48. package/bios/seabios/out/include/config/kbd/call/int15/4f.h +0 -0
  49. package/bios/seabios/out/include/config/keyboard.h +0 -0
  50. package/bios/seabios/out/include/config/lpt.h +0 -0
  51. package/bios/seabios/out/include/config/lsi/scsi.h +0 -0
  52. package/bios/seabios/out/include/config/malloc/uppermemory.h +0 -0
  53. package/bios/seabios/out/include/config/megasas.h +0 -0
  54. package/bios/seabios/out/include/config/mouse.h +0 -0
  55. package/bios/seabios/out/include/config/mpt/scsi.h +0 -0
  56. package/bios/seabios/out/include/config/mptable.h +0 -0
  57. package/bios/seabios/out/include/config/mtrr/init.h +0 -0
  58. package/bios/seabios/out/include/config/optionroms.h +0 -0
  59. package/bios/seabios/out/include/config/override/pci/id.h +0 -0
  60. package/bios/seabios/out/include/config/pcibios.h +0 -0
  61. package/bios/seabios/out/include/config/pirtable.h +0 -0
  62. package/bios/seabios/out/include/config/pmm.h +0 -0
  63. package/bios/seabios/out/include/config/pmtimer.h +0 -0
  64. package/bios/seabios/out/include/config/pnpbios.h +0 -0
  65. package/bios/seabios/out/include/config/ps2port.h +0 -0
  66. package/bios/seabios/out/include/config/pvscsi.h +0 -0
  67. package/bios/seabios/out/include/config/qemu/hardware.h +0 -0
  68. package/bios/seabios/out/include/config/qemu.h +0 -0
  69. package/bios/seabios/out/include/config/rom/size.h +0 -0
  70. package/bios/seabios/out/include/config/rtc/timer.h +0 -0
  71. package/bios/seabios/out/include/config/s3/resume.h +0 -0
  72. package/bios/seabios/out/include/config/sdcard.h +0 -0
  73. package/bios/seabios/out/include/config/serial.h +0 -0
  74. package/bios/seabios/out/include/config/tcgbios.h +0 -0
  75. package/bios/seabios/out/include/config/threads.h +0 -0
  76. package/bios/seabios/out/include/config/tristate.conf +4 -0
  77. package/bios/seabios/out/include/config/tsc/timer.h +0 -0
  78. package/bios/seabios/out/include/config/use/smm.h +0 -0
  79. package/bios/seabios/out/include/config/vga/allocate/extra/stack.h +0 -0
  80. package/bios/seabios/out/include/config/vga/bochs/stdvga.h +0 -0
  81. package/bios/seabios/out/include/config/vga/bochs.h +0 -0
  82. package/bios/seabios/out/include/config/vga/did.h +0 -0
  83. package/bios/seabios/out/include/config/vga/extra/stack/size.h +0 -0
  84. package/bios/seabios/out/include/config/vga/fixup/asm.h +0 -0
  85. package/bios/seabios/out/include/config/vga/pci.h +0 -0
  86. package/bios/seabios/out/include/config/vga/stdvga/ports.h +0 -0
  87. package/bios/seabios/out/include/config/vga/vbe.h +0 -0
  88. package/bios/seabios/out/include/config/vga/vid.h +0 -0
  89. package/bios/seabios/out/include/config/vgahooks.h +0 -0
  90. package/bios/seabios/out/include/config/virtio/blk.h +0 -0
  91. package/bios/seabios/out/include/config/virtio/scsi.h +0 -0
  92. package/bios/seabios/out/include/config/xen.h +0 -0
  93. package/bios/seabios/out/scripts/kconfig/conf +0 -0
  94. package/bios/seabios/out/scripts/kconfig/conf.o +0 -0
  95. package/bios/seabios/out/scripts/kconfig/zconf.hash.c +289 -0
  96. package/bios/seabios/out/scripts/kconfig/zconf.lex.c +2420 -0
  97. package/bios/seabios/out/scripts/kconfig/zconf.tab.c +2538 -0
  98. package/bios/seabios/out/scripts/kconfig/zconf.tab.o +0 -0
  99. package/bios/seabios/scripts/acpi_extract.py +366 -0
  100. package/bios/seabios/scripts/acpi_extract_preprocess.py +41 -0
  101. package/bios/seabios/scripts/buildrom.py +56 -0
  102. package/bios/seabios/scripts/buildversion.py +134 -0
  103. package/bios/seabios/scripts/checkrom.py +95 -0
  104. package/bios/seabios/scripts/checkstack.py +226 -0
  105. package/bios/seabios/scripts/checksum.py +16 -0
  106. package/bios/seabios/scripts/encodeint.py +21 -0
  107. package/bios/seabios/scripts/gen-offsets.sh +17 -0
  108. package/bios/seabios/scripts/kconfig/.gitignore +22 -0
  109. package/bios/seabios/scripts/kconfig/Makefile +331 -0
  110. package/bios/seabios/scripts/kconfig/POTFILES.in +12 -0
  111. package/bios/seabios/scripts/kconfig/check.sh +13 -0
  112. package/bios/seabios/scripts/kconfig/conf.c +718 -0
  113. package/bios/seabios/scripts/kconfig/confdata.c +1250 -0
  114. package/bios/seabios/scripts/kconfig/expr.c +1168 -0
  115. package/bios/seabios/scripts/kconfig/expr.h +241 -0
  116. package/bios/seabios/scripts/kconfig/gconf.c +1542 -0
  117. package/bios/seabios/scripts/kconfig/gconf.glade +661 -0
  118. package/bios/seabios/scripts/kconfig/images.c +326 -0
  119. package/bios/seabios/scripts/kconfig/kxgettext.c +235 -0
  120. package/bios/seabios/scripts/kconfig/lex.zconf.c +2430 -0
  121. package/bios/seabios/scripts/kconfig/list.h +131 -0
  122. package/bios/seabios/scripts/kconfig/lkc.h +200 -0
  123. package/bios/seabios/scripts/kconfig/lkc_proto.h +57 -0
  124. package/bios/seabios/scripts/kconfig/lxdialog/.gitignore +4 -0
  125. package/bios/seabios/scripts/kconfig/lxdialog/BIG.FAT.WARNING +4 -0
  126. package/bios/seabios/scripts/kconfig/lxdialog/check-lxdialog.sh +87 -0
  127. package/bios/seabios/scripts/kconfig/lxdialog/checklist.c +332 -0
  128. package/bios/seabios/scripts/kconfig/lxdialog/dialog.h +257 -0
  129. package/bios/seabios/scripts/kconfig/lxdialog/inputbox.c +301 -0
  130. package/bios/seabios/scripts/kconfig/lxdialog/menubox.c +437 -0
  131. package/bios/seabios/scripts/kconfig/lxdialog/textbox.c +408 -0
  132. package/bios/seabios/scripts/kconfig/lxdialog/util.c +713 -0
  133. package/bios/seabios/scripts/kconfig/lxdialog/yesno.c +114 -0
  134. package/bios/seabios/scripts/kconfig/mconf.c +1036 -0
  135. package/bios/seabios/scripts/kconfig/menu.c +697 -0
  136. package/bios/seabios/scripts/kconfig/merge_config.sh +150 -0
  137. package/bios/seabios/scripts/kconfig/nconf.c +1556 -0
  138. package/bios/seabios/scripts/kconfig/nconf.gui.c +656 -0
  139. package/bios/seabios/scripts/kconfig/nconf.h +96 -0
  140. package/bios/seabios/scripts/kconfig/qconf.cc +1795 -0
  141. package/bios/seabios/scripts/kconfig/qconf.h +338 -0
  142. package/bios/seabios/scripts/kconfig/streamline_config.pl +647 -0
  143. package/bios/seabios/scripts/kconfig/symbol.c +1373 -0
  144. package/bios/seabios/scripts/kconfig/util.c +157 -0
  145. package/bios/seabios/scripts/kconfig/zconf.gperf +48 -0
  146. package/bios/seabios/scripts/kconfig/zconf.hash.c_shipped +289 -0
  147. package/bios/seabios/scripts/kconfig/zconf.l +363 -0
  148. package/bios/seabios/scripts/kconfig/zconf.lex.c_shipped +2420 -0
  149. package/bios/seabios/scripts/kconfig/zconf.tab.c_shipped +2538 -0
  150. package/bios/seabios/scripts/kconfig/zconf.y +733 -0
  151. package/bios/seabios/scripts/layoutrom.py +705 -0
  152. package/bios/seabios/scripts/python23compat.py +14 -0
  153. package/bios/seabios/scripts/readserial.py +190 -0
  154. package/bios/seabios/scripts/tarball.sh +36 -0
  155. package/bios/seabios/scripts/test-build.sh +90 -0
  156. package/bios/seabios/scripts/transdump.py +53 -0
  157. package/bios/seabios/scripts/vgafixup.py +96 -0
  158. package/bios/seabios/src/Kconfig +579 -0
  159. package/bios/seabios/src/apm.c +215 -0
  160. package/bios/seabios/src/asm-offsets.c +23 -0
  161. package/bios/seabios/src/biosvar.h +130 -0
  162. package/bios/seabios/src/block.c +623 -0
  163. package/bios/seabios/src/block.h +121 -0
  164. package/bios/seabios/src/bmp.c +117 -0
  165. package/bios/seabios/src/boot.c +793 -0
  166. package/bios/seabios/src/bootsplash.c +255 -0
  167. package/bios/seabios/src/bregs.h +80 -0
  168. package/bios/seabios/src/byteorder.h +71 -0
  169. package/bios/seabios/src/cdrom.c +322 -0
  170. package/bios/seabios/src/clock.c +506 -0
  171. package/bios/seabios/src/code16gcc.s +1 -0
  172. package/bios/seabios/src/config.h +108 -0
  173. package/bios/seabios/src/cp437.c +275 -0
  174. package/bios/seabios/src/cp437.h +1 -0
  175. package/bios/seabios/src/disk.c +779 -0
  176. package/bios/seabios/src/e820map.c +152 -0
  177. package/bios/seabios/src/e820map.h +26 -0
  178. package/bios/seabios/src/entryfuncs.S +165 -0
  179. package/bios/seabios/src/farptr.h +208 -0
  180. package/bios/seabios/src/font.c +139 -0
  181. package/bios/seabios/src/fw/acpi-dsdt-cpu-hotplug.dsl +78 -0
  182. package/bios/seabios/src/fw/acpi-dsdt-dbug.dsl +26 -0
  183. package/bios/seabios/src/fw/acpi-dsdt-hpet.dsl +36 -0
  184. package/bios/seabios/src/fw/acpi-dsdt-isa.dsl +102 -0
  185. package/bios/seabios/src/fw/acpi-dsdt-pci-crs.dsl +90 -0
  186. package/bios/seabios/src/fw/acpi-dsdt.dsl +342 -0
  187. package/bios/seabios/src/fw/acpi-dsdt.hex +554 -0
  188. package/bios/seabios/src/fw/acpi.c +685 -0
  189. package/bios/seabios/src/fw/biostables.c +491 -0
  190. package/bios/seabios/src/fw/coreboot.c +569 -0
  191. package/bios/seabios/src/fw/csm.c +347 -0
  192. package/bios/seabios/src/fw/dev-pci.h +52 -0
  193. package/bios/seabios/src/fw/dev-piix.h +29 -0
  194. package/bios/seabios/src/fw/dev-q35.h +52 -0
  195. package/bios/seabios/src/fw/lzmadecode.c +398 -0
  196. package/bios/seabios/src/fw/lzmadecode.h +67 -0
  197. package/bios/seabios/src/fw/mptable.c +197 -0
  198. package/bios/seabios/src/fw/mtrr.c +105 -0
  199. package/bios/seabios/src/fw/multiboot.c +111 -0
  200. package/bios/seabios/src/fw/paravirt.c +624 -0
  201. package/bios/seabios/src/fw/paravirt.h +63 -0
  202. package/bios/seabios/src/fw/pciinit.c +1187 -0
  203. package/bios/seabios/src/fw/pirtable.c +103 -0
  204. package/bios/seabios/src/fw/q35-acpi-dsdt.dsl +450 -0
  205. package/bios/seabios/src/fw/romfile_loader.c +259 -0
  206. package/bios/seabios/src/fw/romfile_loader.h +91 -0
  207. package/bios/seabios/src/fw/shadow.c +208 -0
  208. package/bios/seabios/src/fw/smbios.c +585 -0
  209. package/bios/seabios/src/fw/smm.c +269 -0
  210. package/bios/seabios/src/fw/smp.c +194 -0
  211. package/bios/seabios/src/fw/ssdt-misc.dsl +104 -0
  212. package/bios/seabios/src/fw/ssdt-misc.hex +88 -0
  213. package/bios/seabios/src/fw/ssdt-pcihp.dsl +36 -0
  214. package/bios/seabios/src/fw/ssdt-pcihp.hex +38 -0
  215. package/bios/seabios/src/fw/ssdt-proc.dsl +48 -0
  216. package/bios/seabios/src/fw/ssdt-proc.hex +35 -0
  217. package/bios/seabios/src/fw/xen.c +149 -0
  218. package/bios/seabios/src/fw/xen.h +125 -0
  219. package/bios/seabios/src/gen-defs.h +19 -0
  220. package/bios/seabios/src/hw/ahci.c +697 -0
  221. package/bios/seabios/src/hw/ahci.h +201 -0
  222. package/bios/seabios/src/hw/ata.c +1046 -0
  223. package/bios/seabios/src/hw/ata.h +163 -0
  224. package/bios/seabios/src/hw/blockcmd.c +372 -0
  225. package/bios/seabios/src/hw/blockcmd.h +114 -0
  226. package/bios/seabios/src/hw/dma.c +67 -0
  227. package/bios/seabios/src/hw/esp-scsi.c +241 -0
  228. package/bios/seabios/src/hw/esp-scsi.h +8 -0
  229. package/bios/seabios/src/hw/floppy.c +741 -0
  230. package/bios/seabios/src/hw/lsi-scsi.c +221 -0
  231. package/bios/seabios/src/hw/lsi-scsi.h +8 -0
  232. package/bios/seabios/src/hw/megasas.c +405 -0
  233. package/bios/seabios/src/hw/megasas.h +8 -0
  234. package/bios/seabios/src/hw/mpt-scsi.c +319 -0
  235. package/bios/seabios/src/hw/mpt-scsi.h +8 -0
  236. package/bios/seabios/src/hw/nvme-int.h +199 -0
  237. package/bios/seabios/src/hw/nvme.c +708 -0
  238. package/bios/seabios/src/hw/nvme.h +17 -0
  239. package/bios/seabios/src/hw/pci.c +133 -0
  240. package/bios/seabios/src/hw/pci.h +47 -0
  241. package/bios/seabios/src/hw/pci_ids.h +2632 -0
  242. package/bios/seabios/src/hw/pci_regs.h +556 -0
  243. package/bios/seabios/src/hw/pcidevice.c +192 -0
  244. package/bios/seabios/src/hw/pcidevice.h +76 -0
  245. package/bios/seabios/src/hw/pic.c +115 -0
  246. package/bios/seabios/src/hw/pic.h +60 -0
  247. package/bios/seabios/src/hw/ps2port.c +543 -0
  248. package/bios/seabios/src/hw/ps2port.h +67 -0
  249. package/bios/seabios/src/hw/pvscsi.c +333 -0
  250. package/bios/seabios/src/hw/pvscsi.h +8 -0
  251. package/bios/seabios/src/hw/ramdisk.c +108 -0
  252. package/bios/seabios/src/hw/rtc.c +100 -0
  253. package/bios/seabios/src/hw/rtc.h +75 -0
  254. package/bios/seabios/src/hw/sdcard.c +572 -0
  255. package/bios/seabios/src/hw/serialio.c +113 -0
  256. package/bios/seabios/src/hw/serialio.h +29 -0
  257. package/bios/seabios/src/hw/timer.c +259 -0
  258. package/bios/seabios/src/hw/tpm_drivers.c +636 -0
  259. package/bios/seabios/src/hw/tpm_drivers.h +127 -0
  260. package/bios/seabios/src/hw/usb-ehci.c +650 -0
  261. package/bios/seabios/src/hw/usb-ehci.h +177 -0
  262. package/bios/seabios/src/hw/usb-hid.c +442 -0
  263. package/bios/seabios/src/hw/usb-hid.h +29 -0
  264. package/bios/seabios/src/hw/usb-hub.c +205 -0
  265. package/bios/seabios/src/hw/usb-hub.h +64 -0
  266. package/bios/seabios/src/hw/usb-msc.c +222 -0
  267. package/bios/seabios/src/hw/usb-msc.h +10 -0
  268. package/bios/seabios/src/hw/usb-ohci.c +568 -0
  269. package/bios/seabios/src/hw/usb-ohci.h +144 -0
  270. package/bios/seabios/src/hw/usb-uas.c +289 -0
  271. package/bios/seabios/src/hw/usb-uas.h +9 -0
  272. package/bios/seabios/src/hw/usb-uhci.c +571 -0
  273. package/bios/seabios/src/hw/usb-uhci.h +128 -0
  274. package/bios/seabios/src/hw/usb-xhci.c +1161 -0
  275. package/bios/seabios/src/hw/usb-xhci.h +133 -0
  276. package/bios/seabios/src/hw/usb.c +499 -0
  277. package/bios/seabios/src/hw/usb.h +254 -0
  278. package/bios/seabios/src/hw/virtio-blk.c +211 -0
  279. package/bios/seabios/src/hw/virtio-blk.h +43 -0
  280. package/bios/seabios/src/hw/virtio-pci.c +501 -0
  281. package/bios/seabios/src/hw/virtio-pci.h +151 -0
  282. package/bios/seabios/src/hw/virtio-ring.c +147 -0
  283. package/bios/seabios/src/hw/virtio-ring.h +121 -0
  284. package/bios/seabios/src/hw/virtio-scsi.c +220 -0
  285. package/bios/seabios/src/hw/virtio-scsi.h +47 -0
  286. package/bios/seabios/src/jpeg.c +1055 -0
  287. package/bios/seabios/src/kbd.c +599 -0
  288. package/bios/seabios/src/list.h +91 -0
  289. package/bios/seabios/src/malloc.c +561 -0
  290. package/bios/seabios/src/malloc.h +70 -0
  291. package/bios/seabios/src/memmap.h +21 -0
  292. package/bios/seabios/src/misc.c +195 -0
  293. package/bios/seabios/src/mouse.c +342 -0
  294. package/bios/seabios/src/optionroms.c +475 -0
  295. package/bios/seabios/src/output.c +584 -0
  296. package/bios/seabios/src/output.h +68 -0
  297. package/bios/seabios/src/pcibios.c +241 -0
  298. package/bios/seabios/src/pmm.c +176 -0
  299. package/bios/seabios/src/pnpbios.c +88 -0
  300. package/bios/seabios/src/post.c +337 -0
  301. package/bios/seabios/src/resume.c +157 -0
  302. package/bios/seabios/src/romfile.c +146 -0
  303. package/bios/seabios/src/romfile.h +21 -0
  304. package/bios/seabios/src/romlayout.S +698 -0
  305. package/bios/seabios/src/sercon.c +677 -0
  306. package/bios/seabios/src/serial.c +317 -0
  307. package/bios/seabios/src/sha1.c +147 -0
  308. package/bios/seabios/src/sha1.h +8 -0
  309. package/bios/seabios/src/stacks.c +771 -0
  310. package/bios/seabios/src/stacks.h +68 -0
  311. package/bios/seabios/src/std/LegacyBios.h +985 -0
  312. package/bios/seabios/src/std/acpi.h +323 -0
  313. package/bios/seabios/src/std/bda.h +174 -0
  314. package/bios/seabios/src/std/disk.h +175 -0
  315. package/bios/seabios/src/std/mptable.h +77 -0
  316. package/bios/seabios/src/std/multiboot.h +260 -0
  317. package/bios/seabios/src/std/optionrom.h +59 -0
  318. package/bios/seabios/src/std/pirtable.h +35 -0
  319. package/bios/seabios/src/std/pmm.h +19 -0
  320. package/bios/seabios/src/std/pnpbios.h +24 -0
  321. package/bios/seabios/src/std/smbios.h +167 -0
  322. package/bios/seabios/src/std/tcg.h +554 -0
  323. package/bios/seabios/src/std/vbe.h +156 -0
  324. package/bios/seabios/src/std/vga.h +63 -0
  325. package/bios/seabios/src/string.c +251 -0
  326. package/bios/seabios/src/string.h +31 -0
  327. package/bios/seabios/src/system.c +357 -0
  328. package/bios/seabios/src/tcgbios.c +2014 -0
  329. package/bios/seabios/src/tcgbios.h +19 -0
  330. package/bios/seabios/src/types.h +156 -0
  331. package/bios/seabios/src/util.h +251 -0
  332. package/bios/seabios/src/version.c +5 -0
  333. package/bios/seabios/src/vgahooks.c +355 -0
  334. package/bios/seabios/src/x86.c +23 -0
  335. package/bios/seabios/src/x86.h +277 -0
  336. package/bios/seabios/vgasrc/Kconfig +211 -0
  337. package/bios/seabios/vgasrc/bochsdisplay.c +59 -0
  338. package/bios/seabios/vgasrc/bochsvga.c +447 -0
  339. package/bios/seabios/vgasrc/bochsvga.h +57 -0
  340. package/bios/seabios/vgasrc/cbvga.c +337 -0
  341. package/bios/seabios/vgasrc/clext.c +627 -0
  342. package/bios/seabios/vgasrc/geodevga.c +434 -0
  343. package/bios/seabios/vgasrc/geodevga.h +89 -0
  344. package/bios/seabios/vgasrc/ramfb.c +163 -0
  345. package/bios/seabios/vgasrc/stdvga.c +485 -0
  346. package/bios/seabios/vgasrc/stdvga.h +81 -0
  347. package/bios/seabios/vgasrc/stdvgaio.c +186 -0
  348. package/bios/seabios/vgasrc/stdvgamodes.c +534 -0
  349. package/bios/seabios/vgasrc/swcursor.c +96 -0
  350. package/bios/seabios/vgasrc/vbe.c +432 -0
  351. package/bios/seabios/vgasrc/vgabios.c +1131 -0
  352. package/bios/seabios/vgasrc/vgabios.h +88 -0
  353. package/bios/seabios/vgasrc/vgaentry.S +161 -0
  354. package/bios/seabios/vgasrc/vgafb.c +661 -0
  355. package/bios/seabios/vgasrc/vgafb.h +42 -0
  356. package/bios/seabios/vgasrc/vgafonts.c +785 -0
  357. package/bios/seabios/vgasrc/vgahw.h +152 -0
  358. package/bios/seabios/vgasrc/vgainit.c +202 -0
  359. package/bios/seabios/vgasrc/vgalayout.lds.S +23 -0
  360. package/bios/seabios/vgasrc/vgautil.h +103 -0
  361. package/bios/seabios/vgasrc/vgaversion.c +6 -0
  362. package/build/binaries.js +1 -1
  363. package/build/index-debug.cjs +1 -1
  364. package/build/index-debug.js +1 -1
  365. package/build/index.cjs +1 -1
  366. package/build/index.js +1 -1
  367. package/build/v86-debug.wasm +0 -0
  368. package/build/v86.wasm +0 -0
  369. package/package.json +1 -1
@@ -0,0 +1,534 @@
1
+ // Standard VGA mode information.
2
+ //
3
+ // Copyright (C) 2009 Kevin O'Connor <kevin@koconnor.net>
4
+ // Copyright (C) 2001-2008 the LGPL VGABios developers Team
5
+ //
6
+ // This file may be distributed under the terms of the GNU LGPLv3 license.
7
+
8
+ #include "biosvar.h" // GET_GLOBAL
9
+ #include "output.h" // warn_internalerror
10
+ #include "std/vga.h" // struct video_param_s
11
+ #include "stdvga.h" // stdvga_find_mode
12
+ #include "string.h" // memcpy_far
13
+ #include "vgabios.h" // SET_VGA
14
+ #include "vgautil.h" // vgafont16
15
+
16
+
17
+ /****************************************************************
18
+ * Video mode register definitions
19
+ ****************************************************************/
20
+
21
+ /* Mono */
22
+ static u8 palette0[] VAR16 = {
23
+ 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
24
+ 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
25
+ 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
26
+ 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
27
+ 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
28
+ 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
29
+ 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f,
30
+ 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f,
31
+ 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
32
+ 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
33
+ 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
34
+ 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
35
+ 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
36
+ 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a, 0x2a,0x2a,0x2a,
37
+ 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f,
38
+ 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f, 0x3f,0x3f,0x3f
39
+ };
40
+
41
+ static u8 palette1[] VAR16 = {
42
+ 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a,
43
+ 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a,
44
+ 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a,
45
+ 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a,
46
+ 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f,
47
+ 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f,
48
+ 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f,
49
+ 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f,
50
+ 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a,
51
+ 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a,
52
+ 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a,
53
+ 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a,
54
+ 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f,
55
+ 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f,
56
+ 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f,
57
+ 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f
58
+ };
59
+
60
+ static u8 palette2[] VAR16 = {
61
+ 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a,
62
+ 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x2a,0x00, 0x2a,0x2a,0x2a,
63
+ 0x00,0x00,0x15, 0x00,0x00,0x3f, 0x00,0x2a,0x15, 0x00,0x2a,0x3f,
64
+ 0x2a,0x00,0x15, 0x2a,0x00,0x3f, 0x2a,0x2a,0x15, 0x2a,0x2a,0x3f,
65
+ 0x00,0x15,0x00, 0x00,0x15,0x2a, 0x00,0x3f,0x00, 0x00,0x3f,0x2a,
66
+ 0x2a,0x15,0x00, 0x2a,0x15,0x2a, 0x2a,0x3f,0x00, 0x2a,0x3f,0x2a,
67
+ 0x00,0x15,0x15, 0x00,0x15,0x3f, 0x00,0x3f,0x15, 0x00,0x3f,0x3f,
68
+ 0x2a,0x15,0x15, 0x2a,0x15,0x3f, 0x2a,0x3f,0x15, 0x2a,0x3f,0x3f,
69
+ 0x15,0x00,0x00, 0x15,0x00,0x2a, 0x15,0x2a,0x00, 0x15,0x2a,0x2a,
70
+ 0x3f,0x00,0x00, 0x3f,0x00,0x2a, 0x3f,0x2a,0x00, 0x3f,0x2a,0x2a,
71
+ 0x15,0x00,0x15, 0x15,0x00,0x3f, 0x15,0x2a,0x15, 0x15,0x2a,0x3f,
72
+ 0x3f,0x00,0x15, 0x3f,0x00,0x3f, 0x3f,0x2a,0x15, 0x3f,0x2a,0x3f,
73
+ 0x15,0x15,0x00, 0x15,0x15,0x2a, 0x15,0x3f,0x00, 0x15,0x3f,0x2a,
74
+ 0x3f,0x15,0x00, 0x3f,0x15,0x2a, 0x3f,0x3f,0x00, 0x3f,0x3f,0x2a,
75
+ 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f,
76
+ 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f
77
+ };
78
+
79
+ static u8 palette3[] VAR16 = {
80
+ 0x00,0x00,0x00, 0x00,0x00,0x2a, 0x00,0x2a,0x00, 0x00,0x2a,0x2a,
81
+ 0x2a,0x00,0x00, 0x2a,0x00,0x2a, 0x2a,0x15,0x00, 0x2a,0x2a,0x2a,
82
+ 0x15,0x15,0x15, 0x15,0x15,0x3f, 0x15,0x3f,0x15, 0x15,0x3f,0x3f,
83
+ 0x3f,0x15,0x15, 0x3f,0x15,0x3f, 0x3f,0x3f,0x15, 0x3f,0x3f,0x3f,
84
+ 0x00,0x00,0x00, 0x05,0x05,0x05, 0x08,0x08,0x08, 0x0b,0x0b,0x0b,
85
+ 0x0e,0x0e,0x0e, 0x11,0x11,0x11, 0x14,0x14,0x14, 0x18,0x18,0x18,
86
+ 0x1c,0x1c,0x1c, 0x20,0x20,0x20, 0x24,0x24,0x24, 0x28,0x28,0x28,
87
+ 0x2d,0x2d,0x2d, 0x32,0x32,0x32, 0x38,0x38,0x38, 0x3f,0x3f,0x3f,
88
+ 0x00,0x00,0x3f, 0x10,0x00,0x3f, 0x1f,0x00,0x3f, 0x2f,0x00,0x3f,
89
+ 0x3f,0x00,0x3f, 0x3f,0x00,0x2f, 0x3f,0x00,0x1f, 0x3f,0x00,0x10,
90
+ 0x3f,0x00,0x00, 0x3f,0x10,0x00, 0x3f,0x1f,0x00, 0x3f,0x2f,0x00,
91
+ 0x3f,0x3f,0x00, 0x2f,0x3f,0x00, 0x1f,0x3f,0x00, 0x10,0x3f,0x00,
92
+ 0x00,0x3f,0x00, 0x00,0x3f,0x10, 0x00,0x3f,0x1f, 0x00,0x3f,0x2f,
93
+ 0x00,0x3f,0x3f, 0x00,0x2f,0x3f, 0x00,0x1f,0x3f, 0x00,0x10,0x3f,
94
+ 0x1f,0x1f,0x3f, 0x27,0x1f,0x3f, 0x2f,0x1f,0x3f, 0x37,0x1f,0x3f,
95
+ 0x3f,0x1f,0x3f, 0x3f,0x1f,0x37, 0x3f,0x1f,0x2f, 0x3f,0x1f,0x27,
96
+
97
+ 0x3f,0x1f,0x1f, 0x3f,0x27,0x1f, 0x3f,0x2f,0x1f, 0x3f,0x37,0x1f,
98
+ 0x3f,0x3f,0x1f, 0x37,0x3f,0x1f, 0x2f,0x3f,0x1f, 0x27,0x3f,0x1f,
99
+ 0x1f,0x3f,0x1f, 0x1f,0x3f,0x27, 0x1f,0x3f,0x2f, 0x1f,0x3f,0x37,
100
+ 0x1f,0x3f,0x3f, 0x1f,0x37,0x3f, 0x1f,0x2f,0x3f, 0x1f,0x27,0x3f,
101
+ 0x2d,0x2d,0x3f, 0x31,0x2d,0x3f, 0x36,0x2d,0x3f, 0x3a,0x2d,0x3f,
102
+ 0x3f,0x2d,0x3f, 0x3f,0x2d,0x3a, 0x3f,0x2d,0x36, 0x3f,0x2d,0x31,
103
+ 0x3f,0x2d,0x2d, 0x3f,0x31,0x2d, 0x3f,0x36,0x2d, 0x3f,0x3a,0x2d,
104
+ 0x3f,0x3f,0x2d, 0x3a,0x3f,0x2d, 0x36,0x3f,0x2d, 0x31,0x3f,0x2d,
105
+ 0x2d,0x3f,0x2d, 0x2d,0x3f,0x31, 0x2d,0x3f,0x36, 0x2d,0x3f,0x3a,
106
+ 0x2d,0x3f,0x3f, 0x2d,0x3a,0x3f, 0x2d,0x36,0x3f, 0x2d,0x31,0x3f,
107
+ 0x00,0x00,0x1c, 0x07,0x00,0x1c, 0x0e,0x00,0x1c, 0x15,0x00,0x1c,
108
+ 0x1c,0x00,0x1c, 0x1c,0x00,0x15, 0x1c,0x00,0x0e, 0x1c,0x00,0x07,
109
+ 0x1c,0x00,0x00, 0x1c,0x07,0x00, 0x1c,0x0e,0x00, 0x1c,0x15,0x00,
110
+ 0x1c,0x1c,0x00, 0x15,0x1c,0x00, 0x0e,0x1c,0x00, 0x07,0x1c,0x00,
111
+ 0x00,0x1c,0x00, 0x00,0x1c,0x07, 0x00,0x1c,0x0e, 0x00,0x1c,0x15,
112
+ 0x00,0x1c,0x1c, 0x00,0x15,0x1c, 0x00,0x0e,0x1c, 0x00,0x07,0x1c,
113
+
114
+ 0x0e,0x0e,0x1c, 0x11,0x0e,0x1c, 0x15,0x0e,0x1c, 0x18,0x0e,0x1c,
115
+ 0x1c,0x0e,0x1c, 0x1c,0x0e,0x18, 0x1c,0x0e,0x15, 0x1c,0x0e,0x11,
116
+ 0x1c,0x0e,0x0e, 0x1c,0x11,0x0e, 0x1c,0x15,0x0e, 0x1c,0x18,0x0e,
117
+ 0x1c,0x1c,0x0e, 0x18,0x1c,0x0e, 0x15,0x1c,0x0e, 0x11,0x1c,0x0e,
118
+ 0x0e,0x1c,0x0e, 0x0e,0x1c,0x11, 0x0e,0x1c,0x15, 0x0e,0x1c,0x18,
119
+ 0x0e,0x1c,0x1c, 0x0e,0x18,0x1c, 0x0e,0x15,0x1c, 0x0e,0x11,0x1c,
120
+ 0x14,0x14,0x1c, 0x16,0x14,0x1c, 0x18,0x14,0x1c, 0x1a,0x14,0x1c,
121
+ 0x1c,0x14,0x1c, 0x1c,0x14,0x1a, 0x1c,0x14,0x18, 0x1c,0x14,0x16,
122
+ 0x1c,0x14,0x14, 0x1c,0x16,0x14, 0x1c,0x18,0x14, 0x1c,0x1a,0x14,
123
+ 0x1c,0x1c,0x14, 0x1a,0x1c,0x14, 0x18,0x1c,0x14, 0x16,0x1c,0x14,
124
+ 0x14,0x1c,0x14, 0x14,0x1c,0x16, 0x14,0x1c,0x18, 0x14,0x1c,0x1a,
125
+ 0x14,0x1c,0x1c, 0x14,0x1a,0x1c, 0x14,0x18,0x1c, 0x14,0x16,0x1c,
126
+ 0x00,0x00,0x10, 0x04,0x00,0x10, 0x08,0x00,0x10, 0x0c,0x00,0x10,
127
+ 0x10,0x00,0x10, 0x10,0x00,0x0c, 0x10,0x00,0x08, 0x10,0x00,0x04,
128
+ 0x10,0x00,0x00, 0x10,0x04,0x00, 0x10,0x08,0x00, 0x10,0x0c,0x00,
129
+ 0x10,0x10,0x00, 0x0c,0x10,0x00, 0x08,0x10,0x00, 0x04,0x10,0x00,
130
+
131
+ 0x00,0x10,0x00, 0x00,0x10,0x04, 0x00,0x10,0x08, 0x00,0x10,0x0c,
132
+ 0x00,0x10,0x10, 0x00,0x0c,0x10, 0x00,0x08,0x10, 0x00,0x04,0x10,
133
+ 0x08,0x08,0x10, 0x0a,0x08,0x10, 0x0c,0x08,0x10, 0x0e,0x08,0x10,
134
+ 0x10,0x08,0x10, 0x10,0x08,0x0e, 0x10,0x08,0x0c, 0x10,0x08,0x0a,
135
+ 0x10,0x08,0x08, 0x10,0x0a,0x08, 0x10,0x0c,0x08, 0x10,0x0e,0x08,
136
+ 0x10,0x10,0x08, 0x0e,0x10,0x08, 0x0c,0x10,0x08, 0x0a,0x10,0x08,
137
+ 0x08,0x10,0x08, 0x08,0x10,0x0a, 0x08,0x10,0x0c, 0x08,0x10,0x0e,
138
+ 0x08,0x10,0x10, 0x08,0x0e,0x10, 0x08,0x0c,0x10, 0x08,0x0a,0x10,
139
+ 0x0b,0x0b,0x10, 0x0c,0x0b,0x10, 0x0d,0x0b,0x10, 0x0f,0x0b,0x10,
140
+ 0x10,0x0b,0x10, 0x10,0x0b,0x0f, 0x10,0x0b,0x0d, 0x10,0x0b,0x0c,
141
+ 0x10,0x0b,0x0b, 0x10,0x0c,0x0b, 0x10,0x0d,0x0b, 0x10,0x0f,0x0b,
142
+ 0x10,0x10,0x0b, 0x0f,0x10,0x0b, 0x0d,0x10,0x0b, 0x0c,0x10,0x0b,
143
+ 0x0b,0x10,0x0b, 0x0b,0x10,0x0c, 0x0b,0x10,0x0d, 0x0b,0x10,0x0f,
144
+ 0x0b,0x10,0x10, 0x0b,0x0f,0x10, 0x0b,0x0d,0x10, 0x0b,0x0c,0x10,
145
+ 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
146
+ 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00
147
+ };
148
+
149
+ static u8 sequ_01[] VAR16 = { 0x08, 0x03, 0x00, 0x02 };
150
+ static u8 crtc_01[] VAR16 = {
151
+ 0x2d, 0x27, 0x28, 0x90, 0x2b, 0xa0, 0xbf, 0x1f,
152
+ 0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,
153
+ 0x9c, 0x8e, 0x8f, 0x14, 0x1f, 0x96, 0xb9, 0xa3,
154
+ 0xff };
155
+ static u8 actl_01[] VAR16 = {
156
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
157
+ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
158
+ 0x0c, 0x00, 0x0f, 0x08 };
159
+ static u8 grdc_01[] VAR16 = {
160
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0e, 0x0f, 0xff };
161
+ static u8 sequ_03[] VAR16 = { 0x00, 0x03, 0x00, 0x02 };
162
+ static u8 crtc_03[] VAR16 = {
163
+ 0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f,
164
+ 0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,
165
+ 0x9c, 0x8e, 0x8f, 0x28, 0x1f, 0x96, 0xb9, 0xa3,
166
+ 0xff };
167
+ static u8 sequ_04[] VAR16 = { 0x09, 0x03, 0x00, 0x02 };
168
+ static u8 crtc_04[] VAR16 = {
169
+ 0x2d, 0x27, 0x28, 0x90, 0x2b, 0x80, 0xbf, 0x1f,
170
+ 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
171
+ 0x9c, 0x8e, 0x8f, 0x14, 0x00, 0x96, 0xb9, 0xa2,
172
+ 0xff };
173
+ static u8 actl_04[] VAR16 = {
174
+ 0x00, 0x13, 0x15, 0x17, 0x02, 0x04, 0x06, 0x07,
175
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
176
+ 0x01, 0x00, 0x03, 0x00 };
177
+ static u8 grdc_04[] VAR16 = {
178
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x0f, 0x0f, 0xff };
179
+ static u8 sequ_06[] VAR16 = { 0x01, 0x01, 0x00, 0x06 };
180
+ static u8 crtc_06[] VAR16 = {
181
+ 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,
182
+ 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
183
+ 0x9c, 0x8e, 0x8f, 0x28, 0x00, 0x96, 0xb9, 0xc2,
184
+ 0xff };
185
+ static u8 actl_06[] VAR16 = {
186
+ 0x00, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17,
187
+ 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17, 0x17,
188
+ 0x01, 0x00, 0x01, 0x00 };
189
+ static u8 grdc_06[] VAR16 = {
190
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x0f, 0xff };
191
+ static u8 crtc_07[] VAR16 = {
192
+ 0x5f, 0x4f, 0x50, 0x82, 0x55, 0x81, 0xbf, 0x1f,
193
+ 0x00, 0x4f, 0x0d, 0x0e, 0x00, 0x00, 0x00, 0x00,
194
+ 0x9c, 0x8e, 0x8f, 0x28, 0x0f, 0x96, 0xb9, 0xa3,
195
+ 0xff };
196
+ static u8 actl_07[] VAR16 = {
197
+ 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
198
+ 0x10, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18,
199
+ 0x0e, 0x00, 0x0f, 0x08 };
200
+ static u8 grdc_07[] VAR16 = {
201
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x0a, 0x0f, 0xff };
202
+ static u8 sequ_0d[] VAR16 = { 0x09, 0x0f, 0x00, 0x06 };
203
+ static u8 crtc_0d[] VAR16 = {
204
+ 0x2d, 0x27, 0x28, 0x90, 0x2b, 0x80, 0xbf, 0x1f,
205
+ 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
206
+ 0x9c, 0x8e, 0x8f, 0x14, 0x00, 0x96, 0xb9, 0xe3,
207
+ 0xff };
208
+ static u8 actl_0d[] VAR16 = {
209
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
210
+ 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
211
+ 0x01, 0x00, 0x0f, 0x00 };
212
+ static u8 grdc_0d[] VAR16 = {
213
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0f, 0xff };
214
+ static u8 sequ_0e[] VAR16 = { 0x01, 0x0f, 0x00, 0x06 };
215
+ static u8 crtc_0e[] VAR16 = {
216
+ 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,
217
+ 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
218
+ 0x9c, 0x8e, 0x8f, 0x28, 0x00, 0x96, 0xb9, 0xe3,
219
+ 0xff };
220
+ static u8 crtc_0f[] VAR16 = {
221
+ 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,
222
+ 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
223
+ 0x83, 0x85, 0x5d, 0x28, 0x0f, 0x63, 0xba, 0xe3,
224
+ 0xff };
225
+ static u8 actl_0f[] VAR16 = {
226
+ 0x00, 0x08, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00,
227
+ 0x00, 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00,
228
+ 0x01, 0x00, 0x01, 0x00 };
229
+ static u8 actl_10[] VAR16 = {
230
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x14, 0x07,
231
+ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
232
+ 0x01, 0x00, 0x0f, 0x00 };
233
+ static u8 crtc_11[] VAR16 = {
234
+ 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0x0b, 0x3e,
235
+ 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
236
+ 0xea, 0x8c, 0xdf, 0x28, 0x00, 0xe7, 0x04, 0xe3,
237
+ 0xff };
238
+ static u8 actl_11[] VAR16 = {
239
+ 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f,
240
+ 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f, 0x00, 0x3f,
241
+ 0x01, 0x00, 0x0f, 0x00 };
242
+ static u8 sequ_13[] VAR16 = { 0x01, 0x0f, 0x00, 0x0e };
243
+ static u8 crtc_13[] VAR16 = {
244
+ 0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0xbf, 0x1f,
245
+ 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
246
+ 0x9c, 0x8e, 0x8f, 0x28, 0x40, 0x96, 0xb9, 0xa3,
247
+ 0xff };
248
+ static u8 actl_13[] VAR16 = {
249
+ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
250
+ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
251
+ 0x41, 0x00, 0x0f, 0x00 };
252
+ static u8 grdc_13[] VAR16 = {
253
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0f, 0xff };
254
+ static u8 crtc_6A[] VAR16 = {
255
+ 0x7f, 0x63, 0x63, 0x83, 0x6b, 0x1b, 0x72, 0xf0,
256
+ 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
257
+ 0x59, 0x8d, 0x57, 0x32, 0x00, 0x57, 0x73, 0xe3,
258
+ 0xff };
259
+
260
+ #define PAL(x) x, sizeof(x)
261
+
262
+ struct stdvga_mode_s {
263
+ u16 mode;
264
+ struct vgamode_s info;
265
+
266
+ u8 pelmask;
267
+ u8 *dac;
268
+ u16 dacsize;
269
+ u8 *sequ_regs;
270
+ u8 miscreg;
271
+ u8 *crtc_regs;
272
+ u8 *actl_regs;
273
+ u8 *grdc_regs;
274
+ };
275
+
276
+ static struct stdvga_mode_s vga_modes[] VAR16 = {
277
+ //mode { model tx ty bpp cw ch sstart }
278
+ // pelm dac sequ misc crtc actl grdc
279
+ {0x00, { MM_TEXT, 40, 25, 4, 9, 16, SEG_CTEXT }
280
+ , 0xFF, PAL(palette2), sequ_01, 0x67, crtc_01, actl_01, grdc_01},
281
+ {0x01, { MM_TEXT, 40, 25, 4, 9, 16, SEG_CTEXT }
282
+ , 0xFF, PAL(palette2), sequ_01, 0x67, crtc_01, actl_01, grdc_01},
283
+ {0x02, { MM_TEXT, 80, 25, 4, 9, 16, SEG_CTEXT }
284
+ , 0xFF, PAL(palette2), sequ_03, 0x67, crtc_03, actl_01, grdc_01},
285
+ {0x03, { MM_TEXT, 80, 25, 4, 9, 16, SEG_CTEXT }
286
+ , 0xFF, PAL(palette2), sequ_03, 0x67, crtc_03, actl_01, grdc_01},
287
+ {0x04, { MM_CGA, 320, 200, 2, 8, 8, SEG_CTEXT }
288
+ , 0xFF, PAL(palette1), sequ_04, 0x63, crtc_04, actl_04, grdc_04},
289
+ {0x05, { MM_CGA, 320, 200, 2, 8, 8, SEG_CTEXT }
290
+ , 0xFF, PAL(palette1), sequ_04, 0x63, crtc_04, actl_04, grdc_04},
291
+ {0x06, { MM_CGA, 640, 200, 1, 8, 8, SEG_CTEXT }
292
+ , 0xFF, PAL(palette1), sequ_06, 0x63, crtc_06, actl_06, grdc_06},
293
+ {0x07, { MM_TEXT, 80, 25, 4, 9, 16, SEG_MTEXT }
294
+ , 0xFF, PAL(palette0), sequ_03, 0x66, crtc_07, actl_07, grdc_07},
295
+ {0x0D, { MM_PLANAR, 320, 200, 4, 8, 8, SEG_GRAPH }
296
+ , 0xFF, PAL(palette1), sequ_0d, 0x63, crtc_0d, actl_0d, grdc_0d},
297
+ {0x0E, { MM_PLANAR, 640, 200, 4, 8, 8, SEG_GRAPH }
298
+ , 0xFF, PAL(palette1), sequ_0e, 0x63, crtc_0e, actl_0d, grdc_0d},
299
+ {0x0F, { MM_PLANAR, 640, 350, 1, 8, 14, SEG_GRAPH }
300
+ , 0xFF, PAL(palette0), sequ_0e, 0xa3, crtc_0f, actl_0f, grdc_0d},
301
+ {0x10, { MM_PLANAR, 640, 350, 4, 8, 14, SEG_GRAPH }
302
+ , 0xFF, PAL(palette2), sequ_0e, 0xa3, crtc_0f, actl_10, grdc_0d},
303
+ {0x11, { MM_PLANAR, 640, 480, 1, 8, 16, SEG_GRAPH }
304
+ , 0xFF, PAL(palette2), sequ_0e, 0xe3, crtc_11, actl_11, grdc_0d},
305
+ {0x12, { MM_PLANAR, 640, 480, 4, 8, 16, SEG_GRAPH }
306
+ , 0xFF, PAL(palette2), sequ_0e, 0xe3, crtc_11, actl_10, grdc_0d},
307
+ {0x13, { MM_PACKED, 320, 200, 8, 8, 8, SEG_GRAPH }
308
+ , 0xFF, PAL(palette3), sequ_13, 0x63, crtc_13, actl_13, grdc_13},
309
+ {0x6A, { MM_PLANAR, 800, 600, 4, 8, 16, SEG_GRAPH }
310
+ , 0xFF, PAL(palette2), sequ_0e, 0xe3, crtc_6A, actl_10, grdc_0d},
311
+ };
312
+
313
+
314
+ /****************************************************************
315
+ * Mode functions
316
+ ****************************************************************/
317
+
318
+ static int
319
+ is_stdvga_mode(struct vgamode_s *vmode_g)
320
+ {
321
+ return (vmode_g >= &vga_modes[0].info
322
+ && vmode_g <= &vga_modes[ARRAY_SIZE(vga_modes)-1].info);
323
+ }
324
+
325
+ struct vgamode_s *
326
+ stdvga_find_mode(int mode)
327
+ {
328
+ int i;
329
+ for (i = 0; i < ARRAY_SIZE(vga_modes); i++) {
330
+ struct stdvga_mode_s *stdmode_g = &vga_modes[i];
331
+ if (GET_GLOBAL(stdmode_g->mode) == mode)
332
+ return &stdmode_g->info;
333
+ }
334
+ return NULL;
335
+ }
336
+
337
+ void
338
+ stdvga_list_modes(u16 seg, u16 *dest, u16 *last)
339
+ {
340
+ int i;
341
+ for (i = 0; i < ARRAY_SIZE(vga_modes) && dest < last; i++) {
342
+ struct stdvga_mode_s *stdmode_g = &vga_modes[i];
343
+ u16 mode = GET_GLOBAL(stdmode_g->mode);
344
+ if (mode == 0xffff)
345
+ continue;
346
+ SET_FARVAR(seg, *dest, mode);
347
+ dest++;
348
+ }
349
+
350
+ SET_FARVAR(seg, *dest, 0xffff);
351
+ }
352
+
353
+ static struct video_save_pointer_s video_save_pointer_table VAR16;
354
+
355
+ static struct video_param_s video_param_table[29] VAR16;
356
+
357
+ void
358
+ stdvga_build_video_param(void)
359
+ {
360
+ SET_BDA(video_savetable
361
+ , SEGOFF(get_global_seg(), (u32)&video_save_pointer_table));
362
+ SET_VGA(video_save_pointer_table.videoparam
363
+ , SEGOFF(get_global_seg(), (u32)video_param_table));
364
+
365
+ static u8 parammodes[] VAR16 = {
366
+ 0, 0, 0, 0, 0x04, 0x05, 0x06, 0x07,
367
+ 0, 0, 0, 0, 0, 0x0d, 0x0e, 0,
368
+ 0, 0x0f, 0x10, 0, 0, 0, 0, 0x01,
369
+ 0x03, 0x07, 0x11, 0x12, 0x13
370
+ };
371
+
372
+ int i;
373
+ for (i=0; i<ARRAY_SIZE(parammodes); i++) {
374
+ int mode = GET_GLOBAL(parammodes[i]);
375
+ if (! mode)
376
+ continue;
377
+ struct video_param_s *vparam_g = &video_param_table[i];
378
+ struct vgamode_s *vmode_g = stdvga_find_mode(mode);
379
+ if (!vmode_g)
380
+ continue;
381
+ int width = GET_GLOBAL(vmode_g->width);
382
+ int height = GET_GLOBAL(vmode_g->height);
383
+ u8 memmodel = GET_GLOBAL(vmode_g->memmodel);
384
+ int cheight = GET_GLOBAL(vmode_g->cheight);
385
+ if (memmodel == MM_TEXT) {
386
+ SET_VGA(vparam_g->twidth, width);
387
+ SET_VGA(vparam_g->theightm1, height-1);
388
+ } else {
389
+ int cwidth = GET_GLOBAL(vmode_g->cwidth);
390
+ SET_VGA(vparam_g->twidth, width / cwidth);
391
+ SET_VGA(vparam_g->theightm1, (height / cheight) - 1);
392
+ }
393
+ SET_VGA(vparam_g->cheight, cheight);
394
+ SET_VGA(vparam_g->slength, calc_page_size(memmodel, width, height));
395
+ struct stdvga_mode_s *stdmode_g = container_of(
396
+ vmode_g, struct stdvga_mode_s, info);
397
+ memcpy_far(get_global_seg(), vparam_g->sequ_regs
398
+ , get_global_seg(), GET_GLOBAL(stdmode_g->sequ_regs)
399
+ , ARRAY_SIZE(vparam_g->sequ_regs));
400
+ SET_VGA(vparam_g->miscreg, GET_GLOBAL(stdmode_g->miscreg));
401
+ memcpy_far(get_global_seg(), vparam_g->crtc_regs
402
+ , get_global_seg(), GET_GLOBAL(stdmode_g->crtc_regs)
403
+ , ARRAY_SIZE(vparam_g->crtc_regs));
404
+ memcpy_far(get_global_seg(), vparam_g->actl_regs
405
+ , get_global_seg(), GET_GLOBAL(stdmode_g->actl_regs)
406
+ , ARRAY_SIZE(vparam_g->actl_regs));
407
+ memcpy_far(get_global_seg(), vparam_g->grdc_regs
408
+ , get_global_seg(), GET_GLOBAL(stdmode_g->grdc_regs)
409
+ , ARRAY_SIZE(vparam_g->grdc_regs));
410
+ }
411
+
412
+ // Fill available legacy modes in video_func_static table
413
+ u32 modes = 0;
414
+ for (i = 0; i < ARRAY_SIZE(vga_modes); i++) {
415
+ u16 mode = vga_modes[i].mode;
416
+ if (mode <= 0x13)
417
+ modes |= 1<<i;
418
+ }
419
+ SET_VGA(static_functionality.modes, modes);
420
+ }
421
+
422
+ void
423
+ stdvga_override_crtc(int mode, u8 *crtc)
424
+ {
425
+ struct vgamode_s *vmode_g = stdvga_find_mode(mode);
426
+ if (!vmode_g)
427
+ return;
428
+ struct stdvga_mode_s *stdmode_g = container_of(
429
+ vmode_g, struct stdvga_mode_s, info);
430
+ SET_VGA(stdmode_g->crtc_regs, crtc);
431
+ }
432
+
433
+ static void
434
+ clear_screen(struct vgamode_s *vmode_g)
435
+ {
436
+ switch (GET_GLOBAL(vmode_g->memmodel)) {
437
+ case MM_TEXT:
438
+ memset16_far(GET_GLOBAL(vmode_g->sstart), 0, 0x0720, 32*1024);
439
+ break;
440
+ case MM_CGA:
441
+ memset16_far(GET_GLOBAL(vmode_g->sstart), 0, 0x0000, 32*1024);
442
+ break;
443
+ default:
444
+ // XXX - old code gets/sets/restores sequ register 2 to 0xf -
445
+ // but it should always be 0xf anyway.
446
+ memset16_far(GET_GLOBAL(vmode_g->sstart), 0, 0x0000, 64*1024);
447
+ }
448
+ }
449
+
450
+ int
451
+ stdvga_set_mode(struct vgamode_s *vmode_g, int flags)
452
+ {
453
+ if (! is_stdvga_mode(vmode_g)) {
454
+ warn_internalerror();
455
+ return -1;
456
+ }
457
+ struct stdvga_mode_s *stdmode_g = container_of(
458
+ vmode_g, struct stdvga_mode_s, info);
459
+
460
+ // if palette loading (bit 3 of modeset ctl = 0)
461
+ if (!(flags & MF_NOPALETTE)) { // Set the PEL mask
462
+ stdvga_pelmask_write(GET_GLOBAL(stdmode_g->pelmask));
463
+
464
+ // From which palette
465
+ u8 *palette_g = GET_GLOBAL(stdmode_g->dac);
466
+ u16 palsize = GET_GLOBAL(stdmode_g->dacsize) / 3;
467
+
468
+ // Always 256*3 values
469
+ stdvga_dac_write(get_global_seg(), palette_g, 0, palsize);
470
+ int i;
471
+ for (i = palsize; i < 0x0100; i++) {
472
+ static u8 rgb[3] VAR16;
473
+ stdvga_dac_write(get_global_seg(), rgb, i, 1);
474
+ }
475
+
476
+ if (flags & MF_GRAYSUM)
477
+ stdvga_perform_gray_scale_summing(0x00, 0x100);
478
+ }
479
+
480
+ // Set Attribute Ctl
481
+ u8 *regs = GET_GLOBAL(stdmode_g->actl_regs);
482
+ int i;
483
+ for (i = 0; i <= 0x13; i++)
484
+ stdvga_attr_write(i, GET_GLOBAL(regs[i]));
485
+ stdvga_attr_write(0x14, 0x00);
486
+
487
+ // Set Sequencer Ctl
488
+ stdvga_sequ_write(0x00, 0x03);
489
+ regs = GET_GLOBAL(stdmode_g->sequ_regs);
490
+ for (i = 1; i <= 4; i++)
491
+ stdvga_sequ_write(i, GET_GLOBAL(regs[i - 1]));
492
+
493
+ // Set Grafx Ctl
494
+ regs = GET_GLOBAL(stdmode_g->grdc_regs);
495
+ for (i = 0; i <= 8; i++)
496
+ stdvga_grdc_write(i, GET_GLOBAL(regs[i]));
497
+
498
+ // Set CRTC address VGA or MDA
499
+ u8 miscreg = GET_GLOBAL(stdmode_g->miscreg);
500
+ u16 crtc_addr = VGAREG_VGA_CRTC_ADDRESS;
501
+ if (!(miscreg & 1))
502
+ crtc_addr = VGAREG_MDA_CRTC_ADDRESS;
503
+
504
+ // Disable CRTC write protection
505
+ stdvga_crtc_write(crtc_addr, 0x11, 0x00);
506
+ // Set CRTC regs
507
+ regs = GET_GLOBAL(stdmode_g->crtc_regs);
508
+ for (i = 0; i <= 0x18; i++)
509
+ stdvga_crtc_write(crtc_addr, i, GET_GLOBAL(regs[i]));
510
+
511
+ // Set the misc register
512
+ stdvga_misc_write(miscreg);
513
+
514
+ // Enable video
515
+ stdvga_attrindex_write(0x20);
516
+
517
+ // Clear screen
518
+ if (!(flags & MF_NOCLEARMEM))
519
+ clear_screen(vmode_g);
520
+
521
+ // Write the fonts in memory
522
+ u8 memmodel = GET_GLOBAL(vmode_g->memmodel);
523
+ if (memmodel == MM_TEXT)
524
+ stdvga_load_font(get_global_seg(), vgafont16, 0x100, 0, 0, 16);
525
+
526
+ return 0;
527
+ }
528
+
529
+ // Load the standard palette associated with 8bpp packed pixel vga modes.
530
+ void
531
+ stdvga_set_packed_palette(void)
532
+ {
533
+ stdvga_dac_write(get_global_seg(), palette3, 0, sizeof(palette3) / 3);
534
+ }
@@ -0,0 +1,96 @@
1
+ // Virtual software based cursor support
2
+ //
3
+ // Copyright (C) 2014-2016 Kevin O'Connor <kevin@koconnor.net>
4
+ //
5
+ // This file may be distributed under the terms of the GNU LGPLv3 license.
6
+
7
+ #include "biosvar.h" // GET_BDA
8
+ #include "bregs.h" // struct bregs
9
+ #include "vgabios.h" // get_cursor_pos
10
+ #include "vgafb.h" // handle_gfx_op
11
+ #include "vgautil.h" // swcursor_check_event
12
+
13
+ // Draw/undraw a cursor on the framebuffer by xor'ing the cursor cell
14
+ static void
15
+ gfx_set_swcursor(struct vgamode_s *vmode_g, int enable, struct cursorpos cp)
16
+ {
17
+ u16 cursor_type = get_cursor_shape();
18
+ u8 start = cursor_type >> 8, end = cursor_type & 0xff;
19
+ struct gfx_op op;
20
+ init_gfx_op(&op, vmode_g);
21
+ op.x = cp.x * 8;
22
+ int cheight = GET_BDA(char_height);
23
+ op.y = cp.y * cheight + start;
24
+
25
+ int i;
26
+ for (i = start; i < cheight && i <= end; i++, op.y++) {
27
+ op.op = GO_READ8;
28
+ handle_gfx_op(&op);
29
+ int j;
30
+ for (j = 0; j < 8; j++)
31
+ op.pixels[j] ^= 0x07;
32
+ op.op = GO_WRITE8;
33
+ handle_gfx_op(&op);
34
+ }
35
+ }
36
+
37
+ // Draw/undraw a cursor on the screen
38
+ static void
39
+ set_swcursor(int enable)
40
+ {
41
+ u8 flags = GET_BDA_EXT(flags);
42
+ if (!!(flags & BF_SWCURSOR) == enable)
43
+ // Already in requested mode.
44
+ return;
45
+ struct vgamode_s *vmode_g = get_current_mode();
46
+ if (!vmode_g)
47
+ return;
48
+ struct cursorpos cp = get_cursor_pos(GET_BDA(video_page));
49
+ if (cp.x >= GET_BDA(video_cols) || cp.y > GET_BDA(video_rows)
50
+ || GET_BDA(cursor_type) >= 0x2000)
51
+ // Cursor not visible
52
+ return;
53
+
54
+ SET_BDA_EXT(flags, (flags & ~BF_SWCURSOR) | (enable ? BF_SWCURSOR : 0));
55
+
56
+ if (GET_GLOBAL(vmode_g->memmodel) != MM_TEXT) {
57
+ gfx_set_swcursor(vmode_g, enable, cp);
58
+ return;
59
+ }
60
+
61
+ // In text mode, swap foreground and background attributes for cursor
62
+ void *dest_far = text_address(cp) + 1;
63
+ u8 attr = GET_FARVAR(GET_GLOBAL(vmode_g->sstart), *(u8*)dest_far);
64
+ attr = (attr >> 4) | (attr << 4);
65
+ SET_FARVAR(GET_GLOBAL(vmode_g->sstart), *(u8*)dest_far, attr);
66
+ }
67
+
68
+ // Disable virtual cursor if a vgabios call accesses the framebuffer
69
+ void
70
+ swcursor_pre_handle10(struct bregs *regs)
71
+ {
72
+ if (!vga_emulate_text())
73
+ return;
74
+ switch (regs->ah) {
75
+ case 0x4f:
76
+ if (!CONFIG_VGA_VBE || regs->al != 0x02)
77
+ break;
78
+ // NO BREAK
79
+ case 0x00 ... 0x02:
80
+ case 0x05 ... 0x0e:
81
+ case 0x13:
82
+ set_swcursor(0);
83
+ break;
84
+ default:
85
+ break;
86
+ }
87
+ }
88
+
89
+ // Called by periodic (18.2hz) timer
90
+ void
91
+ swcursor_check_event(void)
92
+ {
93
+ if (!vga_emulate_text())
94
+ return;
95
+ set_swcursor(GET_BDA(timer_counter) % 18 < 9);
96
+ }