v86 0.3.7 → 0.5.10
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.
- package/Readme.md +64 -108
- package/build/libv86-debug.js +12677 -0
- package/build/libv86-debug.mjs +732 -0
- package/build/libv86.js +710 -0
- package/build/libv86.mjs +636 -0
- package/build/v86-debug.wasm +0 -0
- package/build/v86-fallback.wasm +0 -0
- package/build/v86.wasm +0 -0
- package/package.json +12 -35
- package/bios/.gitignore +0 -1
- package/bios/COPYING.LESSER +0 -165
- package/bios/bochs-bios.bin +0 -0
- package/bios/bochs-vgabios.bin +0 -0
- package/bios/fetch-and-build-seabios.sh +0 -13
- package/bios/seabios/.config +0 -113
- package/bios/seabios/.config.old +0 -114
- package/bios/seabios/.gitignore +0 -4
- package/bios/seabios/COPYING +0 -674
- package/bios/seabios/COPYING.LESSER +0 -165
- package/bios/seabios/Makefile +0 -286
- package/bios/seabios/README +0 -17
- package/bios/seabios/docs/Build_overview.md +0 -104
- package/bios/seabios/docs/Contributing.md +0 -20
- package/bios/seabios/docs/Debugging.md +0 -111
- package/bios/seabios/docs/Developer_Documentation.md +0 -25
- package/bios/seabios/docs/Developer_links.md +0 -86
- package/bios/seabios/docs/Download.md +0 -27
- package/bios/seabios/docs/Execution_and_code_flow.md +0 -178
- package/bios/seabios/docs/Linking_overview.md +0 -160
- package/bios/seabios/docs/Mailinglist.md +0 -8
- package/bios/seabios/docs/Memory_Model.md +0 -253
- package/bios/seabios/docs/README +0 -5
- package/bios/seabios/docs/Releases.md +0 -482
- package/bios/seabios/docs/Runtime_config.md +0 -193
- package/bios/seabios/docs/SeaBIOS.md +0 -17
- package/bios/seabios/docs/SeaVGABIOS.md +0 -39
- package/bios/seabios/out/autoconf.h +0 -117
- package/bios/seabios/out/include/config/acpi/dsdt.h +0 -0
- package/bios/seabios/out/include/config/acpi.h +0 -0
- package/bios/seabios/out/include/config/ahci.h +0 -0
- package/bios/seabios/out/include/config/apmbios.h +0 -0
- package/bios/seabios/out/include/config/ata/dma.h +0 -0
- package/bios/seabios/out/include/config/ata/pio32.h +0 -0
- package/bios/seabios/out/include/config/ata.h +0 -0
- package/bios/seabios/out/include/config/auto.conf +0 -69
- package/bios/seabios/out/include/config/auto.conf.cmd +0 -9
- package/bios/seabios/out/include/config/boot.h +0 -0
- package/bios/seabios/out/include/config/bootorder.h +0 -0
- package/bios/seabios/out/include/config/build/vgabios.h +0 -0
- package/bios/seabios/out/include/config/call32/smm.h +0 -0
- package/bios/seabios/out/include/config/cdrom/boot.h +0 -0
- package/bios/seabios/out/include/config/cdrom/emu.h +0 -0
- package/bios/seabios/out/include/config/debug/level.h +0 -0
- package/bios/seabios/out/include/config/drives.h +0 -0
- package/bios/seabios/out/include/config/entry/extrastack.h +0 -0
- package/bios/seabios/out/include/config/esp/scsi.h +0 -0
- package/bios/seabios/out/include/config/flash/floppy.h +0 -0
- package/bios/seabios/out/include/config/floppy.h +0 -0
- package/bios/seabios/out/include/config/fw/romfile/load.h +0 -0
- package/bios/seabios/out/include/config/hardware/irq.h +0 -0
- package/bios/seabios/out/include/config/kbd/call/int15/4f.h +0 -0
- package/bios/seabios/out/include/config/keyboard.h +0 -0
- package/bios/seabios/out/include/config/lpt.h +0 -0
- package/bios/seabios/out/include/config/lsi/scsi.h +0 -0
- package/bios/seabios/out/include/config/malloc/uppermemory.h +0 -0
- package/bios/seabios/out/include/config/megasas.h +0 -0
- package/bios/seabios/out/include/config/mouse.h +0 -0
- package/bios/seabios/out/include/config/mpt/scsi.h +0 -0
- package/bios/seabios/out/include/config/mptable.h +0 -0
- package/bios/seabios/out/include/config/mtrr/init.h +0 -0
- package/bios/seabios/out/include/config/optionroms.h +0 -0
- package/bios/seabios/out/include/config/override/pci/id.h +0 -0
- package/bios/seabios/out/include/config/pcibios.h +0 -0
- package/bios/seabios/out/include/config/pirtable.h +0 -0
- package/bios/seabios/out/include/config/pmm.h +0 -0
- package/bios/seabios/out/include/config/pmtimer.h +0 -0
- package/bios/seabios/out/include/config/pnpbios.h +0 -0
- package/bios/seabios/out/include/config/ps2port.h +0 -0
- package/bios/seabios/out/include/config/pvscsi.h +0 -0
- package/bios/seabios/out/include/config/qemu/hardware.h +0 -0
- package/bios/seabios/out/include/config/qemu.h +0 -0
- package/bios/seabios/out/include/config/rom/size.h +0 -0
- package/bios/seabios/out/include/config/rtc/timer.h +0 -0
- package/bios/seabios/out/include/config/s3/resume.h +0 -0
- package/bios/seabios/out/include/config/sdcard.h +0 -0
- package/bios/seabios/out/include/config/serial.h +0 -0
- package/bios/seabios/out/include/config/tcgbios.h +0 -0
- package/bios/seabios/out/include/config/threads.h +0 -0
- package/bios/seabios/out/include/config/tristate.conf +0 -4
- package/bios/seabios/out/include/config/tsc/timer.h +0 -0
- package/bios/seabios/out/include/config/use/smm.h +0 -0
- package/bios/seabios/out/include/config/vga/allocate/extra/stack.h +0 -0
- package/bios/seabios/out/include/config/vga/bochs/stdvga.h +0 -0
- package/bios/seabios/out/include/config/vga/bochs.h +0 -0
- package/bios/seabios/out/include/config/vga/did.h +0 -0
- package/bios/seabios/out/include/config/vga/extra/stack/size.h +0 -0
- package/bios/seabios/out/include/config/vga/fixup/asm.h +0 -0
- package/bios/seabios/out/include/config/vga/pci.h +0 -0
- package/bios/seabios/out/include/config/vga/stdvga/ports.h +0 -0
- package/bios/seabios/out/include/config/vga/vbe.h +0 -0
- package/bios/seabios/out/include/config/vga/vid.h +0 -0
- package/bios/seabios/out/include/config/vgahooks.h +0 -0
- package/bios/seabios/out/include/config/virtio/blk.h +0 -0
- package/bios/seabios/out/include/config/virtio/scsi.h +0 -0
- package/bios/seabios/out/include/config/xen.h +0 -0
- package/bios/seabios/out/scripts/kconfig/conf +0 -0
- package/bios/seabios/out/scripts/kconfig/conf.o +0 -0
- package/bios/seabios/out/scripts/kconfig/zconf.hash.c +0 -289
- package/bios/seabios/out/scripts/kconfig/zconf.lex.c +0 -2420
- package/bios/seabios/out/scripts/kconfig/zconf.tab.c +0 -2538
- package/bios/seabios/out/scripts/kconfig/zconf.tab.o +0 -0
- package/bios/seabios/scripts/acpi_extract.py +0 -366
- package/bios/seabios/scripts/acpi_extract_preprocess.py +0 -41
- package/bios/seabios/scripts/buildrom.py +0 -56
- package/bios/seabios/scripts/buildversion.py +0 -134
- package/bios/seabios/scripts/checkrom.py +0 -95
- package/bios/seabios/scripts/checkstack.py +0 -226
- package/bios/seabios/scripts/checksum.py +0 -16
- package/bios/seabios/scripts/encodeint.py +0 -21
- package/bios/seabios/scripts/gen-offsets.sh +0 -17
- package/bios/seabios/scripts/kconfig/.gitignore +0 -22
- package/bios/seabios/scripts/kconfig/Makefile +0 -331
- package/bios/seabios/scripts/kconfig/POTFILES.in +0 -12
- package/bios/seabios/scripts/kconfig/check.sh +0 -13
- package/bios/seabios/scripts/kconfig/conf.c +0 -718
- package/bios/seabios/scripts/kconfig/confdata.c +0 -1250
- package/bios/seabios/scripts/kconfig/expr.c +0 -1168
- package/bios/seabios/scripts/kconfig/expr.h +0 -241
- package/bios/seabios/scripts/kconfig/gconf.c +0 -1542
- package/bios/seabios/scripts/kconfig/gconf.glade +0 -661
- package/bios/seabios/scripts/kconfig/images.c +0 -326
- package/bios/seabios/scripts/kconfig/kxgettext.c +0 -235
- package/bios/seabios/scripts/kconfig/lex.zconf.c +0 -2430
- package/bios/seabios/scripts/kconfig/list.h +0 -131
- package/bios/seabios/scripts/kconfig/lkc.h +0 -200
- package/bios/seabios/scripts/kconfig/lkc_proto.h +0 -57
- package/bios/seabios/scripts/kconfig/lxdialog/.gitignore +0 -4
- package/bios/seabios/scripts/kconfig/lxdialog/BIG.FAT.WARNING +0 -4
- package/bios/seabios/scripts/kconfig/lxdialog/check-lxdialog.sh +0 -87
- package/bios/seabios/scripts/kconfig/lxdialog/checklist.c +0 -332
- package/bios/seabios/scripts/kconfig/lxdialog/dialog.h +0 -257
- package/bios/seabios/scripts/kconfig/lxdialog/inputbox.c +0 -301
- package/bios/seabios/scripts/kconfig/lxdialog/menubox.c +0 -437
- package/bios/seabios/scripts/kconfig/lxdialog/textbox.c +0 -408
- package/bios/seabios/scripts/kconfig/lxdialog/util.c +0 -713
- package/bios/seabios/scripts/kconfig/lxdialog/yesno.c +0 -114
- package/bios/seabios/scripts/kconfig/mconf.c +0 -1036
- package/bios/seabios/scripts/kconfig/menu.c +0 -697
- package/bios/seabios/scripts/kconfig/merge_config.sh +0 -150
- package/bios/seabios/scripts/kconfig/nconf.c +0 -1556
- package/bios/seabios/scripts/kconfig/nconf.gui.c +0 -656
- package/bios/seabios/scripts/kconfig/nconf.h +0 -96
- package/bios/seabios/scripts/kconfig/qconf.cc +0 -1795
- package/bios/seabios/scripts/kconfig/qconf.h +0 -338
- package/bios/seabios/scripts/kconfig/streamline_config.pl +0 -647
- package/bios/seabios/scripts/kconfig/symbol.c +0 -1373
- package/bios/seabios/scripts/kconfig/util.c +0 -157
- package/bios/seabios/scripts/kconfig/zconf.gperf +0 -48
- package/bios/seabios/scripts/kconfig/zconf.hash.c_shipped +0 -289
- package/bios/seabios/scripts/kconfig/zconf.l +0 -363
- package/bios/seabios/scripts/kconfig/zconf.lex.c_shipped +0 -2420
- package/bios/seabios/scripts/kconfig/zconf.tab.c_shipped +0 -2538
- package/bios/seabios/scripts/kconfig/zconf.y +0 -733
- package/bios/seabios/scripts/layoutrom.py +0 -705
- package/bios/seabios/scripts/python23compat.py +0 -14
- package/bios/seabios/scripts/readserial.py +0 -190
- package/bios/seabios/scripts/tarball.sh +0 -36
- package/bios/seabios/scripts/test-build.sh +0 -90
- package/bios/seabios/scripts/transdump.py +0 -53
- package/bios/seabios/scripts/vgafixup.py +0 -96
- package/bios/seabios/src/Kconfig +0 -579
- package/bios/seabios/src/apm.c +0 -215
- package/bios/seabios/src/asm-offsets.c +0 -23
- package/bios/seabios/src/biosvar.h +0 -130
- package/bios/seabios/src/block.c +0 -623
- package/bios/seabios/src/block.h +0 -121
- package/bios/seabios/src/bmp.c +0 -117
- package/bios/seabios/src/boot.c +0 -793
- package/bios/seabios/src/bootsplash.c +0 -255
- package/bios/seabios/src/bregs.h +0 -80
- package/bios/seabios/src/byteorder.h +0 -71
- package/bios/seabios/src/cdrom.c +0 -322
- package/bios/seabios/src/clock.c +0 -506
- package/bios/seabios/src/code16gcc.s +0 -1
- package/bios/seabios/src/config.h +0 -108
- package/bios/seabios/src/cp437.c +0 -275
- package/bios/seabios/src/cp437.h +0 -1
- package/bios/seabios/src/disk.c +0 -779
- package/bios/seabios/src/e820map.c +0 -152
- package/bios/seabios/src/e820map.h +0 -26
- package/bios/seabios/src/entryfuncs.S +0 -165
- package/bios/seabios/src/farptr.h +0 -208
- package/bios/seabios/src/font.c +0 -139
- package/bios/seabios/src/fw/acpi-dsdt-cpu-hotplug.dsl +0 -78
- package/bios/seabios/src/fw/acpi-dsdt-dbug.dsl +0 -26
- package/bios/seabios/src/fw/acpi-dsdt-hpet.dsl +0 -36
- package/bios/seabios/src/fw/acpi-dsdt-isa.dsl +0 -102
- package/bios/seabios/src/fw/acpi-dsdt-pci-crs.dsl +0 -90
- package/bios/seabios/src/fw/acpi-dsdt.dsl +0 -342
- package/bios/seabios/src/fw/acpi-dsdt.hex +0 -554
- package/bios/seabios/src/fw/acpi.c +0 -685
- package/bios/seabios/src/fw/biostables.c +0 -491
- package/bios/seabios/src/fw/coreboot.c +0 -569
- package/bios/seabios/src/fw/csm.c +0 -347
- package/bios/seabios/src/fw/dev-pci.h +0 -52
- package/bios/seabios/src/fw/dev-piix.h +0 -29
- package/bios/seabios/src/fw/dev-q35.h +0 -52
- package/bios/seabios/src/fw/lzmadecode.c +0 -398
- package/bios/seabios/src/fw/lzmadecode.h +0 -67
- package/bios/seabios/src/fw/mptable.c +0 -197
- package/bios/seabios/src/fw/mtrr.c +0 -105
- package/bios/seabios/src/fw/multiboot.c +0 -111
- package/bios/seabios/src/fw/paravirt.c +0 -624
- package/bios/seabios/src/fw/paravirt.h +0 -63
- package/bios/seabios/src/fw/pciinit.c +0 -1187
- package/bios/seabios/src/fw/pirtable.c +0 -103
- package/bios/seabios/src/fw/q35-acpi-dsdt.dsl +0 -450
- package/bios/seabios/src/fw/romfile_loader.c +0 -259
- package/bios/seabios/src/fw/romfile_loader.h +0 -91
- package/bios/seabios/src/fw/shadow.c +0 -208
- package/bios/seabios/src/fw/smbios.c +0 -585
- package/bios/seabios/src/fw/smm.c +0 -269
- package/bios/seabios/src/fw/smp.c +0 -194
- package/bios/seabios/src/fw/ssdt-misc.dsl +0 -104
- package/bios/seabios/src/fw/ssdt-misc.hex +0 -88
- package/bios/seabios/src/fw/ssdt-pcihp.dsl +0 -36
- package/bios/seabios/src/fw/ssdt-pcihp.hex +0 -38
- package/bios/seabios/src/fw/ssdt-proc.dsl +0 -48
- package/bios/seabios/src/fw/ssdt-proc.hex +0 -35
- package/bios/seabios/src/fw/xen.c +0 -149
- package/bios/seabios/src/fw/xen.h +0 -125
- package/bios/seabios/src/gen-defs.h +0 -19
- package/bios/seabios/src/hw/ahci.c +0 -697
- package/bios/seabios/src/hw/ahci.h +0 -201
- package/bios/seabios/src/hw/ata.c +0 -1046
- package/bios/seabios/src/hw/ata.h +0 -163
- package/bios/seabios/src/hw/blockcmd.c +0 -372
- package/bios/seabios/src/hw/blockcmd.h +0 -114
- package/bios/seabios/src/hw/dma.c +0 -67
- package/bios/seabios/src/hw/esp-scsi.c +0 -241
- package/bios/seabios/src/hw/esp-scsi.h +0 -8
- package/bios/seabios/src/hw/floppy.c +0 -741
- package/bios/seabios/src/hw/lsi-scsi.c +0 -221
- package/bios/seabios/src/hw/lsi-scsi.h +0 -8
- package/bios/seabios/src/hw/megasas.c +0 -405
- package/bios/seabios/src/hw/megasas.h +0 -8
- package/bios/seabios/src/hw/mpt-scsi.c +0 -319
- package/bios/seabios/src/hw/mpt-scsi.h +0 -8
- package/bios/seabios/src/hw/nvme-int.h +0 -199
- package/bios/seabios/src/hw/nvme.c +0 -708
- package/bios/seabios/src/hw/nvme.h +0 -17
- package/bios/seabios/src/hw/pci.c +0 -133
- package/bios/seabios/src/hw/pci.h +0 -47
- package/bios/seabios/src/hw/pci_ids.h +0 -2632
- package/bios/seabios/src/hw/pci_regs.h +0 -556
- package/bios/seabios/src/hw/pcidevice.c +0 -192
- package/bios/seabios/src/hw/pcidevice.h +0 -76
- package/bios/seabios/src/hw/pic.c +0 -115
- package/bios/seabios/src/hw/pic.h +0 -60
- package/bios/seabios/src/hw/ps2port.c +0 -543
- package/bios/seabios/src/hw/ps2port.h +0 -67
- package/bios/seabios/src/hw/pvscsi.c +0 -333
- package/bios/seabios/src/hw/pvscsi.h +0 -8
- package/bios/seabios/src/hw/ramdisk.c +0 -108
- package/bios/seabios/src/hw/rtc.c +0 -100
- package/bios/seabios/src/hw/rtc.h +0 -75
- package/bios/seabios/src/hw/sdcard.c +0 -572
- package/bios/seabios/src/hw/serialio.c +0 -113
- package/bios/seabios/src/hw/serialio.h +0 -29
- package/bios/seabios/src/hw/timer.c +0 -259
- package/bios/seabios/src/hw/tpm_drivers.c +0 -636
- package/bios/seabios/src/hw/tpm_drivers.h +0 -127
- package/bios/seabios/src/hw/usb-ehci.c +0 -650
- package/bios/seabios/src/hw/usb-ehci.h +0 -177
- package/bios/seabios/src/hw/usb-hid.c +0 -442
- package/bios/seabios/src/hw/usb-hid.h +0 -29
- package/bios/seabios/src/hw/usb-hub.c +0 -205
- package/bios/seabios/src/hw/usb-hub.h +0 -64
- package/bios/seabios/src/hw/usb-msc.c +0 -222
- package/bios/seabios/src/hw/usb-msc.h +0 -10
- package/bios/seabios/src/hw/usb-ohci.c +0 -568
- package/bios/seabios/src/hw/usb-ohci.h +0 -144
- package/bios/seabios/src/hw/usb-uas.c +0 -289
- package/bios/seabios/src/hw/usb-uas.h +0 -9
- package/bios/seabios/src/hw/usb-uhci.c +0 -571
- package/bios/seabios/src/hw/usb-uhci.h +0 -128
- package/bios/seabios/src/hw/usb-xhci.c +0 -1161
- package/bios/seabios/src/hw/usb-xhci.h +0 -133
- package/bios/seabios/src/hw/usb.c +0 -499
- package/bios/seabios/src/hw/usb.h +0 -254
- package/bios/seabios/src/hw/virtio-blk.c +0 -211
- package/bios/seabios/src/hw/virtio-blk.h +0 -43
- package/bios/seabios/src/hw/virtio-pci.c +0 -501
- package/bios/seabios/src/hw/virtio-pci.h +0 -151
- package/bios/seabios/src/hw/virtio-ring.c +0 -147
- package/bios/seabios/src/hw/virtio-ring.h +0 -121
- package/bios/seabios/src/hw/virtio-scsi.c +0 -220
- package/bios/seabios/src/hw/virtio-scsi.h +0 -47
- package/bios/seabios/src/jpeg.c +0 -1055
- package/bios/seabios/src/kbd.c +0 -599
- package/bios/seabios/src/list.h +0 -91
- package/bios/seabios/src/malloc.c +0 -561
- package/bios/seabios/src/malloc.h +0 -70
- package/bios/seabios/src/memmap.h +0 -21
- package/bios/seabios/src/misc.c +0 -195
- package/bios/seabios/src/mouse.c +0 -342
- package/bios/seabios/src/optionroms.c +0 -475
- package/bios/seabios/src/output.c +0 -584
- package/bios/seabios/src/output.h +0 -68
- package/bios/seabios/src/pcibios.c +0 -241
- package/bios/seabios/src/pmm.c +0 -176
- package/bios/seabios/src/pnpbios.c +0 -88
- package/bios/seabios/src/post.c +0 -337
- package/bios/seabios/src/resume.c +0 -157
- package/bios/seabios/src/romfile.c +0 -146
- package/bios/seabios/src/romfile.h +0 -21
- package/bios/seabios/src/romlayout.S +0 -698
- package/bios/seabios/src/sercon.c +0 -677
- package/bios/seabios/src/serial.c +0 -317
- package/bios/seabios/src/sha1.c +0 -147
- package/bios/seabios/src/sha1.h +0 -8
- package/bios/seabios/src/stacks.c +0 -771
- package/bios/seabios/src/stacks.h +0 -68
- package/bios/seabios/src/std/LegacyBios.h +0 -985
- package/bios/seabios/src/std/acpi.h +0 -323
- package/bios/seabios/src/std/bda.h +0 -174
- package/bios/seabios/src/std/disk.h +0 -175
- package/bios/seabios/src/std/mptable.h +0 -77
- package/bios/seabios/src/std/multiboot.h +0 -260
- package/bios/seabios/src/std/optionrom.h +0 -59
- package/bios/seabios/src/std/pirtable.h +0 -35
- package/bios/seabios/src/std/pmm.h +0 -19
- package/bios/seabios/src/std/pnpbios.h +0 -24
- package/bios/seabios/src/std/smbios.h +0 -167
- package/bios/seabios/src/std/tcg.h +0 -554
- package/bios/seabios/src/std/vbe.h +0 -156
- package/bios/seabios/src/std/vga.h +0 -63
- package/bios/seabios/src/string.c +0 -251
- package/bios/seabios/src/string.h +0 -31
- package/bios/seabios/src/system.c +0 -357
- package/bios/seabios/src/tcgbios.c +0 -2014
- package/bios/seabios/src/tcgbios.h +0 -19
- package/bios/seabios/src/types.h +0 -156
- package/bios/seabios/src/util.h +0 -251
- package/bios/seabios/src/version.c +0 -5
- package/bios/seabios/src/vgahooks.c +0 -355
- package/bios/seabios/src/x86.c +0 -23
- package/bios/seabios/src/x86.h +0 -277
- package/bios/seabios/vgasrc/Kconfig +0 -211
- package/bios/seabios/vgasrc/bochsdisplay.c +0 -59
- package/bios/seabios/vgasrc/bochsvga.c +0 -447
- package/bios/seabios/vgasrc/bochsvga.h +0 -57
- package/bios/seabios/vgasrc/cbvga.c +0 -337
- package/bios/seabios/vgasrc/clext.c +0 -627
- package/bios/seabios/vgasrc/geodevga.c +0 -434
- package/bios/seabios/vgasrc/geodevga.h +0 -89
- package/bios/seabios/vgasrc/ramfb.c +0 -163
- package/bios/seabios/vgasrc/stdvga.c +0 -485
- package/bios/seabios/vgasrc/stdvga.h +0 -81
- package/bios/seabios/vgasrc/stdvgaio.c +0 -186
- package/bios/seabios/vgasrc/stdvgamodes.c +0 -534
- package/bios/seabios/vgasrc/swcursor.c +0 -96
- package/bios/seabios/vgasrc/vbe.c +0 -432
- package/bios/seabios/vgasrc/vgabios.c +0 -1131
- package/bios/seabios/vgasrc/vgabios.h +0 -88
- package/bios/seabios/vgasrc/vgaentry.S +0 -161
- package/bios/seabios/vgasrc/vgafb.c +0 -661
- package/bios/seabios/vgasrc/vgafb.h +0 -42
- package/bios/seabios/vgasrc/vgafonts.c +0 -785
- package/bios/seabios/vgasrc/vgahw.h +0 -152
- package/bios/seabios/vgasrc/vgainit.c +0 -202
- package/bios/seabios/vgasrc/vgalayout.lds.S +0 -23
- package/bios/seabios/vgasrc/vgautil.h +0 -103
- package/bios/seabios/vgasrc/vgaversion.c +0 -6
- package/bios/seabios-debug.bin +0 -0
- package/bios/seabios-debug.config +0 -117
- package/bios/seabios.bin +0 -0
- package/bios/seabios.config +0 -114
- package/bios/vgabios-debug.bin +0 -0
- package/bios/vgabios.bin +0 -0
- package/build/binaries.js +0 -1
- package/build/index-debug.cjs +0 -1
- package/build/index-debug.js +0 -1
- package/build/index.cjs +0 -1
- package/build/index.js +0 -1
- package/v86.css +0 -259
|
Binary file
|
|
@@ -1,366 +0,0 @@
|
|
|
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()
|
|
@@ -1,41 +0,0 @@
|
|
|
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
|
-
|
|
@@ -1,56 +0,0 @@
|
|
|
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()
|
|
@@ -1,134 +0,0 @@
|
|
|
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()
|
|
@@ -1,95 +0,0 @@
|
|
|
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()
|