1. Trang chủ
  2. » Công Nghệ Thông Tin

Red Hat Linux Networking , System Administration (P24) pptx

30 378 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Red Hat Linux Networking, System Administration (P24)
Trường học Unknown University
Chuyên ngành System Administration, Linux Networking
Thể loại Lecture Notes
Năm xuất bản Unknown Year
Thành phố Unknown City
Định dạng
Số trang 30
Dung lượng 679,11 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

You cansafely disable the User level driver support unless you have a user space pro-gram that needs to interact with the input subsystem.Character Devices Use the Character devices sect

Trang 1

unless you are configuring a kernel for a kiosk system or cash register andneed touch screen support Finally, in the Misc subsection, you can configuresupport for a basic sound driver for the (awful-sounding) PC speaker You cansafely disable the User level driver support unless you have a user space pro-gram that needs to interact with the input subsystem.

Character Devices

Use the Character devices section to configure your kernel’s support for yoursystem’s character devices, which includes serial ports, printers, tape drives,special-purpose chips and devices such as watchdog cards and clock chips,and a broad but shallow selection of frame buffer cards You can also configuresuch devices that are provided by PCMCIA cards The array of supporteddevices is mind-numbingly long

If you have a special serial card, such as a multiport serial device, enableNon-standard serial port support and then select your device from the long list

of support hardware and configure it appropriately

If you need to use a serial port for Internet access (say, via a PPP dial-up nection) or you want to use your modem to send and receive facsimiles, makesure you enable 8250/16550 and compatible serial support It isn’t necessary toenable the Console on 8250/16550 and compatible serial support option unlessyou will be interacting with this system via serial connection (using minicom,Seyon, Kermit, or a similar terminal communications program) In the Extended8250/16550 serial driver options subsection, you might want to enable twooptions: Support for sharing serial interrupts and Autodetect IRQ on standardports The latter option is qualified as unsafe, but it is very rare these days forIRQ autodetection to hang a machine Of course, if you experience this problem,disable this option

con-The default value (disabled) for Legacy (BSD) PTY support should be cient If you intend to use a printer attached to this system, enable Parallelprinter support Support for special-purpose devices, such as the enhancedreal-time clock or the hardware random number generator, is optional Readthe help text if you want to experiment with these features

suffi-I2C Support

The primary reason to enable I2C (pronounced “eye-square-see”) support is touse system and motherboard hardware sensors (lm_sensors) and Video4Linuxdevices (discussed in the next section, “Multimedia Devices”) Hardware sen-sors use a subset of the I2C protocol known as SMBus, or System ManagementBus To activate your hardware sensors, you need to enable I2C support and

Trang 2

then select the specific hardware sensors your system has under the HardwareSensors Chip support submenu For more information about configuringhardware sensors, see Chapter 32.

Multimedia Devices

The Multimedia devices section contains the kernel configuration items forVideo For Linux, colloquially referred to as video4linux or v4l Video4Linuxcomprises support for audio and video capture cards, digital video cameras(Web cams), and radio tuner cards For more information about Video4Linux,see the project Web site at http://linux.bytesec.org/v4l2 You will alsofind configuration options for Digital Video Broadcasting (DVB) devices, whichgenerally refers to any digital television broadcast or reception add-in card orperipheral Strictly speaking, the DBV abbreviation refers to the DVB standardthat defines the encoding characteristics of broadcast digital video streams Formore information about DVB, see the Linux TV Web site at linuxtv.org

If you intend to use a Web cam, frame grabber, or radio tuner on yourFedora Core or RHEL system, enable the Video For Linux option and thenselect your adapter or device from the Video Adapters submenu or, for radiotuners, the Radio Adapters submenu For DVB support, you must enable thetop-level DVB For Linux option, DVB Core Support, and then select youradapter or device from one of the DVB submenus

Graphics Support

xconfig’s Graphics support section permits you to configure support for tain motherboard and graphics chipsets and various kernel features related tographics output, such as frame buffer support, the all-important boot logo,and limited support for LCD displays Frame buffers enable the kernel to pro-vide a generalized interface to a range of graphics hardware, allowing appli-cation software to manipulate the display without needing to know anythingabout the particular graphics device in use One of the benefits of Linux frame

cer-buffer support is that it provides that trés chic Linux boot logo displayed on

the screen in console (text) mode More importantly, Linux’s frame buffer port makes it possible to use the X Window system with graphics hardwarethat lacks X-specific drivers In fact, on some non-X86 architectures, the framebuffer device is the only way to use the graphics hardware

