-->
Previous | Table of Contents | Next |
The kernels used in Slackware are designed to support the hardware needed to get Linux installed. Once youve installed and rebooted your system, you may find that your kernel lacks support for some of your hardware, such as a CD-ROM drive or Ethernet card. In this case, there are a couple of ways you can add this support. The traditional way would be to compile a custom Linux kernel that includes drivers for all your hardware. This requires that you have the Linux source code and C compiler installed and that you know exactly which options need to be compiled into your kernel. In short, compiling a custom kernel can be a rather difficult task for Linux beginners.
Kernel modules to the rescue! If youve installed device drivers before on MS-DOS, youll probably find this a familiar way of adding supportjust think of the module configuration file /etc/rc.d/rc. modules as being the Linux counterpart of DOSs CONFIG.SYS file. To add support for new hardware, you need to edit the file and uncomment the lines that load the needed support. As an example, lets look at the section of the file used to load CD-ROM support, as shown in Figure 2.5.
# These modules add CD-ROM drive support. Most of these drivers will probe # for the I/O address and IRQ of the drive automatically if the parameters # to configure them are omitted. Typically the I/O address will be specified # in hexadecimal, e.g.: cm206=0x300,11 # #/sbin/modprobe aztcd aztcd=<I/O address> #/sbin/modprobe cdu31a cdu31a_port=<I/O address> cdu31a_irq=<interrupt> #/sbin/modprobe cm206 cm206=<I/O address>,<IRQ> #/sbin/modprobe gscd gscd=<I/O address> #/sbin/modprobe mcd mcd=<I/O address>,<IRQ> #/sbin/modprobe mcdx mcdx=<I/O address>,<IRQ> #/sbin/modprobe optcd optcd=<I/O address> # Below, this last number is "1" for SoundBlaster Pro card, or "0" for a clone. #/sbin/modprobe sbpcd sbpcd=<I/O address>,1 #/sbin/modprobe sonycd535 sonycd535=<I/O address> #/sbin/modprobe sjcd sjcd=<I/O address>
Figure 2.5 A section of the /etc/rc.d/rc.modules file.
Youll notice that each of the lines starts with #. In most Linux configuration files, any line beginning with # is ignored, much like lines in DOS configuration files that begin with REM. To activate support for one of these devices, youll need to remove the # from the beginning of the line and edit the line to include any extra information about your hardware needed by the kernel module. For example, if your machine needs support for a SoundBlaster CD-ROM drive on port 0x300, youd need to edit the line for sbpcd support so that it looks like this:
/sbin/modprobe sbpcd sbpcd=0x300,1
Then, the next time you boot your machine, the sbpcd module will be loaded, and youll be able to use your drive. Drivers for nearly every device supported by Linux can be added in a similar fashion.
NOTE: If you use kernel modules and decide later to upgrade your kernel, youll need to upgrade your kernel modules as well. When configuring the kernel, select M instead of Y to build selected drivers as kernel modules instead of building them into the kernel. Once youve compiled your kernel with:make dep ; make clean ; make zImageyou can compile and install the kernel modules with the command:
make modules ; make modules_installThe modules will be installed in a directory named for the running kernelif youre running Linux 2.0.0, youll find them under /lib/modules/2.0.0.
Most UNIX systems have an online-manual page system, and Linux is no exception. You can use the man command to summon information about specific commands:
darkstar:~# man man
Online-manual pages arent organized by topic; theyre organized by specific command.
NOTE: There are other informational sources included with the Linux operating system. Theyll be discussed in Chapter 5.
Like any good UNIX, Linux responds to the shutdown command. Youll need to provide it with a command-like parameter and an amount of time to wait before actually shutting the system down. This may seem odd if youre used to working alone on a PC, but the shutdown command is usually saved for serious shutdowns, as most UNIX installations support many users and rarely shutdown. In fact, you must be logged in as root in order to use the shutdown command. Use the following command line:
$ shutdown -r now
This shuts down the system immediately.
WARNING: Dont just turn off the power to turn off a Linux system. This can cause damage to important files.
An alternative method of shutting down Linux is the old tried-and-true PC Ctrl-Alt-Del sequence, which is used to reboot a system. When running Linux, this sequence performs the same functions as shutdown -r now. When the PC cycles to reboot, simply turn it off. Despite what others may claim, this is a perfectly acceptable way to shutdown a Linux system.
Previous | Table of Contents | Next |