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,366 @@
1
+ #!/usr/bin/python
2
+ # Copyright (C) 2011 Red Hat, Inc., Michael S. Tsirkin <mst@redhat.com>
3
+ #
4
+ # This file may be distributed under the terms of the GNU GPLv3 license.
5
+
6
+ # Process mixed ASL/AML listing (.lst file) produced by iasl -l
7
+ # Locate and execute ACPI_EXTRACT directives, output offset info
8
+ #
9
+ # Documentation of ACPI_EXTRACT_* directive tags:
10
+ #
11
+ # These directive tags output offset information from AML for BIOS runtime
12
+ # table generation.
13
+ # Each directive is of the form:
14
+ # ACPI_EXTRACT_<TYPE> <array_name> <Operator> (...)
15
+ # and causes the extractor to create an array
16
+ # named <array_name> with offset, in the generated AML,
17
+ # of an object of a given type in the following <Operator>.
18
+ #
19
+ # A directive must fit on a single code line.
20
+ #
21
+ # Object type in AML is verified, a mismatch causes a build failure.
22
+ #
23
+ # Directives and operators currently supported are:
24
+ # ACPI_EXTRACT_NAME_DWORD_CONST - extract a Dword Const object from Name()
25
+ # ACPI_EXTRACT_NAME_WORD_CONST - extract a Word Const object from Name()
26
+ # ACPI_EXTRACT_NAME_BYTE_CONST - extract a Byte Const object from Name()
27
+ # ACPI_EXTRACT_METHOD_STRING - extract a NameString from Method()
28
+ # ACPI_EXTRACT_NAME_STRING - extract a NameString from Name()
29
+ # ACPI_EXTRACT_PROCESSOR_START - start of Processor() block
30
+ # ACPI_EXTRACT_PROCESSOR_STRING - extract a NameString from Processor()
31
+ # ACPI_EXTRACT_PROCESSOR_END - offset at last byte of Processor() + 1
32
+ # ACPI_EXTRACT_DEVICE_START - start of Device() block
33
+ # ACPI_EXTRACT_DEVICE_STRING - extract a NameString from Device()
34
+ # ACPI_EXTRACT_DEVICE_END - offset at last byte of Device() + 1
35
+ # ACPI_EXTRACT_PKG_START - start of Package block
36
+ #
37
+ # ACPI_EXTRACT_ALL_CODE - create an array storing the generated AML bytecode
38
+ #
39
+ # ACPI_EXTRACT is not allowed anywhere else in code, except in comments.
40
+
41
+ import re
42
+ import sys
43
+ import fileinput
44
+
45
+ aml = []
46
+ asl = []
47
+ output = {}
48
+ debug = ""
49
+
50
+ class asl_line:
51
+ line = None
52
+ lineno = None
53
+ aml_offset = None
54
+
55
+ def die(diag):
56
+ sys.stderr.write("Error: %s; %s\n" % (diag, debug))
57
+ sys.exit(1)
58
+
59
+ #Store an ASL command, matching AML offset, and input line (for debugging)
60
+ def add_asl(lineno, line):
61
+ l = asl_line()
62
+ l.line = line
63
+ l.lineno = lineno
64
+ l.aml_offset = len(aml)
65
+ asl.append(l)
66
+
67
+ #Store an AML byte sequence
68
+ #Verify that offset output by iasl matches # of bytes so far
69
+ def add_aml(offset, line):
70
+ o = int(offset, 16)
71
+ # Sanity check: offset must match size of code so far
72
+ if (o != len(aml)):
73
+ die("Offset 0x%x != 0x%x" % (o, len(aml)))
74
+ # Strip any trailing dots and ASCII dump after "
75
+ line = re.sub(r'\s*\.*\s*".*$', "", line)
76
+ # Strip traling whitespace
77
+ line = re.sub(r'\s+$', "", line)
78
+ # Strip leading whitespace
79
+ line = re.sub(r'^\s+', "", line)
80
+ # Split on whitespace
81
+ code = re.split(r'\s+', line)
82
+ for c in code:
83
+ # Require a legal hex number, two digits
84
+ if (not(re.search(r'^[0-9A-Fa-f][0-9A-Fa-f]$', c))):
85
+ die("Unexpected octet %s" % c)
86
+ aml.append(int(c, 16))
87
+
88
+ # Process aml bytecode array, decoding AML
89
+ def aml_pkglen_bytes(offset):
90
+ # PkgLength can be multibyte. Bits 8-7 give the # of extra bytes.
91
+ pkglenbytes = aml[offset] >> 6
92
+ return pkglenbytes + 1
93
+
94
+ def aml_pkglen(offset):
95
+ pkgstart = offset
96
+ pkglenbytes = aml_pkglen_bytes(offset)
97
+ pkglen = aml[offset] & 0x3F
98
+ # If multibyte, first nibble only uses bits 0-3
99
+ if ((pkglenbytes > 1) and (pkglen & 0x30)):
100
+ die("PkgLen bytes 0x%x but first nibble 0x%x expected 0x0X" %
101
+ (pkglen, pkglen))
102
+ offset += 1
103
+ pkglenbytes -= 1
104
+ for i in range(pkglenbytes):
105
+ pkglen |= aml[offset + i] << (i * 8 + 4)
106
+ if (len(aml) < pkgstart + pkglen):
107
+ die("PckgLen 0x%x at offset 0x%x exceeds AML size 0x%x" %
108
+ (pkglen, offset, len(aml)))
109
+ return pkglen
110
+
111
+ # Given method offset, find its NameString offset
112
+ def aml_method_string(offset):
113
+ #0x14 MethodOp PkgLength NameString MethodFlags TermList
114
+ if (aml[offset] != 0x14):
115
+ die( "Method offset 0x%x: expected 0x14 actual 0x%x" %
116
+ (offset, aml[offset]))
117
+ offset += 1
118
+ pkglenbytes = aml_pkglen_bytes(offset)
119
+ offset += pkglenbytes
120
+ return offset
121
+
122
+ # Given name offset, find its NameString offset
123
+ def aml_name_string(offset):
124
+ #0x08 NameOp NameString DataRef
125
+ if (aml[offset] != 0x08):
126
+ die( "Name offset 0x%x: expected 0x08 actual 0x%x" %
127
+ (offset, aml[offset]))
128
+ offset += 1
129
+ # Block Name Modifier. Skip it.
130
+ if (aml[offset] == 0x5c or aml[offset] == 0x5e):
131
+ offset += 1
132
+ return offset
133
+
134
+ # Given data offset, find 8 byte buffer offset
135
+ def aml_data_buffer8(offset):
136
+ #0x08 NameOp NameString DataRef
137
+ expect = [0x11, 0x0B, 0x0A, 0x08]
138
+ if (aml[offset:offset+4] != expect):
139
+ die( "Name offset 0x%x: expected %s actual %s" %
140
+ (offset, aml[offset:offset+4], expect))
141
+ return offset + len(expect)
142
+
143
+ # Given data offset, find dword const offset
144
+ def aml_data_dword_const(offset):
145
+ #0x08 NameOp NameString DataRef
146
+ if (aml[offset] != 0x0C):
147
+ die( "Name offset 0x%x: expected 0x0C actual 0x%x" %
148
+ (offset, aml[offset]))
149
+ return offset + 1
150
+
151
+ # Given data offset, find word const offset
152
+ def aml_data_word_const(offset):
153
+ #0x08 NameOp NameString DataRef
154
+ if (aml[offset] != 0x0B):
155
+ die( "Name offset 0x%x: expected 0x0B actual 0x%x" %
156
+ (offset, aml[offset]))
157
+ return offset + 1
158
+
159
+ # Given data offset, find byte const offset
160
+ def aml_data_byte_const(offset):
161
+ #0x08 NameOp NameString DataRef
162
+ if (aml[offset] != 0x0A):
163
+ die( "Name offset 0x%x: expected 0x0A actual 0x%x" %
164
+ (offset, aml[offset]))
165
+ return offset + 1
166
+
167
+ # Find name'd buffer8
168
+ def aml_name_buffer8(offset):
169
+ return aml_data_buffer8(aml_name_string(offset) + 4)
170
+
171
+ # Given name offset, find dword const offset
172
+ def aml_name_dword_const(offset):
173
+ return aml_data_dword_const(aml_name_string(offset) + 4)
174
+
175
+ # Given name offset, find word const offset
176
+ def aml_name_word_const(offset):
177
+ return aml_data_word_const(aml_name_string(offset) + 4)
178
+
179
+ # Given name offset, find byte const offset
180
+ def aml_name_byte_const(offset):
181
+ return aml_data_byte_const(aml_name_string(offset) + 4)
182
+
183
+ def aml_device_start(offset):
184
+ #0x5B 0x82 DeviceOp PkgLength NameString
185
+ if ((aml[offset] != 0x5B) or (aml[offset + 1] != 0x82)):
186
+ die( "Name offset 0x%x: expected 0x5B 0x82 actual 0x%x 0x%x" %
187
+ (offset, aml[offset], aml[offset + 1]))
188
+ return offset
189
+
190
+ def aml_device_string(offset):
191
+ #0x5B 0x82 DeviceOp PkgLength NameString
192
+ start = aml_device_start(offset)
193
+ offset += 2
194
+ pkglenbytes = aml_pkglen_bytes(offset)
195
+ offset += pkglenbytes
196
+ return offset
197
+
198
+ def aml_device_end(offset):
199
+ start = aml_device_start(offset)
200
+ offset += 2
201
+ pkglenbytes = aml_pkglen_bytes(offset)
202
+ pkglen = aml_pkglen(offset)
203
+ return offset + pkglen
204
+
205
+ def aml_processor_start(offset):
206
+ #0x5B 0x83 ProcessorOp PkgLength NameString ProcID
207
+ if ((aml[offset] != 0x5B) or (aml[offset + 1] != 0x83)):
208
+ die( "Name offset 0x%x: expected 0x5B 0x83 actual 0x%x 0x%x" %
209
+ (offset, aml[offset], aml[offset + 1]))
210
+ return offset
211
+
212
+ def aml_processor_string(offset):
213
+ #0x5B 0x83 ProcessorOp PkgLength NameString ProcID
214
+ start = aml_processor_start(offset)
215
+ offset += 2
216
+ pkglenbytes = aml_pkglen_bytes(offset)
217
+ offset += pkglenbytes
218
+ return offset
219
+
220
+ def aml_processor_end(offset):
221
+ start = aml_processor_start(offset)
222
+ offset += 2
223
+ pkglenbytes = aml_pkglen_bytes(offset)
224
+ pkglen = aml_pkglen(offset)
225
+ return offset + pkglen
226
+
227
+ def aml_package_start(offset):
228
+ offset = aml_name_string(offset) + 4
229
+ # 0x12 PkgLength NumElements PackageElementList
230
+ if (aml[offset] != 0x12):
231
+ die( "Name offset 0x%x: expected 0x12 actual 0x%x" %
232
+ (offset, aml[offset]))
233
+ offset += 1
234
+ return offset + aml_pkglen_bytes(offset) + 1
235
+
236
+ def get_value_type(maxvalue):
237
+ #Use type large enough to fit the table
238
+ if (maxvalue >= 0x10000):
239
+ return "int"
240
+ elif (maxvalue >= 0x100):
241
+ return "short"
242
+ else:
243
+ return "char"
244
+
245
+ def main():
246
+ global debug
247
+ lineno = 0
248
+ for line in fileinput.input():
249
+ # Strip trailing newline
250
+ line = line.rstrip()
251
+ # line number and debug string to output in case of errors
252
+ lineno = lineno + 1
253
+ debug = "input line %d: %s" % (lineno, line)
254
+ #ASL listing: space, then line#, then ...., then code
255
+ pasl = re.compile('^\s+([0-9]+)(:\s\s|\.\.\.\.)\s*')
256
+ m = pasl.search(line)
257
+ if (m):
258
+ add_asl(lineno, pasl.sub("", line))
259
+ # AML listing: offset in hex, then ...., then code
260
+ paml = re.compile('^([0-9A-Fa-f]+)(:\s\s|\.\.\.\.)\s*')
261
+ m = paml.search(line)
262
+ if (m):
263
+ add_aml(m.group(1), paml.sub("", line))
264
+
265
+ # Now go over code
266
+ # Track AML offset of a previous non-empty ASL command
267
+ prev_aml_offset = -1
268
+ for i in range(len(asl)):
269
+ debug = "input line %d: %s" % (asl[i].lineno, asl[i].line)
270
+
271
+ l = asl[i].line
272
+
273
+ # skip if not an extract directive
274
+ a = len(re.findall(r'ACPI_EXTRACT', l))
275
+ if (not a):
276
+ # If not empty, store AML offset. Will be used for sanity checks
277
+ # IASL seems to put {}. at random places in the listing.
278
+ # Ignore any non-words for the purpose of this test.
279
+ m = re.search(r'\w+', l)
280
+ if (m):
281
+ prev_aml_offset = asl[i].aml_offset
282
+ continue
283
+
284
+ if (a > 1):
285
+ die("Expected at most one ACPI_EXTRACT per line, actual %d" % a)
286
+
287
+ mext = re.search(r'''
288
+ ^\s* # leading whitespace
289
+ /\*\s* # start C comment
290
+ (ACPI_EXTRACT_\w+) # directive: group(1)
291
+ \s+ # whitspace separates directive from array name
292
+ (\w+) # array name: group(2)
293
+ \s*\*/ # end of C comment
294
+ \s*$ # trailing whitespace
295
+ ''', l, re.VERBOSE)
296
+ if (not mext):
297
+ die("Stray ACPI_EXTRACT in input")
298
+
299
+ # previous command must have produced some AML,
300
+ # otherwise we are in a middle of a block
301
+ if (prev_aml_offset == asl[i].aml_offset):
302
+ die("ACPI_EXTRACT directive in the middle of a block")
303
+
304
+ directive = mext.group(1)
305
+ array = mext.group(2)
306
+ offset = asl[i].aml_offset
307
+
308
+ if (directive == "ACPI_EXTRACT_ALL_CODE"):
309
+ if array in output:
310
+ die("%s directive used more than once" % directive)
311
+ output[array] = aml
312
+ continue
313
+ if (directive == "ACPI_EXTRACT_NAME_BUFFER8"):
314
+ offset = aml_name_buffer8(offset)
315
+ elif (directive == "ACPI_EXTRACT_NAME_DWORD_CONST"):
316
+ offset = aml_name_dword_const(offset)
317
+ elif (directive == "ACPI_EXTRACT_NAME_WORD_CONST"):
318
+ offset = aml_name_word_const(offset)
319
+ elif (directive == "ACPI_EXTRACT_NAME_BYTE_CONST"):
320
+ offset = aml_name_byte_const(offset)
321
+ elif (directive == "ACPI_EXTRACT_NAME_STRING"):
322
+ offset = aml_name_string(offset)
323
+ elif (directive == "ACPI_EXTRACT_METHOD_STRING"):
324
+ offset = aml_method_string(offset)
325
+ elif (directive == "ACPI_EXTRACT_DEVICE_START"):
326
+ offset = aml_device_start(offset)
327
+ elif (directive == "ACPI_EXTRACT_DEVICE_STRING"):
328
+ offset = aml_device_string(offset)
329
+ elif (directive == "ACPI_EXTRACT_DEVICE_END"):
330
+ offset = aml_device_end(offset)
331
+ elif (directive == "ACPI_EXTRACT_PROCESSOR_START"):
332
+ offset = aml_processor_start(offset)
333
+ elif (directive == "ACPI_EXTRACT_PROCESSOR_STRING"):
334
+ offset = aml_processor_string(offset)
335
+ elif (directive == "ACPI_EXTRACT_PROCESSOR_END"):
336
+ offset = aml_processor_end(offset)
337
+ elif (directive == "ACPI_EXTRACT_PKG_START"):
338
+ offset = aml_package_start(offset)
339
+ else:
340
+ die("Unsupported directive %s" % directive)
341
+
342
+ if array not in output:
343
+ output[array] = []
344
+ output[array].append(offset)
345
+
346
+ debug = "at end of file"
347
+
348
+ # Pretty print output
349
+ outstrs = ["/* DO NOT EDIT! This is an autogenerated file."
350
+ " See scripts/acpi_extract.py. */"]
351
+ for array in output.keys():
352
+ otype = get_value_type(max(output[array]))
353
+ outstrs.append("static unsigned %s %s[] = {" % (otype, array))
354
+ odata = []
355
+ for value in output[array]:
356
+ odata.append("0x%02x" % value)
357
+ if len(odata) >= 8:
358
+ outstrs.append(" %s," % (', '.join(odata),))
359
+ del odata[:]
360
+ outstrs.append(" %s" % (', '.join(odata),))
361
+ outstrs.append('};')
362
+ outstrs.append('')
363
+ sys.stdout.write('\n'.join(outstrs))
364
+
365
+ if __name__ == '__main__':
366
+ main()
@@ -0,0 +1,41 @@
1
+ #!/usr/bin/python
2
+ # Copyright (C) 2011 Red Hat, Inc., Michael S. Tsirkin <mst@redhat.com>
3
+ #
4
+ # This file may be distributed under the terms of the GNU GPLv3 license.
5
+
6
+ # Read a preprocessed ASL listing and put each ACPI_EXTRACT
7
+ # directive in a comment, to make iasl skip it.
8
+ # We also put each directive on a new line, the machinery
9
+ # in scripts/acpi_extract.py requires this.
10
+
11
+ import re
12
+ import sys
13
+ import fileinput
14
+
15
+ def die(diag):
16
+ sys.stderr.write("Error: %s\n" % (diag))
17
+ sys.exit(1)
18
+
19
+ # Note: () around pattern make split return matched string as part of list
20
+ psplit = re.compile(r''' (
21
+ \b # At word boundary
22
+ ACPI_EXTRACT_\w+ # directive
23
+ \s+ # some whitespace
24
+ \w+ # array name
25
+ )''', re.VERBOSE)
26
+
27
+ lineno = 0
28
+ for line in fileinput.input():
29
+ # line number and debug string to output in case of errors
30
+ lineno = lineno + 1
31
+ debug = "input line %d: %s" % (lineno, line.rstrip())
32
+
33
+ s = psplit.split(line)
34
+ # The way split works, each odd item is the matching ACPI_EXTRACT directive.
35
+ # Put each in a comment, and on a line by itself.
36
+ for i in range(len(s)):
37
+ if (i % 2):
38
+ sys.stdout.write("\n/* %s */\n" % s[i])
39
+ else:
40
+ sys.stdout.write(s[i])
41
+
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env python
2
+ # Fill in checksum/size of an option rom, and pad it to proper length.
3
+ #
4
+ # Copyright (C) 2009 Kevin O'Connor <kevin@koconnor.net>
5
+ #
6
+ # This file may be distributed under the terms of the GNU GPLv3 license.
7
+
8
+ import sys, struct
9
+
10
+ from python23compat import as_bytes
11
+
12
+ def alignpos(pos, alignbytes):
13
+ mask = alignbytes - 1
14
+ return (pos + mask) & ~mask
15
+
16
+ def checksum(data):
17
+ if (sys.version_info > (3, 0)):
18
+ cksum = sum(data)
19
+ else:
20
+ cksum = sum(map(ord, data))
21
+ return struct.pack('<B', (0x100 - cksum) & 0xff)
22
+
23
+ def main():
24
+ inname = sys.argv[1]
25
+ outname = sys.argv[2]
26
+
27
+ # Read data in
28
+ f = open(inname, 'rb')
29
+ data = f.read()
30
+ f.close()
31
+ count = len(data)
32
+
33
+ # Pad to a 512 byte boundary
34
+ data += as_bytes("\0") * (alignpos(count, 512) - count)
35
+ count = len(data)
36
+
37
+ # Check if a pci header is present
38
+ pcidata = ord(data[24:25]) + (ord(data[25:26]) << 8)
39
+ if pcidata != 0:
40
+ blocks = struct.pack('<H', int(count/512))
41
+ data = data[:pcidata + 16] + blocks + data[pcidata + 18:]
42
+
43
+ # Fill in size field; clear checksum field
44
+ blocks = struct.pack('<B', int(count/512))
45
+ data = data[:2] + blocks + data[3:6] + as_bytes("\0") + data[7:]
46
+
47
+ # Checksum rom
48
+ data = data[:6] + checksum(data) + data[7:]
49
+
50
+ # Write new rom
51
+ f = open(outname, 'wb')
52
+ f.write(data)
53
+ f.close()
54
+
55
+ if __name__ == '__main__':
56
+ main()
@@ -0,0 +1,134 @@
1
+ #!/usr/bin/env python
2
+ # Generate version information for a program
3
+ #
4
+ # Copyright (C) 2015 Kevin O'Connor <kevin@koconnor.net>
5
+ #
6
+ # This file may be distributed under the terms of the GNU GPLv3 license.
7
+ import sys, os, subprocess, shlex, time, socket, optparse, logging, traceback
8
+
9
+ VERSION_FORMAT = """
10
+ /* DO NOT EDIT! This is an autogenerated file. See scripts/buildversion.py. */
11
+ #define BUILD_VERSION "%s"
12
+ #define BUILD_TOOLS "%s"
13
+ """
14
+
15
+ # Run program and return the specified output
16
+ def check_output(prog):
17
+ logging.debug("Running %s" % (repr(prog),))
18
+ try:
19
+ process = subprocess.Popen(shlex.split(prog), stdout=subprocess.PIPE)
20
+ output = process.communicate()[0]
21
+ retcode = process.poll()
22
+ except OSError:
23
+ logging.debug("Exception on run: %s" % (traceback.format_exc(),))
24
+ return ""
25
+ logging.debug("Got (code=%s): %s" % (retcode, repr(output)))
26
+ if retcode:
27
+ return ""
28
+ try:
29
+ return output.decode()
30
+ except UnicodeError:
31
+ logging.debug("Exception on decode: %s" % (traceback.format_exc(),))
32
+ return ""
33
+
34
+ # Obtain version info from "git" program
35
+ def git_version():
36
+ if not os.path.exists('.git'):
37
+ logging.debug("No '.git' file/directory found")
38
+ return ""
39
+ ver = check_output("git describe --always --tags --long --dirty").strip()
40
+ logging.debug("Got git version: %s" % (repr(ver),))
41
+ return ver
42
+
43
+ # Look for version in a ".version" file. Official release tarballs
44
+ # have this file (see scripts/tarball.sh).
45
+ def file_version():
46
+ if not os.path.isfile('.version'):
47
+ logging.debug("No '.version' file found")
48
+ return ""
49
+ try:
50
+ f = open('.version', 'r')
51
+ ver = f.readline().strip()
52
+ f.close()
53
+ except OSError:
54
+ logging.debug("Exception on read: %s" % (traceback.format_exc(),))
55
+ return ""
56
+ logging.debug("Got .version: %s" % (repr(ver),))
57
+ return ver
58
+
59
+ # Generate an output file with the version information
60
+ def write_version(outfile, version, toolstr):
61
+ logging.debug("Write file %s and %s" % (repr(version), repr(toolstr)))
62
+ sys.stdout.write("Version: %s\n" % (version,))
63
+ f = open(outfile, 'w')
64
+ f.write(VERSION_FORMAT % (version, toolstr))
65
+ f.close()
66
+
67
+ # Run "tool --version" for each specified tool and extract versions
68
+ def tool_versions(tools):
69
+ tools = [t.strip() for t in tools.split(';')]
70
+ versions = ['', '']
71
+ success = 0
72
+ for tool in tools:
73
+ # Extract first line from "tool --version" output
74
+ verstr = check_output("%s --version" % (tool,)).split('\n')[0]
75
+ # Check if this tool looks like a binutils program
76
+ isbinutils = 0
77
+ if verstr.startswith('GNU '):
78
+ isbinutils = 1
79
+ verstr = verstr[4:]
80
+ # Extract version information and exclude program name
81
+ if ' ' not in verstr:
82
+ continue
83
+ prog, ver = verstr.split(' ', 1)
84
+ if not prog or not ver:
85
+ continue
86
+ # Check for any version conflicts
87
+ if versions[isbinutils] and versions[isbinutils] != ver:
88
+ logging.debug("Mixed version %s vs %s" % (
89
+ repr(versions[isbinutils]), repr(ver)))
90
+ versions[isbinutils] = "mixed"
91
+ continue
92
+ versions[isbinutils] = ver
93
+ success += 1
94
+ cleanbuild = versions[0] and versions[1] and success == len(tools)
95
+ return cleanbuild, "gcc: %s binutils: %s" % (versions[0], versions[1])
96
+
97
+ def main():
98
+ usage = "%prog [options] <outputheader.h>"
99
+ opts = optparse.OptionParser(usage)
100
+ opts.add_option("-e", "--extra", dest="extra", default="",
101
+ help="extra version string to append to version")
102
+ opts.add_option("-t", "--tools", dest="tools", default="",
103
+ help="list of build programs to extract version from")
104
+ opts.add_option("-v", action="store_true", dest="verbose",
105
+ help="enable debug messages")
106
+
107
+ options, args = opts.parse_args()
108
+ if len(args) != 1:
109
+ opts.error("Incorrect arguments")
110
+ outfile = args[0]
111
+ if options.verbose:
112
+ logging.basicConfig(level=logging.DEBUG)
113
+
114
+ cleanbuild, toolstr = tool_versions(options.tools)
115
+
116
+ ver = git_version()
117
+ cleanbuild = cleanbuild and 'dirty' not in ver
118
+ if not ver:
119
+ ver = file_version()
120
+ # We expect the "extra version" to contain information on the
121
+ # distributor and distribution package version (if
122
+ # applicable). It is a "clean" build if this is a build from
123
+ # an official release tarball and the above info is present.
124
+ cleanbuild = cleanbuild and ver and options.extra != ""
125
+ if not ver:
126
+ ver = "?"
127
+ if not cleanbuild:
128
+ btime = time.strftime("%Y%m%d_%H%M%S")
129
+ hostname = socket.gethostname()
130
+ ver = "%s-%s-%s" % (ver, btime, hostname)
131
+ write_version(outfile, ver + options.extra, toolstr)
132
+
133
+ if __name__ == '__main__':
134
+ main()
@@ -0,0 +1,95 @@
1
+ #!/usr/bin/env python
2
+ # Script to check a bios image and report info on it.
3
+ #
4
+ # Copyright (C) 2008 Kevin O'Connor <kevin@koconnor.net>
5
+ #
6
+ # This file may be distributed under the terms of the GNU GPLv3 license.
7
+
8
+ import sys, struct
9
+ import layoutrom, buildrom
10
+
11
+ from python23compat import as_bytes
12
+
13
+ def subst(data, offset, new):
14
+ return data[:offset] + new + data[offset + len(new):]
15
+
16
+ def checksum(data, start, size, csum):
17
+ sumbyte = buildrom.checksum(data[start:start+size])
18
+ return subst(data, start+csum, sumbyte)
19
+
20
+ def main():
21
+ # Get args
22
+ objinfo, finalsize, rawfile, outfile = sys.argv[1:]
23
+
24
+ # Read in symbols
25
+ objinfofile = open(objinfo, 'r')
26
+ symbols = layoutrom.parseObjDump(objinfofile, 'in')[1]
27
+
28
+ # Read in raw file
29
+ f = open(rawfile, 'rb')
30
+ rawdata = f.read()
31
+ f.close()
32
+ datasize = len(rawdata)
33
+ finalsize = int(finalsize) * 1024
34
+ if finalsize == 0:
35
+ finalsize = 64*1024
36
+ if datasize > 64*1024:
37
+ finalsize = 128*1024
38
+ if datasize > 128*1024:
39
+ finalsize = 256*1024
40
+ if datasize > finalsize:
41
+ print("Error! ROM doesn't fit (%d > %d)" % (datasize, finalsize))
42
+ print(" You have to either increase the size (CONFIG_ROM_SIZE)")
43
+ print(" or turn off some features (such as hardware support not")
44
+ print(" needed) to make it fit. Trying a more recent gcc version")
45
+ print(" might work too.")
46
+ sys.exit(1)
47
+
48
+ # Sanity checks
49
+ start = symbols['code32flat_start'].offset
50
+ end = symbols['code32flat_end'].offset
51
+ expend = layoutrom.BUILD_BIOS_ADDR + layoutrom.BUILD_BIOS_SIZE
52
+ if end != expend:
53
+ print("Error! Code does not end at 0x%x (got 0x%x)" % (
54
+ expend, end))
55
+ sys.exit(1)
56
+ if datasize > finalsize:
57
+ print("Error! Code is too big (0x%x vs 0x%x)" % (
58
+ datasize, finalsize))
59
+ sys.exit(1)
60
+ expdatasize = end - start
61
+ if datasize != expdatasize:
62
+ print("Error! Unknown extra data (0x%x vs 0x%x)" % (
63
+ datasize, expdatasize))
64
+ sys.exit(1)
65
+
66
+ # Fix up CSM Compatibility16 table
67
+ if 'csm_compat_table' in symbols and 'entry_csm' in symbols:
68
+ # Field offsets within EFI_COMPATIBILITY16_TABLE
69
+ ENTRY_FIELD_OFS = 14 # Compatibility16CallOffset (UINT16)
70
+ SIZE_FIELD_OFS = 5 # TableLength (UINT8)
71
+ CSUM_FIELD_OFS = 4 # TableChecksum (UINT8)
72
+
73
+ tableofs = symbols['csm_compat_table'].offset - symbols['code32flat_start'].offset
74
+ entry_addr = symbols['entry_csm'].offset - layoutrom.BUILD_BIOS_ADDR
75
+ entry_addr = struct.pack('<H', entry_addr)
76
+ rawdata = subst(rawdata, tableofs+ENTRY_FIELD_OFS, entry_addr)
77
+
78
+ tsfield = tableofs+SIZE_FIELD_OFS
79
+ tablesize = ord(rawdata[tsfield:tsfield+1])
80
+ rawdata = checksum(rawdata, tableofs, tablesize, CSUM_FIELD_OFS)
81
+
82
+ # Print statistics
83
+ runtimesize = end - symbols['code32init_end'].offset
84
+ print("Total size: %d Fixed: %d Free: %d (used %.1f%% of %dKiB rom)" % (
85
+ datasize, runtimesize, finalsize - datasize
86
+ , (datasize / float(finalsize)) * 100.0
87
+ , int(finalsize / 1024)))
88
+
89
+ # Write final file
90
+ f = open(outfile, 'wb')
91
+ f.write((as_bytes("\0") * (finalsize - datasize)) + rawdata)
92
+ f.close()
93
+
94
+ if __name__ == '__main__':
95
+ main()