Determining and Configuring Hardware Settings

When setting up a PC to have Linux installed, one needs to familiarize themselves with the devices installed on their system and how they are configured.

Some of these items include:

  • Network Adapters
  • SCSI adapters
  • Parallel ports
  • Serial Ports
  • Hard drives
  • USB controllers
  • Sound Cards

These devices can either be configured manually or using the system BIOS (Basic Input/Output System)

BIOS
It is the firmware responsible for bringing the system hardware to a state that is ready to boot an operating system.

This process includes system initialization, testing of memory and other devices, and locating an operating system from among a number of storage devices.

It provides you with a low level configuration that allows you to choose things like boot devices.

BIOS firmware however are largely dependent on the vendor and the type of machine. Most machines have a way of entering the BIOS during boot time.

The following items can be configured from the BIOS:

  • Date and Time – The BIOS manages the hardware clock. This internal clock makes the time available for the operating system.
  • Boot devices and disks – Most systems have at least three bootable media types: internal hard disk, CD-ROM , and a floppy disk.

During boot process, the BIOS seeks an operating system from one of these media. By default, most BIOS configurations enable booting from CD-ROM first, then the hard disk but the order can be changed from the BIOS settings.

The /proc filesystem

The /proc filesystem is the kernel’s status repository. It contains information on how the existing devices are utilizing the available resources.

Proc files, interrupts, dmaand ioports are used to show how resources are being utilized.

The following files; /proc/interrupts, /proc/dma and /proc/ioportscan be used to show the resource assignments on a running Linux system.

Universal Serial Bus (USB)

It is a type of interface that is used to connect various types of peripherals I.e keyboards, mice, hard drives, scanners, printers, cameras etc.

Here, we are going to look at the general architecture of USB, USB modules and the configuration of USB devices.

USB Topology

USB devices are connected to a host in a tree through a number of hub devices.

lsbusb command is used to show how USB devices are connected to a Linux system.

[norman@localhost ~]$ lsusb -t

/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M

/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M

|__ Port 4: Dev 2, If 0, Class=Video, Driver=uvcvideo, 480M

|__ Port 4: Dev 2, If 1, Class=Video, Driver=uvcvideo, 480M

/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M

|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M

/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M

|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M

|__ Port 2: Dev 3, If 0, Class=Human Interface Device, Driver=usbhid, 12M

|__ Port 3: Dev 4, If 0, Class=Vendor Specific Class, Driver=btusb, 12M

|__ Port 3: Dev 4, If 1, Class=Vendor Specific Class, Driver=btusb, 12M

|__ Port 3: Dev 4, If 2, Class=Vendor Specific Class, Driver=btusb, 12M

|__ Port 3: Dev 4, If 3, Class=Application Specific Interface, Driver=, 12M

|__ Port 4: Dev 5, If 0, Class=Vendor Specific Class, Driver=rtsx_usb, 480M

USB Controllers

There are three types of USB host controllers.

  1. Open Host Controller Interface (OHCI) – Capable of a maximum 12 Mbps
  2. Universal Host Controller Interface (UHCI) – Also capable of a maximum 12 Mbps
  3. Enhanced Host Controller Interface (EHCI) – Capable of a maximum 480 Mbps

USB Devices
Classes of USB devices are:

  • Human Interface Device (HID) – Input devices like mice and keyboards.
  • Communication Devices – Like modems
  • Mass Storage Devices – Like hard drives and flash disks
  • Audio Devices – Sound Devices

Tools that can be used to get information regarding the installed hardware

Some tools that can be useful when reporting hardware information includes lsmod, lsdev and lspci

lsdev

This command displays information about your system hardware. That is, Interrupt addresses and I/O ports.

The command uses DMA files in /proc to report interrupt addresses, IRQ and DMA channel notifications.

The output of the command has four columns: Device name, DMA address, IRQ address and I/O ports.

lspci

This command displays information about the systems PCI buses and your installed PCI devices.

lsmod

This command is used to display the information of the kernel module that is loaded.

It displays the name of the module, the size of the module, use count and a list of other referring modules.

It has the same information as is available in /proc/modules

Manipulating Modules

The Linux kernel handles modules automatically. There are however cases where you may be required to manipulate the modules and link it to a running kernel.

The following commands can be used to insert, remove and query modules.

insmod

This command is used to insert a module into a running kernel.

The module is located automatically and inserted. One requires superuser privileges to insert modules.

modprobe

This command is used to determine dependencies that a module requires before it is inserted.

It can also be used to insert modules. It has the ability to load modules along with their prerequisites.

It can be used to remove modules as well when combined with the -r option .

modprobe is a very useful tool when dealing with modules. Check out it’s man page

rmmod

This command is used to remove modules from the running kernel.

It also requires superuser privileges to execute.

A module cannot be removed if it is in use or if it is being referred to by another module.

modeinfo

Used to display information about a module from it’s module_object_file

Leave a Reply

Your email address will not be published. Required fields are marked *