Grub2在没有insmod usb_keyboard情况下,为什么可以使用usb keyboard?

启动讨论 grub/grub2/syslinux/grub4dos/Lilo
回复
Shimnly
帖子: 2
注册时间: 2016-11-10 10:16
系统: win7

Grub2在没有insmod usb_keyboard情况下,为什么可以使用usb keyboard?

#1

帖子 Shimnly » 2018-08-21 16:11

最近在学习grub2中发现这个问题:
实验:
Platform: i386-pc
Sata : MBR format
通过阅读grub2.02源码,对于i386-pc core.img包含的modules:ext2 part_msdos biosdisk, 我删除了/boot/grub/grub.cfg,目的是只加载core.img中的moduels以及normal.mod,故电脑启动后进入grub command-line normal mode.
grub shell下查看modules:
grub> lsmmod

Name Ref count Dependencies
Minicmd 1
Normal 1 buf io,gettext,terminal,crypto,extcmd,boot
Gzio 0
Bufio 1
Gettext 1
Terminal 2
Crypto 2
Extcmd 2
Boot 2
Biosdisk 1
Part_msdos 1
Ext2 1 fshelp
Fshelp 2
但是usb keyboard需要的是usb_keyboard.mod ,并没有安装,但是usb keyboard能被使用,为什么呢?
类似的有ps2 keyboard。
poloshiao
论坛版主
帖子: 18279
注册时间: 2009-08-04 16:33

Re: Grub2在没有insmod usb_keyboard情况下,为什么可以使用usb keyboard?

#2

帖子 poloshiao » 2018-08-21 17:01

但是 usb keyboard 能被使用
1. 開機 登入 Bios 查閱有沒有 usb 1.0 及 usb keyboard 選項 有沒有 設為 enabled ?
1-1. 如果有 表示 usb keyboard 已由 bios firmware 啟用
grub> lsmmod
Name Ref count Dependencies
Minicmd 1
Normal 1 buf io,gettext,terminal,crypto,extcmd,boot
Gzio 0
Bufio 1
Gettext 1
Terminal 2
Crypto 2
Extcmd 2
Boot 2
Biosdisk 1
Part_msdos 1
Ext2 1 fshelp
Fshelp 2
但是usb keyboard需要的是usb_keyboard.mod ,并没有安装,但是usb keyboard能被使用,为什么呢?
2. 出現 grub> 表示 你目前是處於 GRUB 2 command shell 但是 找不到 /boot/grub/grub.cfg
2-1. https://www.linux.com/learn/how-rescue- ... 2-linux%20
When you boot up your system and it stops at the grub> prompt, that is the full GRUB 2 command shell. That means GRUB 2 started normally and loaded the normal.mod module (and other modules which are located in /boot/grub/[arch]/), but it didn't find your grub.cfg file.
2-1. lsmod 這裡已載入的 modules 是只限於由 grub 2 提供
https://www.gnu.org/software/grub/manua ... html#lsmod
Command: lsmod
Show list of loaded modules.
回复