Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Hardware
User Name
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?


  Search this Thread
Old 03-03-2007, 04:05 AM   #1
Senior Member
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Rep: Reputation: 127Reputation: 127
Need to alter bios settings from Linux

The PS2-keyboard connector on mb is broken, I do have a usb-keyboard - but it is disabled in BIOS. The default system boots and with Linux running I can use the keyboard (need to unplug-plug in to get it working).
Is there any way to change BIOS settings from Linux, or at least some GRUB-trick so I can use the keyboard in grub's bootmenu?
Old 03-03-2007, 06:02 AM   #2
Senior Member
Registered: Dec 2005
Location: Indiana
Distribution: RHEL/CentOS/SL 5 i386 and x86_64 pata for IDE in use
Posts: 4,790

Rep: Reputation: 57
Err..... no the BIOS is done doing the POST by the the you see the GRUB boot screen. Try setting in the BIOS (the 'F2' key or the 'DEL' key are common choices for getting into the BIOS) the USB to legacy mode.
Old 03-03-2007, 06:11 AM   #3
Senior Member
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Original Poster
Rep: Reputation: 127Reputation: 127
Yes, I know.
The problem is that USB-keyboard is disabled in BIOS currently, I can't press any key at all during booting.
So I need a way to edit BIOS settings from a running OS, or if that isn't possible maybe a way to make Grub catch the keyboard (probably not possible).
Old 03-03-2007, 06:31 AM   #4
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
It may depend on whether your bios is flash based. You may be able to find a bios editor for windows and use wine, but I am guessing from the closest thing I found using Google on modifying the Phoenix bios for vmware. According to the vmware wiki, there is no linux bios editor for the Phoenix bios.

Another dumb idea, that just might qualify as a stupid pet trick! Does your mobo have a ps2 connector for a mouse as well. I wonder if a keyboard plugged into the mouse port will be recognized as a keyboard and allow you to get into the bios and change the mouse settings to use a USB mouse. That is assuming that such an option exists.

At least there may be an option to ignore a missing keyboard during post. Modprobing the kernel modules such as usb-hid, and maybe adding the USB related module dependencies such as usb-core to initrd if they are not compiled into the kernel might cause the keyboard to be detected during the linux boot process instead of having to unplug and plug in the keyboard when you boot up. There may be an early load list in /etc/init.d/ or some config file. This may depend on which distro you are using. Also, check your distro's documentation on persistent devices and HAL if the HAL daemon is used.

Or perhaps running a hardware config gui may be enough. Such as sax2 in SuSE. If you use the Xorg server, for instance, look how the keyboard is referenced in the xorg.conf file. There may be two keyboard sections. Comment out the ps2 one and leave the USB one. Then make sure that this is the one referenced in the screen* section.

*This just occurred to me. Unfortunately, I'm not at my linux computer now, so I can't reference an xorg.conf file or look in the manpage for xorg.conf. I may be confusing screens and displays at the moment. A multi-seat configuration will use multiple keyboards and mice, for example. These settings are in the xorg.conf file. There will be an entry for each keyboard and mouse.

Last edited by jschiwal; 03-03-2007 at 06:42 AM.
Old 03-03-2007, 07:01 AM   #5
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
I was posting, editing and re-editing for such a long period of time, you had time to post a response to Post #2 before I posted a responce to your original post. There is something from the original post that I am not clear about. If left to it's own devices, does the bios continue to boot into linux. In other words, does booting continue if the ps2 keyboard isn't present? This is common for rack mounted servers but not for many desktops. You can look into using the reserve= boot option. This can cause the probing of some devices to be skipped. It used to be commonly done for pre-ACPI era NIC cards, to prevent the second card from getting the same IRQ address.

Here is a link to usb hotplug information from the kernel docs:

Current versions of module-init-tools will create a "modules.usbmap" file
which contains the entries from each driver's MODULE_DEVICE_TABLE. Such
files can be used by various user mode policy agents to make sure all the
right driver modules get loaded, either at boot time or later.

See <linux/usb.h> for full information about such table entries; or look
at existing drivers. Each table entry describes one or more criteria to
be used when matching a driver to a device or class of devices. The
specific criteria are identified by bits set in "match_flags", paired
with field values. You can construct the criteria directly, or with
macros such as these, and use driver_info to store more information.
Good Luck!
Old 03-03-2007, 09:42 AM   #6
Senior Member
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Original Poster
Rep: Reputation: 127Reputation: 127
Thanks a lot, jschiwal, lots of info & tips you've given me!
I'll start with BIOS-editing tools for Windows - was hoping to find for Linux but, well, just a few more reboots needed.

FYI: Yes, it boots without keyboard - I always makes it boot without keyboard, mouse and whatever since Linux can handle stuff BIOS can't.
Now I had updated all distros, the default wasn't present... A few tries to find a live-cd where usbkbd worked (reboot and reboot, just like in the old days! )
(And this usbkbd I finally found is weird - some multimedia-kind - it has no Ctrl-key, also sometimes no 'e' or arrows - programmable probably, I have no idea how...Very irritating!)

