queso-fuego / uefi-dev

Repo for the UEFI Development Series
The Unlicense
37 stars 3 forks source link

Patch file to add PS/2 and USB mouse support for QEMU to OVMF. #3

Open mrcodechef opened 9 months ago

mrcodechef commented 9 months ago

Patch file to add PS/2 and USB mouse support for QEMU to OVMF. Only slightly tricky bit is you need to have the SuperIO chip register the PS/2 mouse in addition to the keyboard, otherwise PS2MouseDXE will never see it. https://gist.github.com/mrcodechef/b31537d8799ecb2bc3aea91fd41cb1c3

Unrelated and I don't know if you mentioned it in your videos, but you can debug with symbols and GDB via the EDK script BaseTools/Scripts/efi_gdb.py. There's also one for LLDB if you prefer.

On my system it seems to work better for locals with a slight patch (below) to have it use the .debug file instead of the .dll for gdb symbols. ( inspired by a similar patch for an older gdb debug script from https://bsdio.com/uefi/debugging-with-gdb/ ).

Use CPUDeadLoop() (maybe with a command line flag so you don't have to rebuild just to debug) at the beginning of your app since it doesn't seem to deal with breakpoints where the symbol is not yet available. Use built type NOOPT instead of DEBUG if you have an issue with variables being .

*** BaseTools/Scripts/efi_debugging.py  2022-11-16 17:52:23.000000000 -0800
--- efi_debugging.py    2023-11-26 07:09:18.646253796 -0800
***************
*** 1920,1925 ****
--- 1921,1927 ----

          if self.CodeViewPdb:
              pdb = f'{self.Machine}`{self.CodeViewPdb}'
+             pdb = re.sub(r"\.dll$", ".debug", pdb)
          else:
              pdb = 'No Debug Info:'