Skip to content

os: a keyboard on the console - usbhid, hid_generic and evdev in the image - #590

Merged
bong-water-water-bong merged 1 commit into
mainfrom
1bit/os-usb-keyboard
Oct 26, 2026
Merged

bong-water-water-bong merged 1 commit into
mainfrom
1bit/os-usb-keyboard

Conversation

@bong-water-water-bong

Copy link
Copy Markdown
Collaborator

Second hardware boot of the appliance (candidate 8, 26 Oct, Secure Boot on): the menu drew on tty1 and waited for a key; the owner could not type. Over ssh: /dev/input held only mice, dmesg listed no USB keyboard, lsmod showed hid (pulled in by amd_sfh) but no usbhid or hid_generic, and the initramfs's drivers/hid/ directory had only hid.ko.xz and the amd-sfh driver. In this kernel CONFIG_USB_HID=m and CONFIG_HID_GENERIC=m, and the image's module list never named them. The KVM's keyboard and any USB keyboard are HID devices, so no keystroke could reach the console. On candidate 5 the same gap sat behind the kernel-message flood that #582 removed.

os/mini/mkimage.sh: usbhid hid_generic evdev join the module list (their dependencies come along the way the list already resolves them with modprobe --show-depends). os/mini/init.sh: the same three load with the other USB drivers before the console and the menu start.

The gate cannot prove a keyboard (it drives the serial line); the proof is the next stick.

🤖 Generated with Claude Code

…image

Second hardware boot (candidate 8, 26 Oct): the full-screen menu drew on tty1 and waited for a key, and the
owner could not type. /dev/input held only "mice", dmesg showed no USB keyboard, and the initramfs
carried hid.ko (for amd_sfh) but neither usbhid nor hid_generic: CONFIG_USB_HID and CONFIG_HID_GENERIC are
modules in this kernel and the image's module list never named them. The KVM's keyboard and any USB
keyboard are HID devices, so no keystroke ever reached the console - on candidate 5 the same gap hid
behind the kernel-message flood that #582 fixed.

mkimage.sh adds usbhid, hid_generic and evdev to the module list (with their dependencies, as the list
already does); init.sh loads them with the other USB drivers before the console starts.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@bong-water-water-bong
bong-water-water-bong merged commit f827869 into main Oct 26, 2026
8 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/os-usb-keyboard branch October 26, 2026 07:48
@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

582 - Partially compliant

Compliant requirements:

  • The console shell now has a visible prompt '1bit-os:\w # ' which matches the gate's expected pattern
  • Kernel messages no longer overwrite the shell prompt due to proper loglevel configuration
  • USB keyboard support is enabled with the addition of usbhid, hid_generic, and evdev modules
  • The init script now loads usbhid, hid_generic, and evdev before starting the console and menu

Non-compliant requirements:

  • None

Requires further human verification:

  • None
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Missing Module Dependencies

The addition of usbhid, hid_generic, and evdev modules in mkimage.sh may introduce dependency issues if the module resolution logic doesn't properly account for all required dependencies. While the code uses modprobe --show-depends to resolve dependencies, there's a potential for missing transitive dependencies that could cause runtime failures.

mods="nvme ahci amd_pmf amdgpu amdxdna r8169 realtek mt7925e xhci_pci usb_storage uas sd_mod vfat ext4 nls_iso8859_1 nls_cp437 nls_ascii virtio_net virtio_blk thunderbolt thunderbolt_net typec ucsi_acpi typec_displayport usbhid hid_generic evdev"
Driver Loading Order

The order of driver loading in init.sh has been changed to include USB HID drivers. While this is necessary for keyboard support, it's important to ensure that this change doesn't negatively impact the boot sequence or cause conflicts with other drivers that were previously loaded in a specific order.

for m in realtek r8169 mt7925e virtio_net xhci_pci usb_storage uas sd_mod nvme ahci vfat nls_cp437 nls_iso8859_1 nls_ascii ext4 phy-generic typec typec_ucsi ucsi_acpi typec_displayport thunderbolt usbhid hid_generic evdev; do modprobe -q "$m"; done

bong-water-water-bong added a commit that referenced this pull request Oct 26, 2026
…t says which are missing (#593)

Owner, after the candidate 8 boot: do a hardware probe and make sure all drivers are on the stick.
os/mini/hwprobe.py walks every bus on the build machine (the appliance's own board), maps each bound
device to its kernel module and lists the modules the built image root does not carry. Against the
candidate 8 root it found 21 missing; 9 of them are built into this kernel (modprobe --show-depends
resolves nothing), the rest are modules the image never named: the USB keyboard set (#590), k10temp
(CPU temperature, what the fan logic and the checks read), i2c_piix4 (SMBus) and spd5118 (DIMM
sensors), amd_pmc, psmouse and serio_raw, btusb (the MT7925 Bluetooth firmware is already shipped),
snd_hda_intel and snd_usb_audio, sdhci_pci, intel_rapl_msr. All of them join mkimage.sh's module list
(dependencies resolved as before) and init.sh's load loop, since BusyBox init has no udev.

Co-authored-by: bong-water-water-bong <bong-water-water-bong@1bit.gg>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant