0% found this document useful (0 votes)
30 views20 pages

CHAPTER 2 Hardware Management

Uploaded by

NG Yves
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views20 pages

CHAPTER 2 Hardware Management

Uploaded by

NG Yves
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

CHAPTER II: LINUX

HARDWARE MANAGEMENT
CHAPTER OBJECTIVES
In this chapter, weespecially would learn to configure and check the
hardware for a Linux system. Learn to:
• Enable and disable integrated peripherals
• Configure systems with or without external peripherals such as
keyboards
• Distinguish different types of mass storage devices
• Understand cold-plug and hot-plug devices
• Know what hardware resources devices use
• Use tools to list and manipulate devices
• Understand sysfs, procfs, udev, and dbus
CHAPTER OUTLINE
II.1 Computer Hardware
II.2 Hardware settings
II. 3 Mass Storage devices
II.4 Hot plug and Cold plug
II.5 Virtual Files for Hardware and System Information
II.1 Computer Hardware
What are the basic components of a Computer?
II.1 Computer Hardware (prerequisite)
What are the basic components of a Computer?
The Von Neumann architecture
• The role of the processor
• The in put and output devices
• Types of memory
• Storage devices
II.1 Computer Hardware
All computers and servers are shipped with a set of core hardware
• A CPU
• RAM
• Additional features that help glue everthing together
• The firmware which provides config tools and initiates the OS booting process. It can be used to disable
or enable harware components before booting.
• Once linux has booted, you would need Linux utilities to manage the hardware
• Key components managed by the firmware once linux is booted include I/O
addresses, DMA addresses, the real time clock and ATA hard disk interfaces.
II.2 Hardware Settings
The BIOS or the Extensible Firmware Interface (EFI) or the Unified EFI
(UEFI) are installed in flash memory on the motherboard. (After 2011,
most computers come with UEFI)
How do you get to your BIOS?
• Interrupt Requests (IRQs)
• It is a signal sent to the CPU instructing it to suspend its current activity and to handle some
external event such as keyboard input.
• There were 16 (0-15) on the X86 platform. They are more on the modern platforms.
• You can examine the IRQs in use by examining the contents of /proc/interrupts file
$more /proc/interrupts
II.2 Hardware Settings
• The /proc file system is a virtual file system – it does
not refer to actual files on a hard disk but to kernel
data that is convenient to represent using a file
system.
• Linux does not start using IRQs until it has loaded
the required
II.2 Hardware Settings
I/O Addresses.
• I/O ports are unique locations in memory that are reserved for
communication between the CPU and specific hardware devices.
• Prior to « plug and play » technology, you would have to configure I/O devices
addresses in the BIOS and OS before using the devices. Today the allocation is
done automatically the OS and the bus.
• They can be viewed examining the contents of the /proc/ioports file
• $ cat /proc/ioports
II.2 Hardware Settings
I/O Addresses.
Linux device Windows Typical IRQ I/O address
name
/dev/ttyS0 COM1 4 0x03f8
/dev/ttyS1 COM2 3 Ox02f8
/dev/ttyS2 COM3 4 0x03e8
/dev/ttyS3 COM4 3 0x02e8
/dev/lp0 LPT1 7 0x0378 -0x037f

/dev/lp1 LPT2 5 0x0278- 0x027f


II.2 Hardware Settings
DMA Addressing.
• DMA is an alternative method of communication to I/O ports
• DMA permits a device to transfer date directly to memory and vise versa
without passing through the CPU
• This can improve overall system performance as CPU attention is not required.
• To learn what DMA channels your system uses, examine the /proc/dma file.
• DMA is automatically configured by the OS for most devices.
II.2 Hardware Settings
DMA Addressing.
• On parallel ATA (PATA) disks, DMA may not be automatically
enabled.
• For PATA devices DMA may be enabled by using the cammand
• $ hdparm -d1 /dev/sda
• To see current setting on your hard disk you can run the
command :
• $ hdparm -d /dev/sda
• SATA drives do not use DMA in the conventional sense.
II.3 Coldplug and Hotplug devices
• Whenever you deal with devices, try to distinguish between coldplus and hotplug devices
• These device types differ depending on whether they can be physically attached and detached
when the computer is turned on (hot) versus only when it is turned off (cold)
• Traditionally, components that are internal to the computer , such as CPU, memory, PCI cards and
hard disks have been coldplug. Exception some SATA disks
• Modern external devices are hotplug.
II.3 Coldplug and Hotplug devices
• Utilities that help in managing hotplug devices:
• Sysfs: the sysfs virtual file system mounted at /sys, exports info about devices so that user
space utilities can access the information.
• HAL daemon or hald is a user space program that runs at all times that provides other user
space prog with info about available hardware
• D-Bus enables processes to communicate with each other as well as to register to be notified
of events , both by hardware (such as the availability of a new USB device
II.3 Coldplug and Hotplug devices
• Utilities that help in managing hotplug devices:
• udev: this is a virtual filesystem, mounted at /dev, which creates dynamic device files as drivers are
loaded and unloaded. Udev can be configured through files in /etc/udev. The standard config is
usually sufficient for common hardware.
• The lsdev command
• The procinfo package contains the lsdev command, which simplifies the presentation of the
information from /proc by gathering the DMA, IRQ, and I/O port information for each device into a
simple tabular format.
II.3 Configuring Expansion Cards
•Configuring PCI Cards
• The PCI bus is the standard expansion bus for most
internal devices and were designed for PnP.
• PCI devices configure themselves automatically.
• To check how PCI device configurations use the
command lspci
U.

II.3 Configuring Expansion Cards


• USB and lsusb
• Use the lsusb command to display information
about your usb devices

You might also like