Skip to content

Commit

Permalink
Add Makefile option for emulated USB HID devices
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanRoyer committed Dec 27, 2023
1 parent ccef912 commit c38f86b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ debug ?= none
net ?= none
merge_sections ?= yes
bootloader ?= grub
usb_hid ?= no

## aarch64 only supports booting via UEFI
ifeq ($(ARCH),aarch64)
Expand Down Expand Up @@ -773,6 +774,12 @@ help:
@echo -e "\t Configure which bootloader to pack into the final \".iso\" file."
@echo -e "\t 'grub': Use the GRUB bootloader. Default value."
@echo -e "\t 'limine': Use the Limine bootloader. See setup instructions in the README."

@echo -e "\nThe following key-value options are available to emulate USB devices:"
@echo -e " usb_hid=yes|no"
@echo -e "\t Enables or disables the emulation of USB HID devices."
@echo -e "\t 'no': No USB HID device; enables PS/2 input on x86. Default value."
@echo -e "\t 'yes': Creates a virtual USB controller with keyboard and mouse plugged in."

@echo -e "\nThe following key-value options are available to customize the build process:"
@echo -e " merge_sections=yes|no"
Expand Down Expand Up @@ -954,10 +961,12 @@ else
endif

## USB devices
QEMU_FLAGS += -usb
QEMU_FLAGS += -device usb-ehci,id=ehci
QEMU_FLAGS += -device usb-kbd,bus=ehci.0
QEMU_FLAGS += -device usb-mouse,bus=ehci.0
ifeq ($(usb_hid),yes)
QEMU_FLAGS += -usb
QEMU_FLAGS += -device usb-ehci,id=ehci
QEMU_FLAGS += -device usb-kbd,bus=ehci.0
QEMU_FLAGS += -device usb-mouse,bus=ehci.0
endif

## Currently, kvm by itself can cause problems, but it works with the "host" option (above).
ifeq ($(kvm),yes)
Expand Down

0 comments on commit c38f86b

Please sign in to comment.