sup-If you wish to use the frame buffer, enable the Support for frame bufferdevices option and then select the specific graphics card you have For exam-ple, if you have a Cirrus Logic-based graphics adapter, enable the Cirrus Logicsupport option If your particular graphics adapter is not supported, enableVGA 16-color graphics support and the VESA VGA graphics support options

Trang 3

T I P If you have a Matrox-based graphics adapter, be sure to select the Enable Tile Blitting Support option because the Matrox frame buffer driver, known as

matroxfb, relies heavily on tile blitting for fast graphics performance.

For more attractive text mode displays, enable the VGA text console optionand also enable Framebuffer Console support Under this latter item, checkSelect compiled-in fonts and enable VGA 8x16 font to get clearer fonts whenyou work in text mode Finally, for that boot logo, select Logo configuration ➪Bootup logo ➪ Standard 224-color Linux logo

Sound

Use the Sound section to configure support for your sound card, if any.Because the kernel now supports an amazingly wide array of sound cards, itsimply is not possible to describe each option in this space Locate the device

or chipset for which you need support, enable it, and be sure to read andunderstand the help text and any supporting documentation to ensure thatyou can take full advantage of your sound card If the list of drivers and cardsunder Advanced Linux Sound Architecture (ALSA) does not include a driverfor your particular card, you might be able to use one of the Open Sound Sys-tem (OSS) modules to run your sound card If you need to use an OSS driver,

be sure disable the ALSA drivers or the OSS driver won’t work

USB Support

If you need support for Universal Serial Bus (USB), which almost anyoneusing a current X86-based PC does need, expand the USB support section andtry not to despair when you see the list of features and options To organize thediscussion, each of the major configuration sections is covered separately, soyou can go straight to the section that interests you

Support for Host-Side USB

To use your USB devices, you need to enable the Support for Host-side USB

option A USB host refers to the host controller, which you can picture as the

root of an inverted tree of USB devices It is the USB host, or rather, the USBhost port, that provides power to all attached devices Continuing the treeanalogy, if the USB host (or host port) is the root of the USB tree, attached USBdevices, such as scanners or printers, are the end points, nodes, or leaves of thetree Between the host and individual USB peripherals are special USB devicesknown as hubs, which might represent branches or branch points on the USBtree In addition to enabling your host USB port, you must select one the hostcontroller drivers, described in the next section You should also enable the

Trang 4

USB device file system option so that you can view the USB device tree in/proc/bus/usb/xxx/yyy (where xxx is the bus number and yyy thedevice ID).

USB Host Controller Drivers

Host controller drivers (abbreviated HCD) fall into three classes, OHCI or

UHCI for USB version 1.1 and EHCI for USB 2.0 OHCI stands for Open Host

Controller Interface This class of host controllers is more widely used on

non-X86 systems UHCI stands for Universal Host Controller Interface UHCI is

almost universally (no pun intended) used on chipsets made by Intel and VIA;most people will enable UHCI HCD (most Intel and VIA) support The thirdoption, EHCI, stands for Enhanced Host Controller Interface Whereas OHCIand UHCI support USB version 1.1, EHCI supports version 2.0 However, forbackward compatibility, EHCI usually includes either OHCI or UHCI support

So, if you select ECHI, you might also need to select OHCI or UHCI to supportUSB devices that do not speak the version 1.1 protocol

N OT E xconfig’s USB Device Class Drivers item is simply a heading under which the various classes of USB device drivers are arranged It is not configurable.

USB Audio Support

If you want to connect USB audio devices to your system and you are not using

the ALSA sound subsystem, enable USB Audio Support ALSA provides itsown USB audio driver, so you can disable this option if you use ALSA sound

If you have USB-attached MIDI devices, modems, or printers, enable the responding configuration options, USB MIDI support, USB Modem (CDCACM) support, or USB Printer support, respectively

cor-USB Mass Storage Support

Enable USB Mass Storage support and select the appropriate device driversupport if you want to use USB-connected devices such as CompactFlash orsmart card readers For CompactFlash, you will also need IDE support, asremarked on earlier in the chapter A potential “gotcha” in this section is thatUSB mass storage devices usually require SCSI disk support, so you mightneed to go back to the SCSI configuration section and enable SCSI device sup-port ➪ SCSI disk support One of the nice features of mass storage support isthat it plays nicely with the udev system: plug in a supported device and udevwill detect the hotplug event and automatically create the appropriate devicenode and file system entries so that you can access the storage

Trang 5

