help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: usb_keyboard not available as a terminal input?


From: Tom Yan
Subject: Re: usb_keyboard not available as a terminal input?
Date: Sun, 21 May 2017 18:03:20 +0000

"console" works for me for the whole time, as I mentioned in my first mail. I 
just want to know more about usb_keyboard out of curiosity (also to sort of 
prep myself for cases when "console" does not work).

Back to the topic. In that case I assume the availability of usb_keyboard as a 
input terminal depends on whether my UEFI provides a driver/service for grub to 
access it "directly" as a USB device? Like, provides something like "usbhid" in 
addition to "uas" and "usb-storage" (in the UEFI sense)? Or maybe UEFI / grub 
simply never allows that kind of access to USB keyboard?

Hmm, maybe I can test it with qemu/ovmf for a bit myself. Thanks for the info 
so far btw.


From: Andrei Borzenkov <address@hidden>
Sent: Monday, May 22, 2017 1:39 AM
To: Tom Yan; address@hidden
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
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 <address@hidden>
> Sent: Monday, May 22, 2017 12:36 AM
> To: Tom Yan; address@hidden
> 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

 
http://upload.wikimedia.org/wikipedia/en/thumb/2/22/Heckert_GNU_white.svg/128px-Heckert_GNU_white.svg.png
 


The GNU Operating System and the Free Software Movement
www.gnu.org
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.
>     
> 

    

reply via email to

[Prev in Thread] Current Thread [Next in Thread]