v86 0.4.0 → 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 +56 -111
- 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
package/bios/seabios/src/clock.c
DELETED
|
@@ -1,506 +0,0 @@
|
|
|
1
|
-
// 16bit code to handle system clocks.
|
|
2
|
-
//
|
|
3
|
-
// Copyright (C) 2008-2010 Kevin O'Connor <kevin@koconnor.net>
|
|
4
|
-
// Copyright (C) 2002 MandrakeSoft S.A.
|
|
5
|
-
//
|
|
6
|
-
// This file may be distributed under the terms of the GNU LGPLv3 license.
|
|
7
|
-
|
|
8
|
-
#include "biosvar.h" // SET_BDA
|
|
9
|
-
#include "bregs.h" // struct bregs
|
|
10
|
-
#include "hw/pic.h" // pic_eoi1
|
|
11
|
-
#include "hw/ps2port.h" // ps2_check_event
|
|
12
|
-
#include "hw/rtc.h" // rtc_read
|
|
13
|
-
#include "hw/usb-hid.h" // usb_check_event
|
|
14
|
-
#include "output.h" // debug_enter
|
|
15
|
-
#include "stacks.h" // yield
|
|
16
|
-
#include "string.h" // memset
|
|
17
|
-
#include "util.h" // clock_setup
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
/****************************************************************
|
|
21
|
-
* Init
|
|
22
|
-
****************************************************************/
|
|
23
|
-
|
|
24
|
-
static u32
|
|
25
|
-
bcd2bin(u8 val)
|
|
26
|
-
{
|
|
27
|
-
return (val & 0xf) + ((val >> 4) * 10);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
u8 Century VARLOW;
|
|
31
|
-
|
|
32
|
-
void
|
|
33
|
-
clock_setup(void)
|
|
34
|
-
{
|
|
35
|
-
dprintf(3, "init timer\n");
|
|
36
|
-
pit_setup();
|
|
37
|
-
|
|
38
|
-
rtc_setup();
|
|
39
|
-
rtc_updating();
|
|
40
|
-
u32 seconds = bcd2bin(rtc_read(CMOS_RTC_SECONDS));
|
|
41
|
-
u32 minutes = bcd2bin(rtc_read(CMOS_RTC_MINUTES));
|
|
42
|
-
u32 hours = bcd2bin(rtc_read(CMOS_RTC_HOURS));
|
|
43
|
-
u32 ticks = ticks_from_ms(((hours * 60 + minutes) * 60 + seconds) * 1000);
|
|
44
|
-
SET_BDA(timer_counter, ticks % TICKS_PER_DAY);
|
|
45
|
-
|
|
46
|
-
// Setup Century storage
|
|
47
|
-
if (CONFIG_QEMU) {
|
|
48
|
-
Century = rtc_read(CMOS_CENTURY);
|
|
49
|
-
} else {
|
|
50
|
-
// Infer current century from the year.
|
|
51
|
-
u8 year = rtc_read(CMOS_RTC_YEAR);
|
|
52
|
-
if (year > 0x80)
|
|
53
|
-
Century = 0x19;
|
|
54
|
-
else
|
|
55
|
-
Century = 0x20;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
enable_hwirq(0, FUNC16(entry_08));
|
|
59
|
-
if (CONFIG_RTC_TIMER)
|
|
60
|
-
enable_hwirq(8, FUNC16(entry_70));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
/****************************************************************
|
|
65
|
-
* Standard clock functions
|
|
66
|
-
****************************************************************/
|
|
67
|
-
|
|
68
|
-
// get current clock count
|
|
69
|
-
static void
|
|
70
|
-
handle_1a00(struct bregs *regs)
|
|
71
|
-
{
|
|
72
|
-
yield();
|
|
73
|
-
u32 ticks = GET_BDA(timer_counter);
|
|
74
|
-
regs->cx = ticks >> 16;
|
|
75
|
-
regs->dx = ticks;
|
|
76
|
-
regs->al = GET_BDA(timer_rollover);
|
|
77
|
-
SET_BDA(timer_rollover, 0); // reset flag
|
|
78
|
-
set_success(regs);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// Set Current Clock Count
|
|
82
|
-
static void
|
|
83
|
-
handle_1a01(struct bregs *regs)
|
|
84
|
-
{
|
|
85
|
-
u32 ticks = (regs->cx << 16) | regs->dx;
|
|
86
|
-
SET_BDA(timer_counter, ticks);
|
|
87
|
-
SET_BDA(timer_rollover, 0); // reset flag
|
|
88
|
-
// XXX - should use set_code_success()?
|
|
89
|
-
regs->ah = 0;
|
|
90
|
-
set_success(regs);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// Read CMOS Time
|
|
94
|
-
static void
|
|
95
|
-
handle_1a02(struct bregs *regs)
|
|
96
|
-
{
|
|
97
|
-
if (rtc_updating()) {
|
|
98
|
-
set_invalid(regs);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
regs->dh = rtc_read(CMOS_RTC_SECONDS);
|
|
103
|
-
regs->cl = rtc_read(CMOS_RTC_MINUTES);
|
|
104
|
-
regs->ch = rtc_read(CMOS_RTC_HOURS);
|
|
105
|
-
regs->dl = rtc_read(CMOS_STATUS_B) & RTC_B_DSE;
|
|
106
|
-
regs->ah = 0;
|
|
107
|
-
regs->al = regs->ch;
|
|
108
|
-
set_success(regs);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// Set CMOS Time
|
|
112
|
-
static void
|
|
113
|
-
handle_1a03(struct bregs *regs)
|
|
114
|
-
{
|
|
115
|
-
// Using a debugger, I notice the following masking/setting
|
|
116
|
-
// of bits in Status Register B, by setting Reg B to
|
|
117
|
-
// a few values and getting its value after INT 1A was called.
|
|
118
|
-
//
|
|
119
|
-
// try#1 try#2 try#3
|
|
120
|
-
// before 1111 1101 0111 1101 0000 0000
|
|
121
|
-
// after 0110 0010 0110 0010 0000 0010
|
|
122
|
-
//
|
|
123
|
-
// Bit4 in try#1 flipped in hardware (forced low) due to bit7=1
|
|
124
|
-
// My assumption: RegB = ((RegB & 01100000b) | 00000010b)
|
|
125
|
-
if (rtc_updating()) {
|
|
126
|
-
rtc_setup();
|
|
127
|
-
// fall through as if an update were not in progress
|
|
128
|
-
}
|
|
129
|
-
rtc_write(CMOS_RTC_SECONDS, regs->dh);
|
|
130
|
-
rtc_write(CMOS_RTC_MINUTES, regs->cl);
|
|
131
|
-
rtc_write(CMOS_RTC_HOURS, regs->ch);
|
|
132
|
-
// Set Daylight Savings time enabled bit to requested value
|
|
133
|
-
u8 val8 = ((rtc_read(CMOS_STATUS_B) & (RTC_B_PIE|RTC_B_AIE))
|
|
134
|
-
| RTC_B_24HR | (regs->dl & RTC_B_DSE));
|
|
135
|
-
rtc_write(CMOS_STATUS_B, val8);
|
|
136
|
-
regs->ah = 0;
|
|
137
|
-
regs->al = val8; // val last written to Reg B
|
|
138
|
-
set_success(regs);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
// Read CMOS Date
|
|
142
|
-
static void
|
|
143
|
-
handle_1a04(struct bregs *regs)
|
|
144
|
-
{
|
|
145
|
-
regs->ah = 0;
|
|
146
|
-
if (rtc_updating()) {
|
|
147
|
-
set_invalid(regs);
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
regs->cl = rtc_read(CMOS_RTC_YEAR);
|
|
151
|
-
regs->dh = rtc_read(CMOS_RTC_MONTH);
|
|
152
|
-
regs->dl = rtc_read(CMOS_RTC_DAY_MONTH);
|
|
153
|
-
regs->ch = GET_LOW(Century);
|
|
154
|
-
regs->al = regs->ch;
|
|
155
|
-
set_success(regs);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// Set CMOS Date
|
|
159
|
-
static void
|
|
160
|
-
handle_1a05(struct bregs *regs)
|
|
161
|
-
{
|
|
162
|
-
// Using a debugger, I notice the following masking/setting
|
|
163
|
-
// of bits in Status Register B, by setting Reg B to
|
|
164
|
-
// a few values and getting its value after INT 1A was called.
|
|
165
|
-
//
|
|
166
|
-
// try#1 try#2 try#3 try#4
|
|
167
|
-
// before 1111 1101 0111 1101 0000 0010 0000 0000
|
|
168
|
-
// after 0110 1101 0111 1101 0000 0010 0000 0000
|
|
169
|
-
//
|
|
170
|
-
// Bit4 in try#1 flipped in hardware (forced low) due to bit7=1
|
|
171
|
-
// My assumption: RegB = (RegB & 01111111b)
|
|
172
|
-
if (rtc_updating()) {
|
|
173
|
-
rtc_setup();
|
|
174
|
-
set_invalid(regs);
|
|
175
|
-
return;
|
|
176
|
-
}
|
|
177
|
-
rtc_write(CMOS_RTC_YEAR, regs->cl);
|
|
178
|
-
rtc_write(CMOS_RTC_MONTH, regs->dh);
|
|
179
|
-
rtc_write(CMOS_RTC_DAY_MONTH, regs->dl);
|
|
180
|
-
SET_LOW(Century, regs->ch);
|
|
181
|
-
// clear halt-clock bit
|
|
182
|
-
u8 val8 = rtc_read(CMOS_STATUS_B) & ~RTC_B_SET;
|
|
183
|
-
rtc_write(CMOS_STATUS_B, val8);
|
|
184
|
-
regs->ah = 0;
|
|
185
|
-
regs->al = val8; // AL = val last written to Reg B
|
|
186
|
-
set_success(regs);
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// Set Alarm Time in CMOS
|
|
190
|
-
static void
|
|
191
|
-
handle_1a06(struct bregs *regs)
|
|
192
|
-
{
|
|
193
|
-
// Using a debugger, I notice the following masking/setting
|
|
194
|
-
// of bits in Status Register B, by setting Reg B to
|
|
195
|
-
// a few values and getting its value after INT 1A was called.
|
|
196
|
-
//
|
|
197
|
-
// try#1 try#2 try#3
|
|
198
|
-
// before 1101 1111 0101 1111 0000 0000
|
|
199
|
-
// after 0110 1111 0111 1111 0010 0000
|
|
200
|
-
//
|
|
201
|
-
// Bit4 in try#1 flipped in hardware (forced low) due to bit7=1
|
|
202
|
-
// My assumption: RegB = ((RegB & 01111111b) | 00100000b)
|
|
203
|
-
u8 val8 = rtc_read(CMOS_STATUS_B); // Get Status Reg B
|
|
204
|
-
regs->ax = 0;
|
|
205
|
-
if (val8 & RTC_B_AIE) {
|
|
206
|
-
// Alarm interrupt enabled already
|
|
207
|
-
set_invalid(regs);
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
if (rtc_updating()) {
|
|
211
|
-
rtc_setup();
|
|
212
|
-
// fall through as if an update were not in progress
|
|
213
|
-
}
|
|
214
|
-
rtc_write(CMOS_RTC_SECONDS_ALARM, regs->dh);
|
|
215
|
-
rtc_write(CMOS_RTC_MINUTES_ALARM, regs->cl);
|
|
216
|
-
rtc_write(CMOS_RTC_HOURS_ALARM, regs->ch);
|
|
217
|
-
// enable Status Reg B alarm bit, clear halt clock bit
|
|
218
|
-
rtc_write(CMOS_STATUS_B, (val8 & ~RTC_B_SET) | RTC_B_AIE);
|
|
219
|
-
set_success(regs);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
// Turn off Alarm
|
|
223
|
-
static void
|
|
224
|
-
handle_1a07(struct bregs *regs)
|
|
225
|
-
{
|
|
226
|
-
// Using a debugger, I notice the following masking/setting
|
|
227
|
-
// of bits in Status Register B, by setting Reg B to
|
|
228
|
-
// a few values and getting its value after INT 1A was called.
|
|
229
|
-
//
|
|
230
|
-
// try#1 try#2 try#3 try#4
|
|
231
|
-
// before 1111 1101 0111 1101 0010 0000 0010 0010
|
|
232
|
-
// after 0100 0101 0101 0101 0000 0000 0000 0010
|
|
233
|
-
//
|
|
234
|
-
// Bit4 in try#1 flipped in hardware (forced low) due to bit7=1
|
|
235
|
-
// My assumption: RegB = (RegB & 01010111b)
|
|
236
|
-
u8 val8 = rtc_read(CMOS_STATUS_B); // Get Status Reg B
|
|
237
|
-
// clear clock-halt bit, disable alarm bit
|
|
238
|
-
rtc_write(CMOS_STATUS_B, val8 & ~(RTC_B_SET|RTC_B_AIE));
|
|
239
|
-
regs->ah = 0;
|
|
240
|
-
regs->al = val8; // val last written to Reg B
|
|
241
|
-
set_success(regs);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
static void
|
|
245
|
-
handle_1abb(struct bregs *regs)
|
|
246
|
-
{
|
|
247
|
-
if (!CONFIG_TCGBIOS)
|
|
248
|
-
return;
|
|
249
|
-
|
|
250
|
-
dprintf(DEBUG_tcg, "16: Calling tpm_interrupt_handler\n");
|
|
251
|
-
call32(tpm_interrupt_handler32, MAKE_FLATPTR(GET_SEG(SS), regs), 0);
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
// Unsupported
|
|
255
|
-
static void
|
|
256
|
-
handle_1aXX(struct bregs *regs)
|
|
257
|
-
{
|
|
258
|
-
set_unimplemented(regs);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
// INT 1Ah Time-of-day Service Entry Point
|
|
262
|
-
void VISIBLE16
|
|
263
|
-
handle_1a(struct bregs *regs)
|
|
264
|
-
{
|
|
265
|
-
debug_enter(regs, DEBUG_HDL_1a);
|
|
266
|
-
switch (regs->ah) {
|
|
267
|
-
case 0x00: handle_1a00(regs); break;
|
|
268
|
-
case 0x01: handle_1a01(regs); break;
|
|
269
|
-
case 0x02: handle_1a02(regs); break;
|
|
270
|
-
case 0x03: handle_1a03(regs); break;
|
|
271
|
-
case 0x04: handle_1a04(regs); break;
|
|
272
|
-
case 0x05: handle_1a05(regs); break;
|
|
273
|
-
case 0x06: handle_1a06(regs); break;
|
|
274
|
-
case 0x07: handle_1a07(regs); break;
|
|
275
|
-
case 0xbb: handle_1abb(regs); break;
|
|
276
|
-
default: handle_1aXX(regs); break;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
// Update main tick counter
|
|
281
|
-
static void
|
|
282
|
-
clock_update(void)
|
|
283
|
-
{
|
|
284
|
-
u32 counter = GET_BDA(timer_counter);
|
|
285
|
-
counter++;
|
|
286
|
-
// compare to one days worth of timer ticks at 18.2 hz
|
|
287
|
-
if (counter >= TICKS_PER_DAY) {
|
|
288
|
-
// there has been a midnight rollover at this point
|
|
289
|
-
counter = 0;
|
|
290
|
-
SET_BDA(timer_rollover, GET_BDA(timer_rollover) + 1);
|
|
291
|
-
}
|
|
292
|
-
SET_BDA(timer_counter, counter);
|
|
293
|
-
|
|
294
|
-
// Check for internal events.
|
|
295
|
-
floppy_tick();
|
|
296
|
-
usb_check_event();
|
|
297
|
-
ps2_check_event();
|
|
298
|
-
sercon_check_event();
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
// INT 08h System Timer ISR Entry Point
|
|
302
|
-
void VISIBLE16
|
|
303
|
-
handle_08(void)
|
|
304
|
-
{
|
|
305
|
-
debug_isr(DEBUG_ISR_08);
|
|
306
|
-
clock_update();
|
|
307
|
-
|
|
308
|
-
// chain to user timer tick INT #0x1c
|
|
309
|
-
struct bregs br;
|
|
310
|
-
memset(&br, 0, sizeof(br));
|
|
311
|
-
br.flags = F_IF;
|
|
312
|
-
call16_int(0x1c, &br);
|
|
313
|
-
|
|
314
|
-
pic_eoi1();
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
u32 last_timer_check VARLOW;
|
|
318
|
-
|
|
319
|
-
// Simulate timer irq on machines without hardware irqs
|
|
320
|
-
void
|
|
321
|
-
clock_poll_irq(void)
|
|
322
|
-
{
|
|
323
|
-
if (CONFIG_HARDWARE_IRQ)
|
|
324
|
-
return;
|
|
325
|
-
if (!timer_check(GET_LOW(last_timer_check)))
|
|
326
|
-
return;
|
|
327
|
-
SET_LOW(last_timer_check, timer_calc(ticks_to_ms(1)));
|
|
328
|
-
clock_update();
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
/****************************************************************
|
|
333
|
-
* IRQ based timer
|
|
334
|
-
****************************************************************/
|
|
335
|
-
|
|
336
|
-
// Calculate the timer value at 'count' number of full timer ticks in
|
|
337
|
-
// the future.
|
|
338
|
-
u32
|
|
339
|
-
irqtimer_calc_ticks(u32 count)
|
|
340
|
-
{
|
|
341
|
-
return (GET_BDA(timer_counter) + count + 1) % TICKS_PER_DAY;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
// Return the timer value that is 'msecs' time in the future.
|
|
345
|
-
u32
|
|
346
|
-
irqtimer_calc(u32 msecs)
|
|
347
|
-
{
|
|
348
|
-
if (!msecs)
|
|
349
|
-
return GET_BDA(timer_counter);
|
|
350
|
-
return irqtimer_calc_ticks(ticks_from_ms(msecs));
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
// Check if the given timer value has passed.
|
|
354
|
-
int
|
|
355
|
-
irqtimer_check(u32 end)
|
|
356
|
-
{
|
|
357
|
-
return (((GET_BDA(timer_counter) + TICKS_PER_DAY - end) % TICKS_PER_DAY)
|
|
358
|
-
< (TICKS_PER_DAY/2));
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
/****************************************************************
|
|
363
|
-
* Periodic timer
|
|
364
|
-
****************************************************************/
|
|
365
|
-
|
|
366
|
-
static int
|
|
367
|
-
set_usertimer(u32 usecs, u16 seg, u16 offset)
|
|
368
|
-
{
|
|
369
|
-
if (GET_BDA(rtc_wait_flag) & RWS_WAIT_PENDING)
|
|
370
|
-
return -1;
|
|
371
|
-
|
|
372
|
-
// Interval not already set.
|
|
373
|
-
SET_BDA(rtc_wait_flag, RWS_WAIT_PENDING); // Set status byte.
|
|
374
|
-
SET_BDA(user_wait_complete_flag, SEGOFF(seg, offset));
|
|
375
|
-
SET_BDA(user_wait_timeout, usecs);
|
|
376
|
-
rtc_use();
|
|
377
|
-
return 0;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
static void
|
|
381
|
-
clear_usertimer(void)
|
|
382
|
-
{
|
|
383
|
-
if (!(GET_BDA(rtc_wait_flag) & RWS_WAIT_PENDING))
|
|
384
|
-
return;
|
|
385
|
-
// Turn off status byte.
|
|
386
|
-
SET_BDA(rtc_wait_flag, 0);
|
|
387
|
-
rtc_release();
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
#define RET_ECLOCKINUSE 0x83
|
|
391
|
-
|
|
392
|
-
// Wait for CX:DX microseconds
|
|
393
|
-
void
|
|
394
|
-
handle_1586(struct bregs *regs)
|
|
395
|
-
{
|
|
396
|
-
if (!CONFIG_RTC_TIMER) {
|
|
397
|
-
set_code_unimplemented(regs, RET_EUNSUPPORTED);
|
|
398
|
-
return;
|
|
399
|
-
}
|
|
400
|
-
// Use the rtc to wait for the specified time.
|
|
401
|
-
u8 statusflag = 0;
|
|
402
|
-
u32 count = (regs->cx << 16) | regs->dx;
|
|
403
|
-
int ret = set_usertimer(count, GET_SEG(SS), (u32)&statusflag);
|
|
404
|
-
if (ret) {
|
|
405
|
-
set_code_invalid(regs, RET_ECLOCKINUSE);
|
|
406
|
-
return;
|
|
407
|
-
}
|
|
408
|
-
while (!statusflag)
|
|
409
|
-
yield_toirq();
|
|
410
|
-
set_success(regs);
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
// Set Interval requested.
|
|
414
|
-
static void
|
|
415
|
-
handle_158300(struct bregs *regs)
|
|
416
|
-
{
|
|
417
|
-
int ret = set_usertimer((regs->cx << 16) | regs->dx, regs->es, regs->bx);
|
|
418
|
-
if (ret)
|
|
419
|
-
// Interval already set.
|
|
420
|
-
set_code_invalid(regs, RET_EUNSUPPORTED);
|
|
421
|
-
else
|
|
422
|
-
set_success(regs);
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
// Clear interval requested
|
|
426
|
-
static void
|
|
427
|
-
handle_158301(struct bregs *regs)
|
|
428
|
-
{
|
|
429
|
-
clear_usertimer();
|
|
430
|
-
set_success(regs);
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
static void
|
|
434
|
-
handle_1583XX(struct bregs *regs)
|
|
435
|
-
{
|
|
436
|
-
set_code_unimplemented(regs, RET_EUNSUPPORTED);
|
|
437
|
-
regs->al--;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
void
|
|
441
|
-
handle_1583(struct bregs *regs)
|
|
442
|
-
{
|
|
443
|
-
if (!CONFIG_RTC_TIMER) {
|
|
444
|
-
handle_1583XX(regs);
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
switch (regs->al) {
|
|
448
|
-
case 0x00: handle_158300(regs); break;
|
|
449
|
-
case 0x01: handle_158301(regs); break;
|
|
450
|
-
default: handle_1583XX(regs); break;
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
#define USEC_PER_RTC DIV_ROUND_CLOSEST(1000000, 1024)
|
|
455
|
-
|
|
456
|
-
// int70h: IRQ8 - CMOS RTC
|
|
457
|
-
void VISIBLE16
|
|
458
|
-
handle_70(void)
|
|
459
|
-
{
|
|
460
|
-
if (!CONFIG_RTC_TIMER)
|
|
461
|
-
return;
|
|
462
|
-
debug_isr(DEBUG_ISR_70);
|
|
463
|
-
|
|
464
|
-
// Check which modes are enabled and have occurred.
|
|
465
|
-
u8 registerB = rtc_read(CMOS_STATUS_B);
|
|
466
|
-
u8 registerC = rtc_read(CMOS_STATUS_C);
|
|
467
|
-
|
|
468
|
-
if (!(registerB & (RTC_B_PIE|RTC_B_AIE)))
|
|
469
|
-
goto done;
|
|
470
|
-
if (registerC & RTC_B_AIE) {
|
|
471
|
-
// Handle Alarm Interrupt.
|
|
472
|
-
struct bregs br;
|
|
473
|
-
memset(&br, 0, sizeof(br));
|
|
474
|
-
br.flags = F_IF;
|
|
475
|
-
call16_int(0x4a, &br);
|
|
476
|
-
}
|
|
477
|
-
if (!(registerC & RTC_B_PIE))
|
|
478
|
-
goto done;
|
|
479
|
-
|
|
480
|
-
// Handle Periodic Interrupt.
|
|
481
|
-
|
|
482
|
-
check_preempt();
|
|
483
|
-
|
|
484
|
-
if (!GET_BDA(rtc_wait_flag))
|
|
485
|
-
goto done;
|
|
486
|
-
|
|
487
|
-
// Wait Interval (Int 15, AH=83) active.
|
|
488
|
-
u32 time = GET_BDA(user_wait_timeout); // Time left in microseconds.
|
|
489
|
-
if (time < USEC_PER_RTC) {
|
|
490
|
-
// Done waiting - write to specified flag byte.
|
|
491
|
-
struct segoff_s segoff = GET_BDA(user_wait_complete_flag);
|
|
492
|
-
u16 ptr_seg = segoff.seg;
|
|
493
|
-
u8 *ptr_far = (u8*)(segoff.offset+0);
|
|
494
|
-
u8 oldval = GET_FARVAR(ptr_seg, *ptr_far);
|
|
495
|
-
SET_FARVAR(ptr_seg, *ptr_far, oldval | 0x80);
|
|
496
|
-
|
|
497
|
-
clear_usertimer();
|
|
498
|
-
} else {
|
|
499
|
-
// Continue waiting.
|
|
500
|
-
time -= USEC_PER_RTC;
|
|
501
|
-
SET_BDA(user_wait_timeout, time);
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
done:
|
|
505
|
-
pic_eoi2();
|
|
506
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.code16gcc
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
#ifndef __CONFIG_H
|
|
2
|
-
#define __CONFIG_H
|
|
3
|
-
|
|
4
|
-
#include "autoconf.h"
|
|
5
|
-
|
|
6
|
-
// Configuration definitions.
|
|
7
|
-
|
|
8
|
-
//#define BUILD_APPNAME "QEMU"
|
|
9
|
-
//#define BUILD_CPUNAME8 "QEMUCPU "
|
|
10
|
-
//#define BUILD_APPNAME6 "QEMU "
|
|
11
|
-
//#define BUILD_APPNAME4 "QEMU"
|
|
12
|
-
#define BUILD_APPNAME "Bochs"
|
|
13
|
-
#define BUILD_CPUNAME8 "BOCHSCPU"
|
|
14
|
-
#define BUILD_APPNAME6 "BOCHS "
|
|
15
|
-
#define BUILD_APPNAME4 "BXPC"
|
|
16
|
-
|
|
17
|
-
// Maximum number of map entries in the e820 map
|
|
18
|
-
#define BUILD_MAX_E820 32
|
|
19
|
-
// Space to reserve in high-memory for tables
|
|
20
|
-
#define BUILD_MAX_HIGHTABLE (256*1024)
|
|
21
|
-
// Largest supported externaly facing drive id
|
|
22
|
-
#define BUILD_MAX_EXTDRIVE 16
|
|
23
|
-
// Number of bytes the smbios may be and still live in the f-segment
|
|
24
|
-
#define BUILD_MAX_SMBIOS_FSEG 600
|
|
25
|
-
// Maximum number of bytes the mptable may be and still be copied to f-segment
|
|
26
|
-
#define BUILD_MAX_MPTABLE_FSEG 600
|
|
27
|
-
|
|
28
|
-
#define BUILD_MODEL_ID 0xFC
|
|
29
|
-
#define BUILD_SUBMODEL_ID 0x00
|
|
30
|
-
#define BUILD_BIOS_REVISION 0x01
|
|
31
|
-
|
|
32
|
-
// Various memory addresses used by the code.
|
|
33
|
-
#define BUILD_STACK_ADDR 0x7000
|
|
34
|
-
#define BUILD_S3RESUME_STACK_ADDR 0x1000
|
|
35
|
-
#define BUILD_AP_BOOT_ADDR 0x10000
|
|
36
|
-
#define BUILD_EBDA_MINIMUM 0x90000
|
|
37
|
-
#define BUILD_LOWRAM_END 0xa0000
|
|
38
|
-
#define BUILD_ROM_START 0xc0000
|
|
39
|
-
#define BUILD_BIOS_ADDR 0xf0000
|
|
40
|
-
#define BUILD_BIOS_SIZE 0x10000
|
|
41
|
-
#define BUILD_EXTRA_STACK_SIZE 0x800
|
|
42
|
-
#define BUILD_SMM_INIT_ADDR 0x30000
|
|
43
|
-
#define BUILD_SMM_ADDR 0xa0000
|
|
44
|
-
|
|
45
|
-
#define BUILD_PCIMEM_START 0xe0000000
|
|
46
|
-
#define BUILD_PCIMEM_END 0xfec00000 /* IOAPIC is mapped at */
|
|
47
|
-
#define BUILD_PCIMEM64_START 0x8000000000ULL
|
|
48
|
-
#define BUILD_PCIMEM64_END 0x10000000000ULL
|
|
49
|
-
|
|
50
|
-
#define BUILD_IOAPIC_ADDR 0xfec00000
|
|
51
|
-
#define BUILD_IOAPIC_ID 0
|
|
52
|
-
#define BUILD_HPET_ADDRESS 0xfed00000
|
|
53
|
-
#define BUILD_APIC_ADDR 0xfee00000
|
|
54
|
-
|
|
55
|
-
// PCI IRQS
|
|
56
|
-
#define BUILD_PCI_IRQS ((1<<5) | (1<<9) | (1<<10) | (1<<11))
|
|
57
|
-
|
|
58
|
-
// Important real-mode segments
|
|
59
|
-
#define SEG_IVT 0x0000
|
|
60
|
-
#define SEG_BDA 0x0040
|
|
61
|
-
#define SEG_BIOS 0xf000
|
|
62
|
-
|
|
63
|
-
// Segment definitions in protected mode (see rombios32_gdt in misc.c)
|
|
64
|
-
#define SEG32_MODE32_CS (1 << 3)
|
|
65
|
-
#define SEG32_MODE32_DS (2 << 3)
|
|
66
|
-
#define SEG32_MODE16_CS (3 << 3)
|
|
67
|
-
#define SEG32_MODE16_DS (4 << 3)
|
|
68
|
-
#define SEG32_MODE16BIG_CS (5 << 3)
|
|
69
|
-
#define SEG32_MODE16BIG_DS (6 << 3)
|
|
70
|
-
|
|
71
|
-
// Debugging levels. If non-zero and CONFIG_DEBUG_LEVEL is greater
|
|
72
|
-
// than the specified value, then the corresponding irq handler will
|
|
73
|
-
// report every enter event.
|
|
74
|
-
#define DEBUG_ISR_02 1
|
|
75
|
-
#define DEBUG_HDL_05 1
|
|
76
|
-
#define DEBUG_ISR_08 20
|
|
77
|
-
#define DEBUG_ISR_09 9
|
|
78
|
-
#define DEBUG_ISR_0e 9
|
|
79
|
-
#define DEBUG_HDL_11 2
|
|
80
|
-
#define DEBUG_HDL_12 2
|
|
81
|
-
#define DEBUG_HDL_13 10
|
|
82
|
-
#define DEBUG_HDL_14 2
|
|
83
|
-
#define DEBUG_HDL_15 9
|
|
84
|
-
#define DEBUG_HDL_16 9
|
|
85
|
-
#define DEBUG_HDL_17 2
|
|
86
|
-
#define DEBUG_HDL_18 1
|
|
87
|
-
#define DEBUG_HDL_19 1
|
|
88
|
-
#define DEBUG_HDL_1a 9
|
|
89
|
-
#define DEBUG_HDL_40 1
|
|
90
|
-
#define DEBUG_ISR_70 9
|
|
91
|
-
#define DEBUG_ISR_74 9
|
|
92
|
-
#define DEBUG_ISR_75 1
|
|
93
|
-
#define DEBUG_ISR_76 10
|
|
94
|
-
#define DEBUG_ISR_hwpic1 5
|
|
95
|
-
#define DEBUG_ISR_hwpic2 5
|
|
96
|
-
#define DEBUG_HDL_smi 9
|
|
97
|
-
#define DEBUG_HDL_smp 1
|
|
98
|
-
#define DEBUG_HDL_pnp 1
|
|
99
|
-
#define DEBUG_HDL_pmm 1
|
|
100
|
-
#define DEBUG_HDL_pcibios 9
|
|
101
|
-
#define DEBUG_HDL_apm 9
|
|
102
|
-
|
|
103
|
-
#define DEBUG_unimplemented 2
|
|
104
|
-
#define DEBUG_invalid 3
|
|
105
|
-
#define DEBUG_thread 2
|
|
106
|
-
#define DEBUG_tcg 20
|
|
107
|
-
|
|
108
|
-
#endif // config.h
|