You should to be aware of one subtlety with USB mass storage support.When you enable mass storage support and select the corresponding device,support for that device is compiled into the mass storage module For instance,

if you want to support your Zio! compact flash reader, you would enable USBMass Storage support and enable Microtech/ZiO! CompactFlash/SmartMediasupport The resulting module, usb-storage, would contain general mass

storage support code and code to support the Zio! reader This is a departure

from normal practice, in which feature support and support for a specificdevice are provided by separate modules In terms of the example, normalpractice might manifest in general mass storage support residing in the usb-storagemodule and Zio!-specific support being provided by a modulenamed, say, zio

USB Human Interface Devices

The USB protocol has complete support for a broad range of so-called humaninterface devices (HID), which refers to any device you can use to provideinput, including mice, keyboards, graphics tablets, and joysticks If you want

to be able to interact with your computer using any tools in this class of USBdevices, enable USB Human Interface Device (full HID) support and thenselect HID Input layer support plus a driver for your particular device Notice,though, that USB HID and USB HIDBP (HID boot protocol) drivers don’t playnicely together If you intend to use (or must use) HIDBP support (USB HIDBoot Protocol drivers) for your keyboard or mouse, you cannot also use thefull HID driver As a rule, you should opt for full HID support and omit theHIDBP drivers Naturally, if your mouse or keyboard uses the PS/2 protocol,you don’t need USB HID or USB HIPBP support

USB Imaging Devices

At the moment, support for USB imaging devices is fairly limited in the kernelitself You can enable only a single digital camera (the Mustek MC800) and acouple of scanners, the Microtek X6USB and the HP53xx series of scanners.However, the Scanner Access Now Easy (SANE) project provides a muchdeeper level of support for all manner of scanners, including USB-attachedscanners, using the USB file system (usbfs), described shortly in the “File Sys-tems” section

USB Multimedia Devices

USB multimedia devices include a variety of Web cameras and the D-Link RMradio If you need support for one of the listed devices, enable the appropriatedriver

Trang 6

USB Network Adapters

USB network adapters are becoming increasingly common and popular.Accordingly, the kernel’s support for these adapters continues to grow If youhave one of the USB-based adapters listed under USB Network Adapters,enable support for it

USB Serial Converter Support

USB is a high-speed serial port protocol Thus, it should be no surprise thatxconfig’s USB Serial Converter support section includes several dozenoptions In most cases, to support any given device, you must enable the dri-ver for that particular device and the USB Generic Serial Driver option at thetop of the list For example, if you have a Palm PDA, you would enable the fol-lowing options:

■■ USB Serial Converter Support

■■ USB Generic Serial Driver

■■ USB Handspring Visor/Palm m50x/Sony Clie Driver

USB Miscellaneous Drivers

The miscellaneous drivers category is aptly named because it lists attached odds and ends that neither fit anywhere else nor (yet) have their ownconfiguration subsections Enable support for the device or devices you haveand intend to use

USB-USB Gadget Drivers

Although 99.999 percent of you won’t need this option, it bears mentioningbecause it shows how ubiquitous Linux has become So far, all USB devicesdiscussed have been attached to a system running Linux The USB GadgetDrivers section is for USB devices that are themselves running Linux Such

devices, known as USB gadgets, might or might not be connected to a host

sys-tem running Linux When the gadget is connected to a Linux syssys-tem, it tions as a peripheral and communication is via a USB peripheral controller,which is not the same as USB host controller The canonical example of a USBgadget device is a PDA that runs Linux (such as the Sharp Zaurus) In somecases, the USB gadget needs a controller to communicate with the host system

func-If you have such a gadget, enable the appropriate controller in the USB eral Controller section Of course, you might also need to enable the appropri-ate gadget

Trang 7

Periph-MMC/SD Card Support

MMC is the bus protocol for so-called multimedia cards If you have an MMC

or SD card (rather, MMC or SD card reader), enable the MMC support option

and then select the driver for the MMC interface you need to support Unlessyou are working on the kernel’s MMC support, though, disable the MMCdebugging option

InfiniBand Support

If you need InfiniBand support, enable it in this section InfiniBand is anotherentry into the already crowded field of marketing buzzwords for various high-speed bus and data interconnect protocols Here’s the definition from theInfiniBand trade association:

InfiniBand is an interconnect or I/O architecture that connects servers with remote storage and networking devices, and other servers It can also be used inside servers for inter-processor communication InfiniBand is a channel-based, switched fabric, point-to-point interconnect, which provides scalability and performance for a wide range of platforms and price performance points InfiniBand provides a scalable per- formance range of 500 MB/s to 6 GB/s per link, meeting the needs from entry level

