Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [140]

By Root 2768 0
and cement your reputation for clairvoyance.

• Messages about disks that have filled up should be flagged and acted on immediately. Full disks often bring all useful work to a standstill.

• Messages that are repeated many times deserve attention, if only in the name of hygiene.

1. Beware: Solaris and HP-UX also have a killall command, but it does something completely different. Use pkill on Solaris to get a killall-like effect.

2. This embryonic newsyslog script is different from (and inferior to) the FreeBSD newsyslog utility.

3. Very old versions of syslog use a different syntax that we will not describe here.

4. More accurately, it uses “netloghost” as one of its hostname aliases. This allows the identity of the log host to be modified with little reconfiguration. An alias can be added in /etc/hosts or set up with a CNAME record in DNS. See page 445 for more information about DNS CNAME records.

5. On machines that preprocess the syslog.conf file with m4, you can even integrate these two configurations into a single file.

12 Drivers and the Kernel

A UNIX system encompasses essentially three layers of abstraction:

• The hardware

• The operating system kernel

• The user-level programs

The kernel hides the system’s hardware underneath an abstract, high-level programming interface. It is responsible for implementing many of the facilities that users and user-level programs take for granted. For example, the kernel assembles all of the following UNIX concepts from lower-level hardware features:

• Processes (time sharing, protected address spaces)

• Signals and semaphores

• Virtual memory (swapping, paging, mapping)

• The filesystem (files, directories, namespace)

• Interprocess communication (pipes and network connections)

The kernel contains device drivers that manage its interaction with specific pieces of hardware; the rest of the kernel is, to a large degree, device independent. The relationship between the kernel and its device drivers is similar to the relationship between user-level processes and the kernel. When a process asks the kernel to “Read the first 64 bytes of /etc/passwd,” the kernel might translate this request into a device driver instruction such as “Fetch block 3,348 from device 3.” The driver would further break this command down into sequences of bit patterns to be presented to the device’s control registers.

The kernel is written mostly in C, with a little assembly language for low-level processing. Many years ago, a compiled UNIX kernel was quite modest in size, usually well under half a megabyte. Today, with fancy networking, network file systems, multithreading, and inexpensive memory, kernel sizes range from 400K to over 15MB.

12.1 KERNEL TYPES


All systems allow you to provide the kernel with explicit information about the hardware it should expect to find on your system (or pretend not to find, as the case may be). Some kernels can also prospect for devices on their own.

Solaris uses an almost completely modular kernel, and it can load device drivers as they are needed. You do not need to tell Solaris ahead of time what hardware is on the system, thanks largely to Sun’s well-defined (compared with a PC), proprietary hardware architecture. When Solaris finds a new device connected to the system, it looks for and loads a corresponding driver module. Surprisingly, this scheme actually works fairly well most of the time.

Like Solaris, HP-UX supports a relatively small and well-defined hardware base. It can usually determine what’s on your system without much hand-holding from you.

In general, FreeBSD and other BSD-derived systems must be told explicitly at kernel compilation time what devices might be found on the system. In some cases, you must also specify exactly where on the system you expect the kernel to find the devices. This requirement is often troublesome if you aren’t sure exactly what hardware your system contains. PC manufacturers usually don’t give you much technical information, so you must often take your

Return Main Page Previous Page Next Page

®Online Book Reader