diff --git a/Makefile b/Makefile deleted file mode 100755 index 478b81c..0000000 --- a/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -i915ovmf.efi: i915ovmf.o - x86_64-w64-mingw32-gcc -nostdlib -Wl,-dll -shared -Wl,--subsystem,10 -e efi_main -o i915ovmf.efi i915ovmf.o - -i915ovmf.o: i915ovmf.c - x86_64-w64-mingw32-gcc -I../edk2/MdePkg/Include -I../edk2/BaseTools/Source/C/Include/X64 -ffreestanding -Wall -Wextra -c -o i915ovmf.o i915ovmf.c diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 2c4e875..d0d9d69 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Disclaimer: When used in direct passthrough, this VBIOS could produce bad pixel This is an independent Video BIOS for Intel integrated GPUs. It provides a boot display and sets up an OpRegion so that Windows guests can produce monitor output. -The OpRegion code comes from IgdAssignmentsDxe and should work everywhere. The boot display works for GVT-g and can safely replace ramfb. For direct passthrough, the boot display only works with the exact combination of an HDMI monitor and an Intel Skylake processor. +The OpRegion code comes from IgdAssignmentDxe and should work everywhere. The boot display works for GVT-g and can safely replace ramfb. For direct passthrough, the boot display only works with the exact combination of an HDMI monitor and an Intel Skylake processor. ## How to build @@ -22,3 +22,13 @@ sudo mkfs.vfat disk ``` Then run `./t` to build and test. Due to GVT-g and EFI shenanigans, the testing process needs root. + +If you just want to use it for your VM, grab the rom file in Releases. + +## License + +I have no idea what this should be licensed in, but the code came from: +- managarm OS: https://github.com/managarm/managarm/ +- IgdAssignmentDxe: non-upstreamed Intel patch to OVMF +- EDK II: https://github.com/tianocore/edk2 +- The Linux kernel diff --git a/default.qpad_notebook b/default.qpad_notebook deleted file mode 100755 index 50c1148..0000000 --- a/default.qpad_notebook +++ /dev/null @@ -1,12 +0,0 @@ -v4 - -═══ (ʘ皿ʘ)つ Config -{"m_language":"markdown"} -═══ (ʘ口ʘ)つ Cell -# TODO - -gmbus: clock gating and stuff? seems to need setup work -- (test) reset - -get a 1024x768 EDID - diff --git a/i915ovmf.dsc b/i915ovmf.dsc old mode 100644 new mode 100755 diff --git a/mmio b/mmio index 6ee890e..fa3b880 100755 --- a/mmio +++ b/mmio @@ -1,2 +1,3 @@ #!/bin/sh +# Dump a MMIO register sudo dd if=/dev/mem iflag=skip_bytes skip=`printf "%d" 0x$1` "bs=4" count=1 | xxd -e -g 4 diff --git a/test b/test index a2763a2..7c65320 100755 --- a/test +++ b/test @@ -12,18 +12,16 @@ then true else modprobe kvmgt || exit - #TODO - sudo dd if=/sys/class/drm/card0-HDMI-A-1/edid of=/sys/class/drm/card0/gvt_edid bs=128 count=1 + #sudo dd if=/sys/class/drm/card0-HDMI-A-1/edid of=/sys/class/drm/card0/gvt_edid bs=128 count=1 echo 2aee154e-7d0d-11e8-88b8-6f45320c7162 > /sys/bus/pci/devices/0000:00:02.0/mdev_supported_types/i915-GVTg_V5_4/create || exit fi +# Create an UEFI disk that immediately shuts down the VM when booted mkdir -p tmpfat -mount ../uefi_fun/disk tmpfat +mount disk tmpfat mkdir -p tmpfat/EFI/BOOT cp shutdown.efi tmpfat/EFI/BOOT/BOOTX64.EFI umount tmpfat rmdir tmpfat -#~/gpdvm/bin/qemu-system-x86_64 -k en-us -name uefitest,debug-threads=on -serial stdio -m 2048 -M pc -cpu host -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -machine kernel_irqchip=on -nodefaults -rtc base=localtime,driftfix=slew -no-hpet -global kvm-pit.lost_tick_policy=discard -enable-kvm -bios /home/hqm/gpdvm/bin/ovmf.fd --display egl-headless,gl=es -vga none -device vfio-pci,sysfsdev=/sys/bus/pci/devices/0000:00:02.0/2aee154e-7d0d-11e8-88b8-6f45320c7162,addr=02.0,display=on,x-igd-opregion=on,romfile=`pwd`/i915ovmf.rom -device qemu-xhci,p2=8,p3=8 -device usb-kbd -device usb-tablet -drive format=raw,file=../uefi_fun/disk - -~/gpdvm/bin/qemu-system-x86_64 -k en-us -name uefitest,debug-threads=on -serial stdio -m 2048 -M pc -cpu host -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -machine kernel_irqchip=on -nodefaults -rtc base=localtime,driftfix=slew -no-hpet -global kvm-pit.lost_tick_policy=discard -enable-kvm -bios /home/hqm/gpdvm/bin/ovmf.fd -display gtk,gl=on,grab-on-hover=on -full-screen -vga none -device vfio-pci,sysfsdev=/sys/bus/pci/devices/0000:00:02.0/2aee154e-7d0d-11e8-88b8-6f45320c7162,addr=02.0,display=on,x-igd-opregion=on,romfile=`pwd`/i915ovmf.rom -device qemu-xhci,p2=8,p3=8 -device usb-kbd -device usb-tablet -drive format=raw,file=../uefi_fun/disk +qemu-system-x86_64 -k en-us -name uefitest,debug-threads=on -serial stdio -m 2048 -M pc -cpu host -global PIIX4_PM.disable_s3=1 -global PIIX4_PM.disable_s4=1 -machine kernel_irqchip=on -nodefaults -rtc base=localtime,driftfix=slew -no-hpet -global kvm-pit.lost_tick_policy=discard -enable-kvm -bios /home/hqm/gpdvm/bin/ovmf.fd -display gtk,gl=on,grab-on-hover=on -full-screen -vga none -device vfio-pci,sysfsdev=/sys/bus/pci/devices/0000:00:02.0/2aee154e-7d0d-11e8-88b8-6f45320c7162,addr=02.0,display=on,x-igd-opregion=on,romfile=`pwd`/i915ovmf.rom -device qemu-xhci,p2=8,p3=8 -device usb-kbd -device usb-tablet -drive format=raw,file=disk diff --git a/testmem.sh b/testmem.sh deleted file mode 100755 index 0efb8cf..0000000 --- a/testmem.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh -sudo dd if=i915ovmf.rom of=/dev/mem oflag=seek_bytes seek=`printf "%d" 0x81005000` bs=4096 count=1 -sudo dd if=/dev/mem iflag=skip_bytes skip=`printf "%d" 0x81000000` bs=4096 count=1 of=page0.bin -sudo dd if=/dev/mem iflag=skip_bytes skip=`printf "%d" 0x807f0000` bs=4096 count=1 of=page1.bin -sudo dd if=/dev/mem iflag=skip_bytes skip=`printf "%d" 0x807e9000` bs=4096 count=1 of=pagef.bin -sudo dd if=/dev/mem iflag=skip_bytes skip=`printf "%d" 0x807e8000` bs=4096 count=1 of=pagee.bin -