to high-end enterprise system (storagesearch.com/glossary.html).

In short, InfiniBand is a supercalifragilisticexpialidocious data interconnect.For more information about InfiniBand, and to decipher the impenetrable net-work-speak in the preceding quote, visit the InfiniBand Trade Association onthe Web at infinibandta.org/home/

File Systems

The File systems configuration section enables you to configure support forthe file systems you expect to use or access from your system One of Linux’sgreatest strengths is the breadth of its support for non-native file systems,which makes it possible for Linux to interoperate with almost any other oper-ating system used on more than five computers

T I P Build support for the file system on which your / file system resides into the kernel Although this is not strictly necessary because you can use an initrd loaded at boot time, building the support into the kernel is simpler, less error prone, and marginally faster Static support for your root file system is simpler and less error prone because you don’t need to remember to create an initrd each time you build a new kernel It is faster because the kernel does not have

to uncompress the initrd and load the module at boot time.

Trang 8

At a minimum, enable support for ext2 and the ext3 journaling file tem If you wish, or need to, enable support for one of the other journaling filesystems currently available:

sys-■■ ReiserFS support— Provides support for the ReiserFS file system

■■ FS— Provides support for IBM’s Journaling File System

■■ XFS— Provides support for SGI’s high-performance Extended File System

Unless you know you need them, you can safely disable support for theMinix and ROM file systems If you intend to use file system quotas, enableQuota support and refer to Chapter 29, for information about using disk quotas If you want to use the kernel’s automounter support as described inChapter 12, enable Kernel automounter version 4 support (the automounterenables you want to mount and unmount file systems on the fly) As a generalrule, build non-Linux file system support as modules to minimize the size ofthe kernel

CD-ROM/DVD File Systems

You’ll need to enable support for CD-ROM and DVD file systems if you intend

to use a CD-ROM or DVD on your computer As a starting point, enable thefollowing options:

■■ ISO 9660 CD-ROM file system suppor— Enables kernel support forstandard CD-ROM file system

■■ Microsoft Joliet CDROM extensions— Enables the kernel to supportMicrosoft Windows’ long filename extensions for CD-ROMs in Unicodeformat

Some newer CD-ROMs and DVDs use the UDF file system If you expect touse such disks, enable the UDF file system support option

DOS/FAT/NT File Systems

For better or worse, most Linux users and system administrators need to vide access to various DOS or, more likely, Windows file systems To do so,enable all three options, as modules, under DOS/FAT/NT File systems You’ll

pro-be happy to know that incomplete but safe write support is available for NTFSfile systems

Trang 9

Pseudo-file-systems are so named because they are not true file systems with

a distinct file system structure laid down on a physical disk Rather, file-systems present a view into kernel data structures using a file systemmetaphor and standard system calls for file system operations, such as open-ing, closing, reading, and writing An increasing number of such pseudo-file-systems exist, as you can see under the Pseduo file systems section Youcan probably get by enabling only /proc file system support, which adds sup-port for the /proc file system /proc enables applications to utilize the procinterface to kernel tuning and device access

pseudo-Miscellaneous File Systems

The Miscellaneous file systems support section reveals the extent of Linux’ssupport for non-native file systems If you need to access disks or data thatresides on one of the listed file systems, enable support for that file system inthis section Again, to keep the size of your kernel as small as possible, enablesupport for foreign file systems as loadable modules

Network File Systems

As an operating system that was designed and built from the ground up in anetworked environment, Linux boasts rich support for networked file sys-tems, as you can see the Network File Systems section We recommend enablingsupport for NFS (Network File System) version 3, which has considerableimprovements and better kernel support for NFS than version 2 does, but isnot as unproven as NFS version 4 is So, enable Provide NFSv3 client supportand disable Provide NFSv4 client support under NFS file system support Sim-ilarly, enable Provide NFSv3 server support and disable Provide NFSv4 serversupport under the NFS server support subsection

If you want to use Samba to access Windows file systems, enable SMB filesystem support (to mount Windows shares, and so forth) Similarly, enableNCP file system support if you need to access Netware file systems, and thenselect the specific options for Netware file systems as fits your situation

Partition Types

In addition to support for foreign (non-Linux) file systems, you might find itadvantageous to configure the kernel to provide support for foreign disk par-tition types To do so, enable Advanced partition selection in the PartitionTypes section and then select the specific partition types you want to use

