Read LPI Linux Certification in a Nutshell Online

Authors: Adam Haeder; Stephen Addison Schneiter; Bruno Gomes Pessanha; James Stanger

Tags: #Reference:Computers

LPI Linux Certification in a Nutshell (3 page)

BOOK: LPI Linux Certification in a Nutshell
5.52Mb size Format: txt, pdf, ePub
ads
Chapter 3. System
Architecture
(Topic 101.1)

This Topic requires general knowledge of fundamental PC architecture
facts that you must know before attempting any operating system
installation. It includes this Objective:

Objective 1: Determine and Configure Hardware
Settings

Candidates should be able to determine and configure fundamental
system hardware. Weight: 2.

Objective 1: Determine and Configure Hardware Settings

Setting up a PC for Linux (or any other operating system)
requires some familiarity with the devices installed in the system and
their configuration. Items to be aware of include modems, serial and
parallel ports, network adapters, SCSI adapters, hard drives, USB
controllers, and sound cards. Many of these devices, particularly older
ones, require manual configuration of some kind to avoid conflicting
resources. The rest of the configuration for the system hardware is done
in the PC’s firmware, or Basic Input/Output System (BIOS).

BIOS

The firmware located in a PC, commonly called the BIOS, is
responsible for bringing all of the system hardware to a state at which
it is ready to boot an operating system. Systems vary, but this process
usually includes system initialization, the testing of memory and other
devices, and ultimately locating an operating system from among several
storage devices. In addition, the BIOS provides a low-level system
configuration interface, allowing the user to choose such things as boot
devices and resource assignments. Quite a few BIOS firmware vendors
provide customized versions of their products for various PC system
architectures. Exams do require an understanding of the basics. For
example, a laptop BIOS may differ significantly from a desktop system of
similar capability from the same manufacturer. Due to these
vari
ations, it’s impossible to test
specifics, but the LPIC Level 1 exams do require an understanding of the
basics.

At
boot time, most PCs display a method of entering the BIOS
configuration utility, usually by entering a specific keystroke during
startup. Once the utility is started, a menu-based screen in which
system settings can be configured appears. Depending on the BIOS vendor,
these will include settings for disks, memory behavior, on-board ports
(such as serial and parallel ports), and the clock, as well as many
others.

Date and time

One of the basic functions of the BIOS is to manage the
on-board hardware
clock. This clock is initially set in the BIOS
configuration by entering the date and time in the appropriate fields.
Once set, the
internal clock keeps track of time and makes the time
available to the operating system. The operating system can also set
the hardware clock, which is often useful if an accurate external time
reference, such as an NTPD server (see
Chapter 16
), is available
on the network while the system is running.

Disks and boot devices

Another fundamental configuration item required in BIOS settings
is the selection of storage devices. Newer systems are able to detect
and properly configure much of this hardware automatically. However,
older BIOS versions require
manual configuration. This may include the selection of
floppy disk sizes and
disk drive
parameters
.

Most PCs have at least three
bootable media types: an internal hard disk (IDE or
SCSI, or perhaps both), a CD-ROM drive (again IDE or SCSI), and a
floppy disk. After initialization, the BIOS seeks an
operating system (or an operating system loader, such as the
Linux Loader [LILO]) on one or more of these media. By
default, many BIOS configurations enable booting from the floppy or
CD-ROM first, then the hard disk, but the order is configurable in the
BIOS settings.

In addition to these default media types, many
server motherboard BIOS (as well as high-end system
motherboards) support booting from a network device such as a NIC with
a bootable ROM. This is often used when booting
diskless workstations such as Linux-based
terminals.

On the Exam

You should be familiar with the general configuration
requirements and layout of the BIOS configuration screens for a
typical PC.

Using the /proc filesystem

When adding new hardware to an existing Linux system,
you may wish to verify which resources the existing devices are using.
The
/proc
filesystem, the kernel’s status
repository, contains this information. The
proc
files,
interrupts
,
dma
, and
ioports
, show how system resources are currently
utilized. (These files may not show devices unless their device
files/drivers are open/active. This may make the problem harder to
find if you’re experiencing resource conflicts.) The following is an
example of
/proc/interrupts
from a dual-CPU
system with an Adaptec dual-AIC7895 SCSI controller:

#
cat /proc/interrupts
CPU0 CPU1
0: 98663989 0 XT-PIC timer
1: 34698 34858 IO-APIC-edge keyboard
2: 0 0 XT-PIC cascade
5: 7141 7908 IO-APIC-edge MS Sound System
6: 6 7 IO-APIC-edge floppy
8: 18098274 18140354 IO-APIC-edge rtc
10: 3234867 3237313 IO-APIC-level aic7xxx, eth0
11: 36 35 IO-APIC-level aic7xxx
12: 233140 216205 IO-APIC-edge PS/2 Mouse
13: 1 0 XT-PIC fpu
15: 44118 43935 IO-APIC-edge ide1
NMI: 0
ERR: 0

In this example, you can see that interrupt 5 is used for the
sound system, so it isn’t available for a second parallel port. The
two SCSI controllers are using interrupts 10 and 11, respectively,
while the Ethernet controller shares interrupt 10. You may also notice
that only one of the two standard IDE interfaces is enabled in the
system BIOS, freeing interrupt 14 use for another device.

Here are the
/proc/dma
and
/proc/ioports
files from the same system:

#
cat /proc/dma
0: MS Sound System
1: MS Sound System
2: floppy
4: cascade
#
cat /proc/ioports
0000-001f : dma1
0020-003f : pic1
0040-005f : timer
0060-006f : keyboard
0070-007f : rtc
0080-008f : dma page reg
00a0-00bf : pic2
00c0-00df : dma2
00f0-00ff : fpu
0170-0177 : ide1
02f8-02ff : serial(auto)
0370-0371 : OPL3-SAx
0376-0376 : ide1
0388-0389 : mpu401
03c0-03df : vga+
03f0-03f5 : floppy
03f7-03f7 : floppy DIR
03f8-03ff : serial(auto)
0530-0533 : WSS config
0534-0537 : MS Sound System
e800-e8be : aic7xxx
ec00-ecbe : aic7xxx
ef00-ef3f : eth0
ffa0-ffa7 : ide0
ffa8-ffaf : ide1

On the Exam

You should know how to examine a running Linux system’s
resource assignments using the
/proc
filesystem.

Universal Serial Bus (USB) is a type of interface used to
connect various types of peripherals, ranging from keyboards and mice
to hard drives, scanners, digital cameras, and printers. The USB
Objective covers the general architecture of USB, USB modules, and
configuring USB devices.

USB Topology

USB devices are attached to a host in a tree through some number
of hub devices. The
lsusb
command can be used to see how
devices are physically attached to a Linux system.

#
lsusb -t
Bus# 4
'-Dev# 1 Vendor 0x0000 Product 0x0000
Bus# 3
'-Dev# 1 Vendor 0x0000 Product 0x0000
|-Dev# 2 Vendor 0x046d Product 0xc501
'-Dev# 3 Vendor 0x0781 Product 0x0002
Bus# 2
'-Dev# 1 Vendor 0x0000 Product 0x0000
|-Dev# 2 Vendor 0x0451 Product 0x2036
| |-Dev# 5 Vendor 0x04b8 Product 0x0005
| '-Dev# 6 Vendor 0x04b8 Product 0x0602
'-Dev# 3 Vendor 0x0451 Product 0x2046
'-Dev# 4 Vendor 0x056a Product 0x0011
Bus# 1
'-Dev# 1 Vendor 0x0000 Product 0x0000
USB Controllers

There are three types of USB host controllers:

  • Open Host Controller Interface (OHCI)

  • Universal Host Controller Interface (UHCI)

  • Enhanced Host Controller Interface (EHCI)

OHCI and UHCI controllers are both USB 1.1 controllers, which are
capable of a maximum of 12 Mbps. EHCI controllers are USB 2.0
controllers, which are capable of a theoretical maximum of 480 Mbps. To
get greater than USB 1.1 speeds, you must have a USB 2.0 controller, as
well as USB 2.0 devices, hubs, and cables. A USB 2.0 device attached to
a USB 1.1 hub will only be able to run at USB 1.1 speeds.

USB Devices

There are several classes of USB devices, including the
following:

Human Interface Device (HID)

Input devices (mice, keyboards, etc.)

