1. Trang chủ >
  2. Công Nghệ Thông Tin >
  3. Kỹ thuật lập trình >

Chapter 10. Exam 101 Highlighter's Index

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (10.57 MB, 1,207 trang )


This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks



10.1. Hardware and Architecture



10.1.1. Objective 1: Configure Fundamental BIOS Settings



10.1.1.1. PC BIOS



The BIOS is the PC's firmware.

The BIOS sets date and time for on-board clock, storage device configuration, and so on via menus.



10.1.1.2. Resource assignments



Interrupts (IRQs) allow peripherals to interrupt the CPU.

I/O addresses are locations in the processor's memory map for hardware devices.

DMA allows certain devices to work directly with memory, freeing the processor (see Table 10-1).



Table 10-1. Common device settings

Device



I/O address



IRQ



DMA



ttyS0 (COM1)



3f8



4



NA



ttyS1 (COM2)



2f8



3



NA



ttyS2 (COM3)



3e8



4



NA



ttyS3 (COM4)



2e8



3



NA



lp0 (LPT1)



378-37f



7



NA



lp1 (LPT2)



278-27f



5



NA



fd0, fd1 (floppies 1 and 2)



3f0-3f7



6



2



fd2, fd3 (floppies 3 and 4)



370377



10



3



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks



10.1.1.3. 1024-cylinder limit



LILO and the kernel image should be kept within the first 1024 cylinders on hard disks.



10.1.2. Objective 3: Configure Modems and Sound Cards



10.1.2.1. Modems



Modems are serial devices. Some are external and are attached to a serial port. Others are installed in a computer and

include serial port electronics on-board.

Some modems are produced at reduced cost by implementing portions of their functionality in Windows software libraries.

These so-called "winmodems" aren't compatible with Linux without add-on drivers.



10.1.2.2. Sound devices



PCI sound cards and most ISA PnP cards under 2.4.x kernels are automatically configured when the card's driver is loaded.

When the old userspace ISA PnP tools are used, pnpdump output is stored for use at boot time byisapnp, which does

plug-n-play configuration.



10.1.3. Objective 4: Set Up Non-IDE Devices



10.1.3.1. SCSI



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks



The SCSI defines a bus for multiple storage devices.

SCSI capabilities range from 5 MBps to 80 MBps and higher for the newest types.

8-bit SCSI offers up to seven devices plus the controller on a single bus.

16-bit SCSI offers up to 15 devices plus the controller on a single bus.

Each device on the bus has a unique SCSI ID, 07 or 015. Controllers often default to address 7.

Linux device files for SCSI disks are typically /dev/sda, /dev/sdb, and so forth.

Linux device files for SCSI tape drives are typically /dev/st0, /dev/st1, and so on.

SCSI buses must be terminated on both ends. Many SCSI devices include internal terminators to eliminate the need for

external terminators.

PC SCSI adapters have their own BIOS, where the default boot device, bus speed, and on-board termination settings can be

made.



10.1.4. Objective 5: Set Up PC Different Expansion Cards



10.1.4.1. /proc



The /proc filesystem includes information on interrupts, I/O ports, and DMA in/proc/interrupts, /proc/ioports, and /proc/dma.



10.1.4.2. Commands



On 2.2.x and earlier kernels (or 2.4.x kernels configured without kernel ISA PnP support), use isapnp to configure ISA cards

and pnpdump for a report of ISA PnP resource information.

On 2.4.x and higher kernels, use /proc/isapnp to view and set the configuration of ISA PnP cards.

For a listing of installed PCI devices, use lspci.



10.1.5. Objective 6: Configure Communication Devices



10.1.5.1. Concepts



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks



Internal communication devices are configured the same as other PC expansion cards.

Most broadband communication devices connect to your PC via USB or ethernet interfaces.



10.1.5.2. Commands



setserial is used to set serial port information.



10.1.6. Objective 7: Configure USB Devices



10.1.6.1. Host Controllers



Open Host Controller Interface (OHCI), USB 1.1

Universal Host Controller Interface (UHCI), USB 1.1

Enhanced Host Controller Interface (EHCI), USB 2.0



10.1.6.2. Devices



HID devices include USB peripherals such as keyboards, mice, and tablets.

Communication devices include modems and broadband adapters.

Mass storage devices include hard drives, tape drives, and flash readers.



10.1.6.3. Drivers



Host Controller Drivers include usb-ohci.o, usb-uhci.o, uhci.o, and ehci-hcd.o.

Class drivers include hid.o, usb-storage.o, acm.o, printer.o, and audio.o.



10.1.6.4. Commands



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks



hotplug is used to automatically load and unload USB modules when devices are plugged in or removed while a system is

running.



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks



10.2. Linux Installation and Package Management



10.2.1. Objective 1: Design a Hard Disk Layout



10.2.1.1. Guidelines



Keep / small by distributing larger parts of the directory tree to other filesystems.

Separate a small /boot partition below cylinder 1024 for kernels.

Separate /var into its own partition to prevent runaway logs from filling /.

Separate /tmp.

Separate /usr if it is to be shared read-only among other systems via NFS.