Trang 10

Native Language Support

The final subsection concerned with file systems is Native Language Support.Fedora Core and RHEL are configured to use the UTF8 character set encoding,

so you should at least enable that character set under Base native languagesupport You should try to select support for both the codepage you need andthe ISO NLS character set For example, if you need support for Greek, enablethe Codepage 869 (Greek) option and the NLS ISO 8859-7 (Modern Greek).American users should select the following:

■■ Codepage 437 (United States, Canada)

■■ ASCII (United States)

■■ NLS UTF8You can build support for other character sets as modules and loaded at runtime if you sometimes need support for languages and character sets otherthan the default

Profiling Support

Profiling support, if enabled, activates the kernel’s support for the hardwareperformance counters built into modern CPUs and chipsets By itself, thisoption does nothing unless you also enable Oprofile system profiling (EXPERI-

MENTAL) as a module in order to create data that you later turn into

informa-tion You should not build OProfile into the kernel; there is little need outside

of academic research for a kernel with a static profiler

What is OProfile? OProfile is a systemwide profiler that gathers mance metrics on all running code at low overhead All code is profiled: hard-ware and software interrupt handlers, kernel modules, the kernel, sharedlibraries, and applications OProfile consists of a kernel driver, a daemon thatcollects data samples, and a collection of tools to turn raw OProfile data intomore useful information It works by using the hardware performance regis-ters built into modern CPUs Although OProfile is currently considered to be

perfor-in alpha status, it has been used successfully and reliably perfor-in a wide array ofhardware and computing environments

Depending on your needs, you can use OProfile to produce performancedata at the function level or down to the individual CPU instruction You canuse OProfile data to annotate source code with profile information You can

also use OProfile to identify the top N applications or functions that take the

most time across the whole system

Trang 11

Clearly, this is not the sort of tool you would use on a daily basis But if youare trying to squeeze the last possible CPU cycle out of an application, OPro-file is a terrific tool to have Build it as a module and then forget about it untilyou need it You’ll be glad you did Refer to Chapter 32, for a quick-and-dirtyOProfile usage primer.

Kernel Hacking

The collection of features in the Kernel hacking section are not meant for tal users Our recommendation is to disable all kernel-hacking features unlessyou are specifically asked to enable them These options and features makedebugging the kernel easier and provide information that kernel developerscan interpret or understand, but they have little value to anyone else In fact,some of the kernel-hacking options actively attempt to break the kernel code,which might result in a crashed or otherwise unstable system

mor-Security Options

The Security options section is another section best left alone unless you fullyunderstand the consequences and usage of the security feature or tool in ques-tion Accordingly, the kernel features in this section will be discussed in moredetail in Chapter 33 and briefly in Chapter 34 If you enabled SELinux supportwhen you installed Fedora Core or RHEL, enable support for SElinux byenabling the following options:

■■ Enable different security modules

■■ Socket and Networking Security Hooks

■■ NSA SELinux Support Under this option, you should also enable:

■■ NSA SELinux boot parameter

■■ NSA SELinux runtime disable

■■ NSA SELinux AVC StatisticsRefer to Chapter 33 for more information about SELinux

Cryptography Options

The Cryptographic options section enables you to select which of a multitude

of cryptographic APIs (ciphers) that you want to support in the kernel The son to include the cipher algorithms in the kernel is that kernel mode code exe-cutes faster and is more secure than code that executes in user mode Kernelmode code is faster because it is highly optimized and less prone to interrup-tion or preemption by other code It is more secure because access to kernel data

rea-is restricted to kernel code

Trang 12

As you can see in Figure 27-10, there are quite a few cipher choices fromwhich to choose Most are compiled as loadable modules, but the SHA1 digest(SHA1 digest algorithm) is compiled statically into the kernel.

By making most of the cryptography APIs available as modules, programsthat need a particular cipher can load the support and access without having

to bulk up the kernel with code and data that is only rarely needed How muchbulk? In the standard Fedora Core and RHEL kernels, the total code and datataken up by the loadable cryptography modules is 193,005 bytes

If you have cryptographic hardware, then you will likely want to enablekernel support for it, if possible, in the Hardware crypto devices section If you

do have cryptographic acceleration hardware, you know who you are (and

They know who you are, too!) Otherwise, proceed to the Library routines

sec-tion of xconfig

Library Routines