I'm puzzled about one thing: you mentioned the xorg.conf and it's different settings for input devices. I have fiddled with that before, and was quite surprised now. Thing is, xorg.conf is the same regardless if it uses PS2 or USB mice/kbd - or both at the same time!
Obviously at least USB-support is handled quite different today?
I think I'll have to do some studying, xorg is getting very different from old XFree.
Knowledge grows old, and so do I...
Old 03-03-2007, 07:29 PM   #7
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
I thought that my desktop had a usb keyboard, but when I checked it doesn't. Anyway, since the motherboard will boot up without a keyboard, I think you are in luck. I don't think you need to edit the bios. If you can get the usb_hid and usb_core modules loaded at boot time, you may not need to unplug and replug the keyboard.

Take a look at which kernel devices are built in and which are modules.

zcat /proc/config.gz will give you the configuration of your running kernel, assuming that that feature was enabled. ( This assumes a 2.6 kernel I believe ). I was surprised to find out that USB_KBD is unset on both my computers. There is a ATKBD device
  1730  # Input Device Drivers
  1731  #
  1735  # CONFIG_KEYBOARD_LKKBD is not set
  2648  #
  2649  # USB Input Devices
  2650  #
  2651  CONFIG_USB_HID=m
  2654  CONFIG_HID_FF=y
  2655  CONFIG_HID_PID=y
  2660  #
  2661  # USB HID Boot Protocol drivers
  2662  #
  2663  # CONFIG_USB_KBD is not set
  2664  # CONFIG_USB_MOUSE is not set
