It seems like the "disappearance" of storage drives after `insmod ehci` is not relevant to whether the drives are USB ones.
For example, if I start a virtual machine with this: qemu-system-x86_64 -enable-kvm -drive file=grub.img -drive if=pflash,readonly,file=ovmf_x64.bin And do this after grub started: `ls; insmod ehci; ls` It will print only _one_ line with multiple storage drives: (hd0), (hd0, gpt1), (fd0), (fd1), (cd0) which indicates that _everything_ is gone after the insmod command. Same case with ohci/uhci. This seems like a bug to me. And since there's is no way to load any of the USB host controller grub driver modules without breaking grub, I cannot confirm whether the availability usb_keyboard depends on them either. From: Andrei Borzenkov <[email protected]> Sent: Monday, May 22, 2017 1:39 AM To: Tom Yan; [email protected] Cc: Bjørn Forsman Subject: Re: usb_keyboard not available as a terminal input? 21.05.2017 20:28, Tom Yan пишет: > So I assume there is no way to use usb_keyboard on 6th Gen or later Intel > platforms, because there is not an xhci driver in grub while EHCI is > completely gone from their PCH? You could test Bjørn Forsman patches. https://github.com/bjornfor/grub/tree/add-coreboot-xhci-driver-2nd-attempt-v2 https://avatars1.githubusercontent.com/u/133602?v=3&s=400 bjornfor/grub github.com See the file NEWS for a description of recent changes to GRUB 2. See the file INSTALL for instructions on how to build and install the GRUB 2 data and program files. Please visit the official web page of GRUB 2, for more information. The URL is .">grub - My GRUB fork > > I tried `insmod ehci` anyway. Interestingly, the grub environment is sort of > broken after that, because the disk is gone after the insmod command. Like, > before that if I `ls`, it shows "(hd0), (hd0, gpt1), (hd0, gpt2), (hd0, > gpt3)"; and after that if I `ls`, it prints a blank new line. (I am on a > system that has one single drive which is a USB drive). Which is correct. Loading direct hardware drivers disables native platform drivers. > > It seems to me like if I load ehci, the current host controller driver is > replaced so grub can no longer see the USB drive it is on. However there is > not an "xhci" module, so I wonder what was being replaced. > > And if my assumption is true, why would usb_keyboard not work while the > storage drive works? > Because storage driver is using UEFI services by default (or in general on every platform grub prefers using native firmware to access devices). Why do you need usb_keyboard in the first place? Does native UEFI console access not work for you? > > From: Andrei Borzenkov <[email protected]> > Sent: Monday, May 22, 2017 12:36 AM > To: Tom Yan; [email protected] > Subject: Re: usb_keyboard not available as a terminal input? > > 21.05.2017 18:18, Tom Yan пишет: >> Hi all. >> >> So I happened to have looked into terminal_input for a bit (that is, >> "console", the default, has always worked for me so far. I just look into it >> because of curiosity and possible future use case). I notice that there >> should be a "usb_keyboard", as documented here: >> https://www.gnu.org/software/grub/manual/html_node/Simple-configuration.html GNU GRUB Manual 2.02: Simple configuration www.gnu.org While adding extra custom menu entries to the end of the list can be done by editing /etc/grub.d/40_custom or creating /boot/grub/custom.cfg, changing the order of menu entries or changing their titles may require making complex changes to shell scripts stored in /etc/grub.d/. The file /etc/default/grub controls the operation of. grub-mkconfig. It is sourced by a shell script, and so must be valid POSIX shell input; normally, it will just be a sequence of ‘KEY=value’ lines, but if the value contains spaces or other special characters then it must be quoted.">6.1 Simple configuration handling. The program grub-mkconfig (see Invoking grub-mkconfig) generates grub.cfg files suitable for most cases. It is suitable for use ... > > > > GNU GRUB Manual 2.02: Simple configuration > www.gnu.org The GNU Operating System and the Free Software Movement www.gnu.org The free software movement campaigns to win for the users of computing the freedom that comes from free software. Free software puts its users in control of their own computing. Non-free software puts its users under the power of the software's developer. Free software means the users have the freedom to run, copy, distribute, study, change and improve the software. Free software is a matter of liberty, not price. To understand the concept, you should think of “free” as in “free speech”, not as in “free beer”.">GNU is the only operating system developed specifically to give its users freedom. What is GNU, and what freedom is at stake? > > While adding extra custom menu entries to the end of the list can be done by > editing /etc/grub.d/40_custom or creating /boot/grub/custom.cfg, changing the > order of menu entries or changing their titles may require making complex > changes to shell scripts stored in /etc/grub.d/. > > The file /etc/default/grub controls the operation of. grub-mkconfig. It is > sourced by a shell script, and so must be valid POSIX shell input; normally, > it will just be a sequence of ‘KEY=value’ lines, but if the value contains > spaces or other special characters then it must be quoted.">6.1 Simple > configuration handling. The program grub-mkconfig (see Invoking > grub-mkconfig) generates grub.cfg files suitable for most cases. It is > suitable for use ... >> >> However, when I run `terminal_input` in the grub shell, I see this: >> >> Active input terminals: >> console >> Available input terminals: >> serial_* serial at_keyboard >> >> And usb_keyboard is missing. >> >> I tried `insmod usb_keyboard` and `terminal_input` again; while `lsmod` >> lists usb_keyboard, terminal_input still doesn't list it as an available >> input terminal. > > This means usb_keyboard did not detect keyboard. You need to load > suitable HCI drivers as well (ohci, ehci, uhci) - otherwise usb_keyboard > has no way to communicate with device. > > _______________________________________________ Help-grub mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-grub