Set swap size to be somewhere between one and two times the size of main memory.



10.2.2. Objective 2: Install a Boot Manager



10.2.2.1. LILO



LILO has historically been the default Linux boot loader.

LILO consists of the lilo command, which installs the boot loader, and the boot loader itself.

LILO is configured using /etc/lilo.conf.



10.2.2.2. GRUB



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks



GRUB can boot Linux as well as most other PC-based operating systems.

GRUB relies on various files in the /boot/grub directory to support reading from various types of filesystems.

GRUB is configured using /boot/grub/menu.lst (or /boot/grub/grub.conf on some distributions).

GRUB can be configured to present a text or graphical menu interface and also has a command-line interface.



10.2.3. Objective 3: Make and Install Programs from Source



10.2.3.1. Source Files



Software often comes in a compressed tar archive file.

Larger source code packages include a configure script to verify that everything is in order to compile the software.



10.2.3.2. make



make is then used to build the software.

make is also often used to install the software into directories such as/usr/local/bin.



10.2.4. Objective 4: Manage Shared Libraries



10.2.4.1. Concepts



System libraries provide many of the functions required by a program.

A program that contains executable code from libraries is statically linked because it stands alone and contains all necessary

code to execute.

Since static linking leads to larger executable files and more resource consumption, system libraries can be shared among

many executing programs at the same time.



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks



10.2.4.2. Commands



A program that contains references to external , shared libraries is dynamically linked at runtime by the dynamic linker, ld.so.

New locations for shared libraries can be added to the LD_LIBRARY_PATH variable. As an alternative, the locations can be

added to /etc/ld.so.conf, which lists library file directories. After this, you must runldconfig to translate this file into the binary

index /etc/ld.so.cache.



10.2.5. Objective 5: Use Debian Package Management



10.2.5.1. Commands



dpkg automates the installation and maintenance of software packages and offers a number of options.

dselect uses a text based interactive menu to select (or deselect) packages for installation.

alien can install RPM packages on Debian-based systems .

apt-get is a powerful tool that interfaces with online repositories of Debian packages to install and upgrade Debian packages

by package name and resolves each package's dependencies automatically.



10.2.6. Objective 6: Use Red Hat Package Manager (RPM)



10.2.6.1. Concepts



RPM automates the installation and maintenance of software packages.

Package dependencies are defined but not resolved automatically.

-i, -e, -U, -v, -h, --nodeps, and --force are common options.



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register

. it. Thanks



10.3. GNU and Unix Commands



10.3.1. Objective 1: Work Effectively on the Command Line



10.3.1.1. The interactive shell and shell variables



A shell provides the command prompt and interprets commands.

A shell variable holds a value that is accessible to shell programs.

PATH is a shell variable that contains a listing of directories that hold executable programs.

Commands must be bash built-ins, found in the PATH, or explicitly defined in order to succeed.

When shell variables are exported, they become part of the environment.



10.3.1.2. Entering commands



Commands are comprised of a valid command, with or without one or more options and arguments, followed by a carriage

return.

Interactive commands can include looping structures more often used in shell scripts.



10.3.1.3. Command history, editing, and substitution



Shell sessions can be viewed as a conversation. History, expansion, and editing make that dialog more productive.

Commands can be reissued, modified, and edited. Examples are shown in Table 10-2.

Command substitution allows the result of a command to be placed into a shell variable.



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks



Table 10-2. Shell expansion, editing, and substitution examples

History type



Examples



Expansion



!!

!n

^string1^string2



Editing



Ctrl-P, previous line

Ctrl-K, kill to end of line

Ctrl-Y, paste (yank) text



Substitution



VAR=$(command)



10.3.1.4. Recursive execution



Many commands contain either a -r or -R option for recursive execution through a directory hierarchy.

The find command is inherently recursive, and is intended to descend through directories looking for files with certain

attributes or executing commands.



10.3.2. Objective 2: Process Text Streams Using Filters



10.3.2.1. The Commands



The following programs modify or manipulate text from files and standard input:



cut [files]

Cut out selected columns or fields from one or more files.



expand files

Convert tabs to spaces in files.



This document was created by an unregistered ChmMagic, please go to http://www.bisenter.com to register it. Thanks

fmt [files]

Format text in files to a specified width by filling lines and removing newline characters.



head [files]

Print the first few lines of files.



join file1 file2

Print a line for each pair of input lines, one each from file1 and file2, that have identical join fields.



nl [files]

Number the lines of files, which are concatenated in the output.



od [files]

Dump files in octal, hexadecimal, ASCII, and other formats.



paste files

Paste together corresponding lines of one or more files into vertical columns.



pr [file]

Convert a text file into a paginated, columnar version, with headers and page fills.



split [infile] [outfile]

Split infile into a specified number of line groups; the output will go into a succession of files ofoutfileaa, outfileab, and so on.



tac [file]

Print file to standard output in reverse line order.



tail [files]

Print the last few lines of one or more files.



tr [string1 [string2]]

Translate characters by mapping from string1 to the corresponding character in string2.



Xem Thêm
Tải bản đầy đủ (.pdf) (1,207 trang)

×