Kernel Configuration Part XI
- 0
- Add a Comment
- No Related Post
b>Kernel Configuration - Part XI
We’ve covered some fairly light topics to this point in the kernel configuration
series. Today’s topic requires a bit of review. We’ll discuss configuring block
devices in your kernel.
We’ve talked about the different types of devices in previous Penguin Shell
issues. Fundamentally, the two that you’ll deal with the most are block and
character devices. These draw their type names from the way they handle data.
Block devices receive data for storage in chunks, generally pre-set sizes of
data “blocks.” Hard drives are block devices. They’ll only write chunks of data
to storage. Thus, the problem with shutting down your machine uncleanly. Data
intended for storage may not, in fact, have been written at the time your power
dies or you hard kill your machine. The system may still be accumulating data up
to the proper block size before committing it to the hard drive.
Character devices, on the other hand, receive data in “streams,” one character
at a time. Serial ports are a great example of character devices. They handle
data input and output on the fly, rather than filling a buffer then
committing the data.
The physical nature of these device types goes a long way toward explaining why
they handle data as they do. A hard drive has to physically spin up to store or
retrieve data. You’re actually changing the magnetic properties of the disc
surface when you store data. Consequently, a hard drive has to know where
there’s free space on the disc surface, has to move that area of the disc under
the write head and try, as best it can, to group blocks of related data
together.
Character devices really don’t store data as much as they send it off and forget
about it. The process is purely electrical rather than electrical and physical.
The serial port, for example, sends data in a stream to your Palm Pilot. The
storage of the data is actually handled by the Palm itself, not a physical
storage device on the computer. There’s no need to spin up a drive and account
for the data as is necessary with a hard drive. The Palm will also send a signal
back to the computer confirming receipt of data. That’s an indication that
character devices often communicate in both directions, as well.
So, when you’re configuring block devices in your kernel, you’re preparing the
system for communicating with a device that will buffer data to a predetermined
level, then write that data as a block, changing the physical properties of the
hard drive disc surface. Even though that’s the highest level view of the
process, it still shows how difficult a process physical data storage really
is.
In the block device section, you’ll find many options for physical data storage.
When configuring this section, it’s crucial to know as much about your existing
hardware as possible. What type (brand) of hard drives are you using? What’s the
interface to the machine - IDE, parallel, etc? Where is the drive located - on
the local machine or on a network-connected box? Because the variables are so
broad, it’s nearly impossible to give you a stock configuration tip that will
work for your personal machine every time. I can tell you this - you will have
block devices (normally a hard drive and a floppy), and you need to answer as
many of the above questions as you can. Find out as much about these physical
devices as you can, and the configuration process will be relatively
painless.
A warning - you’ll see more configuration tips like this as the series continues
to progress. I’ll certainly make hands-on configuration recommendations where
possible. There are quite a few areas where I can make such recommendations.
However, where the variable set is as broad as block devices, much of the
legwork will be up to you.
Tomorrow, we’ll talk about RAID and multi-device support in Linux.