Communications device

Modems

Mass storage device

Disk devices, flash readers, etc.

Audio

Sound devices

IrDA

Infrared devices

Printer

Printers and USB-to-parallel cables

USB Drivers

USB support was added to the Linux kernel in the 2.3.x
development kernel series, then back-ported to 2.2.x, minus support for
USB mass storage devices (due to SCSI changes in 2.3.x). The back-port
was included in the 2.2.18 kernel release.

Note

There is
no
kernel USB support in 2.0.x and
earlier.

The Linux kernel USB drivers fall into three categories:

Host controller drivers

The USB host controller drivers include
usb-ohci.o
(OHCI driver),
usb-uhci.o
(UHCI driver),
uhci.o
(old “alternate” UHCI driver), and
ehci-hcd.o
(EHCI driver).

Class drivers

The USB class drivers include
hid.o
,
usb-storage.o
(mass storage driver),
acm.o
(Automated
Control Model [ACM] communications class driver, which deals with
modems that emulate the standard serial modem
AT
command interface),
printer.o
, and
audio.o
.

Other
device drivers

There are many drivers for devices that either don’t fit
into one of the standard USB classes or don’t work with one of the
standard class drivers. Examples include
rio500.o
(the driver for the Diamond Rio 500
MP3 player) and
pwc.o
(the driver for various
Philips webcams).

The Linux drivers implement USB support in layers. At the bottom
is
usbcore.o
, which provides all of the generic USB
support for the higher-level drivers as well as USB hub support. The
host controller drivers load in the middle of the stack. On top are the
device and class drivers and any modules they require.

The following is an example of what you might see in
/proc/modules
(or from the output of
lsmod
) on a system with several USB devices:

Module                  Size  Used by
usb-storage 68628 0
scsi_mod 106168 2 [usb-storage]
evdev 5696 0 (unused)
printer 8832 0
wacom 7896 0 (unused)
keybdev 2912 0 (unused)
mousedev 5428 1
hid 21700 0 (unused)
input 5824 0 [evdev wacom keybdev mousedev hid]
ehci-hcd 19432 0 (unused)
usb-uhci 25964 0 (unused)
usbcore 77760 1 [usb-storage printer wacom hid ehci-hcd \
usb-uhci]
USB Hotplug

Modularized USB drivers are loaded by the generic
/sbin/hotplug
support in the kernel, which is also
used for other hotplug devices such as CardBus cards.

Note

Although not covered on the LPI exams, the Linux
IEEE 1394 (also known as
FireWire or
i.Link) drivers have a similar design. If you understand
how to set up USB devices, setting up IEEE 1394 devices should be
easy.

Configuring specialized hardware has become easier and easier,
even since the development of LPI’s Level 2 Exams. Items such as LCD
panels and serial UPS devices used to not be as common in our homes and
offices, but today they are considered standard equipment.

When you prepared for Level 1, you became familiar with a number
of the tools you must utilize when
adding new hardware to your systems. For the Level 2
exams, you must be prepared to understand when to use them and the most
efficient methods for installing your new devices.

Reporting Your Hardware

Before you tackle adding any new hardware devices to your
system, it’s useful to obtain information about the hardware you have
installed. Some useful tools to report this information include
lsmod, lsdev
, and
lspci
.

Manipulating Modules

A module is dynamically linked into the running kernel
when it is loaded. Much of Linux kernel module handling is done
automatically. However, there may be times when it is necessary for you
to manipulate the modules yourself, and you may come across the
manipulation commands in scripts. For example, if you’re having
difficulty with a particular driver, you may need to get the source code
for a newer version of the driver, compile it, and insert the new module
in the running kernel. The commands listed in this section can be used
to list, insert, remove, and query
modules
.

BOOK: LPI Linux Certification in a Nutshell
5.52Mb size Format: txt, pdf, ePub
ads

Other books

Gone to Texas by Jason Manning
Afternoon Delight by Anne Calhoun
Madbond by Nancy Springer
A New Dawn Rising by Michael Joseph
Famous Nathan by Mr. Lloyd Handwerker
Ocean of Fire by Emma Daniels
Legions by Karice Bolton
A Buss from Lafayette by Dorothea Jensen
The Nightstone by Ogden, Wil