The configuration section for Library routines is a common source of sion The three options in this section exist for the purpose of supporting ker-nel modules built outside of the kernel tree that require cyclical redundancycheck (CRC) support routines The phrase “kernel modules built outside of thekernel tree” refers to device drivers and other loadable kernel modules pro-vided by third parties, such as peripheral manufacturers, that are not part ofthe official kernel source code tree A CRC is a method of performing errorchecking and data validation Ordinarily, device drivers in the official kernelthat need CRC routines implement them themselves or use one provided inthe kernel sources However, some third-party loadable kernel modules do notimplement their own CRC support and must rely on the kernel’s CRC func-tions Therefore, the configuration options in this section implement the nec-essary support as modules so that third-party drivers can access them Youwill not usually need to enable these options, but if want to load a third-partymodule that indicates your kernel needs in-kernel CRC support, this is the sec-tion you’ll need to use

confu-Saving the Kernel Configuration

After you have worked your way through all of the configuration options,click the Save button on the toolbar or select File ➪ Save to save your configu-ration choices to the file config in the kernel source directory Then select

File ➪ Exit to close xconfig and, at great length complete the configuration

process You can also just select File ➪ Exit without specifically saving yourchanges because xconfig will prompt you to save any unsaved changes (SeeFigure 27-11.)

Trang 13

Figure 27-10 Viewing the available kernel cryptography APIs in xconfig.

Figure 27-11 xconfig’s Save dialog box.

The good news is that future configuration sessions will proceed muchmore quickly because you only need to perform a complete configurationonce Subsequent sessions are usually a matter of changing only one or twooptions and then rebuilding the kernel

Compiling the Kernel

To build the kernel and any loadable module you want, type make in the

top-level kernel directory and take a coffee break On an AMD Athlon Thunderbird

1200 with 512 MB of RAM, the compilation process took just over 50 minutes.Your mileage may vary

$ make

OBJCOPY arch/i386/boot/vmlinux.bin HOSTCC arch/i386/boot/tools/build BUILD arch/i386/boot/bzImage

Trang 14

Boot sector 512 bytes.

Setup is 5487 bytes.

System is 11237 kB Kernel: arch/i386/boot/bzImage is ready

The new kernel build system (known as kbuild, oddly enough) combinesthe make bzImage and make modules steps familiar to from earlier kernelversion into a single step in the 2.6 build system You will also like notice thatthe output of the build process is much neater and easier to read in the newsystem because kbuild disables the hard-to-read verbose output with a sin-gle line showing each step in the build process (as illustrated in the last fewlines of output in the previous code) If everything has proceeded as designed,you should have a compressed kernel image, arch/i386/boot/bzImage,and a set of modules (if you built a modular kernel) that are ready to install

WHAT’S THIS KERNEL SIZE BUSINESS, ANYWAY?

This chapter repeatedly comments that removing unneeded drivers from the kernel and compiling drivers as modules will make it smaller or that, conversely, adding drivers increases the kernel’s size What exactly does this mean and why precisely should you care?

Each block of code, each driver, that goes into the kernel increases the size

of the compiled kernel in terms of disk footprint and in terms of the amount of memory it takes when it’s running It is the kernel’s runtime memory footprint that matters most Even though modern computers can have multiple gigabytes

of RAM, the amount the kernel consumes should be kept as small as possible

to maximize the RAM resources available to other programs and to keep the kernel itself as efficient as possible Moreover, from a purely mechanical standpoint, the smaller your kernel, that is, the fewer device drivers you configure, whether statically compiled or built as modules, the less time it takes to build and rebuild the kernel.

You don’t have to accept this at face value, however You can judge for yourself by using the size command size shows the size in bytes of each section in a binary or object file The text section contains executable code;

the data section contains static data declared in the program; the bss section contains uninitialized global data The dec field shows the total file size in decimal bytes and the hex field shows the total file size in hexadecimal bytes.

This is more than a merely academic issue Veteran Linux users remember when a full-featured kernel image could be created on a 3.5” floppy disk using the make target make floppy The kernel has become so large that it won’t fit

on floppy anymore In addition, the target used to create compressed kernel images, make bzImage, used to be make zImage The compression algorithm had to be changed because the old algorithm couldn’t compress the image efficiently enough.

(continued)

Trang 15

WHAT’S THIS KERNEL SIZE BUSINESS, ANYWAY? (continued)

Consider the following The first command uses size on a “typical” kernel (2.6.7.10 built from the Red Hat kernel SRPM):

Next, size’s output for the default configuration created by the make

of the necessary functionality.

Ngày đăng: 07/07/2014, 09:20

TỪ KHÓA LIÊN QUAN