I would suggest an experiment. Before reseating the USB keyboard plug, try to log in remotely with ssh and look at the output of lsmod. ( You can't do that locally if before the keyboard works. ) Are the usb_core and usb_hid
modules loaded. Use something like "lsmod >modulelist1". New unplug the keyboard and plug it in again. And enter "lsm >modulelist2". Now compare the module list. If there is another module loaded, then you want it to load earlier.

If you don't need to interact with the keyboard, such as entering a password to access an encrypted partition, then you might not need to have the USB_HID module in initrd.

Looking at my laptop, there is an /etc/init.d/boot/S03.boot.loadmodules script.
case "$1" in
    # Read variable for sysconfig and load all mentioned modules
    echo Loading required kernel modules
    . /etc/sysconfig/kernel
    for I in $MODULES_LOADED_ON_BOOT ; do
        if ! modprobe -n $I > /dev/null 2>&1 ; then continue ; fi
        modprobe $I;
    rc_status -v1 -r
If I had the same problem, I could simply try adding usbhid and usbcore to the list and see if that works. If you have a similar config script, or can add "modprobe usbcore" and "modprobe usbcore" to an appropriate boot script like linuxrc, you might go for it even if it is a kludge.

Otherwise, we're not chasing a moving target, we are entering the Rabbit hole!

Look in your /etc/hotplug.conf or a script in /etc/hotplug.d/. My system doesn't use hotplug as much as most distro's, so I just have an entry for a USB Kino Shuttle device. There may be an auto vs hotplug option. I have nothing on my system to check against because it uses udev/hal and scripts to do all this. I think that auto may be a better option. But I may be getting confused with the "hwup" script option.

Also check if you have a hwup script. Here is a line from my system's udev rules:
80-sysconfig.rules:SUBSYSTEM=="usb", ACTION=="add", RUN+="/sbin/hwup usb-devpath-%p -o hotplug"
You're system may be configured differently. Like you said, you are trying to hit a moving target, while moving yourself.
That is how they screened tail gunners in WWII. Skeet shooting from the back of a flatbed trailer.

You may be interested in reading the kernel source's /usb/hotplug.txt documentation. Excerpt:

In hotpluggable busses like USB (and Cardbus PCI), end-users plug devices
into the bus with power on.  In most cases, users expect the devices to become
immediately usable.  That means the system must do many things, including:

    - Find a driver that can handle the device.  That may involve
      loading a kernel module; newer drivers can use module-init-tools
      to publish their device (and class) support to user utilities.

    - Bind a driver to that device.  Bus frameworks do that using a
      device driver's probe() routine.

    - Tell other subsystems to configure the new device.  Print
      queues may need to be enabled, networks brought up, disk
      partitions mounted, and so on.  In some cases these will
      be driver-specific actions.

This involves a mix of kernel mode and user mode actions.  Making devices
be immediately usable means that any user mode actions can't wait for an
administrator to do them:  the kernel must trigger them, either passively
(triggering some monitoring daemon to invoke a helper program) or
actively (calling such a user mode helper program directly).

Those triggered actions must support a system's administrative policies;
such programs are called "policy agents" here.  Typically they involve
shell scripts that dispatch to more familiar administration tools.

Because some of those actions rely on information about drivers (metadata)
that is currently available only when the drivers are dynamically linked,
you get the best hotplugging when you configure a highly modular system.
My documentation states that udev and hal helper scripts are used in place of a hotplug configuration. It doesn't go any further, such as what in kde is involved when you insert a pen drive. The udev rules pertain to adding a device, but the hal part is still a bit of a mystery.

A moving target! We are battling a hydra from a trapeze.

And I forgot to mention dbus.

Sorry I couldn't be more helpful. There is some good udev documentation I need to study that even shows a block diagram. I would have to study that document and map each config file and script to the diagram before truly understanding it.

Naah! Too much work. Besides the stew I'm heating up for supper is starting to turn into gruel. But to be perfectly honest, I personally would prefer to eat gruel and battle a hydra, before editing my bios with an external tool.

Goto go.

Last edited by jschiwal; 03-03-2007 at 07:32 PM.
Old 03-03-2007, 08:10 PM   #8
LQ Guru
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
You can try discharge the CMOS and see if your USB keyboard works.

WINE does not work at low level, so it will never work with a stupid Windows based BIOS interface. Also VMware will not work because it creates a virtual machine that does not touch the BIOS. VMware can be configure to use any keyboard. Plugging a keyboard in the mice input will not work because it uses different commands. You should of have been more careful with your connections.

As the kernel advances, input devices evolve. PS/2 keyboards uses the ISA device nodes (ok they always did). PS/2 mice used /dev/psaux and now uses /dev/input/mice. Earlier kernel versions of 2.6.x did not have code to know that there were PS/2 mouse detected, so the only way to force it is to compile it as a module and manually load it. I still have to do to this day.

Since Xorg project has lot of companies contributing to it, it will advance faster than others.

Some distributions organize boot scripts better than others. Gentoo organizes in a more logical way because modules.conf or modprobe.conf gets created by a group of files that are easy to edit. Also separates 2.4 and 2.6 kernel scripts to manually load modules that can not be loaded by just modules.conf or modprobe.conf. udev, hal, and dbus in Gentoo is organize a lot better too.

I do not recommend using GUI programs to customized xorg.conf and many other files because GUI programs will screw up your setup.
Old 03-16-2007, 03:19 AM   #9
Senior Member
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,350

Original Poster
Rep: Reputation: 127Reputation: 127
Thanks, Electro and jschiwal!
Haven't answered earlier since I've been extremely busy.

I would have liked to dig deeper into this, but I just don't have the time. I discharged the CMOS - why didn't I think of that? - and then it works.

One very strange thing I just have to mention:
I have 4 USB-ports, 2 directly on m/b ("USBCon1") and 2 also built-in but requires an extra cable (pins on m/b) ("USBCon2").
Before discharging CMOS (=no keyboard at bootup):
* Knoppix (liveCD) and blag (installed) uses the wireless USB keyboard fine, no matter where it is connected.
* Mandriva 2006 & 2007 detects the keyboard only when attached to "USBCon1"! With keyboard attached to "USBCon2" I must unplug/plug usb cable.
However, I also have a bluetooth USB-dongle attached to "USBCon2" - this one Mandriva activates directly!

Well, unfortunatel I have to leave this subject without further studying - I have enough trouble getting my bluetooth Internet-connection to work properly... (sigh, bluetooth is weird!)

Cheers Peter
Old 03-16-2007, 07:50 PM   #10
LQ Guru
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Why are using Bluetooth for browsing the internet?

Using Bluetooth for the internet will be very, very slow. Bluetooth transfers at the rate of a few hundred kilobytes and maybe even less.

I do not use wireless keyboard and mouse because the maintenance of these devices is more than cleaning them. Also their reliability and stability is poor. I recommend wired keyboard and mouse because they are stable and reliable.

This thread is making my head hurt because you do not provide a complete specs of your setup. This thread goes one way and then goes completely the other way.
Old 03-17-2007, 09:11 AM   #11
Registered: Mar 2007
Location: North Carolina
Distribution: Slackware 12.0, Gentoo, LFS, Debian, Kubuntu.
Posts: 906

Rep: Reputation: 38
Adapt to ps2

I had trouble with my usb kb and used a couple of adapters i had lying around and converted them to ps2 connectors... so far no problems and no need for cleaning or updating. just using standard kb drivers.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Viewing BIOS settings from within Linux dazdaz Linux - Software 16 11-03-2011 03:45 PM
alter certain display settings from console rowan2 Linux - Laptop and Netbook 1 07-11-2006 07:41 PM
BIOS settings and Linux Disk Partitions solletica Linux - Newbie 2 11-22-2005 01:55 AM
how linux deals with bios settings jig Linux - Hardware 8 11-13-2004 05:59 AM > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:35 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration