Online Book Reader

Home Category

UNIX System Administration Handbook - Evi Nemeth [158]

By Root 2932 0
They take the following forms

pre-install module command ...

install module command ...

post-install module command ...

pre-remove module command ...

remove module command...

post-remove module command ...

and are run before insertion, simultaneously with insertion (if possible), after insertion, before removal, during removal (if possible), and after removal.

But wait, there’s more! Loadable kernel modules can also be loaded and unloaded dynamically with the kerneld daemon. When kerneld is running, modules are automatically loaded when the devices they serve are referenced. kerneld gets its information from /etc/modules.conf, just as modprobe does; it uses the alias statements to determine which module goes with a given device.

For example, if someone tries to access a serial port and no serial driver has been loaded, kerneld examines the modules.conf file to see which module is associated with character major device number 4. kerneld does all the same fancy tricks as modprobe; it’s just designed to be used as a daemon.

Loadable kernel modules in FreeBSD


FreeBSD’s module support is new compared to that of Solaris and Linux. Current versions of FreeBSD cannot insert a device driver into the running kernel, but they can add functionality on the fly. Actually, FreeBSD’s module support is only slightly better than opening up /dev/kmem and dumping in some code. Perhaps for this reason, loadable module support is disabled in the GENERIC kernel.

The FreeBSD modload, modstat, and modunload commands manipulate kernel modules. You will no doubt be shocked to discover that these commands load a module, display module status, and unload a module, respectively. Each utility performs ioctls on /dev/lkm.

By default, FreeBSD’s kernel modules live in /modules. If something can be added as a kernel module, it will be found there. Any of the modules listed in /modules can be inserted using the aforementioned utilities.

1. curses is a library used to create text-based GUIs that run in a terminal window.

2. The primary device files in Solaris are kept in /devices, but links to /dev are maintained automatically.

RECOMMENDED READING


MCKUSICK, MARSHALL KIRK, ET AL. The Design and Implementation of the 4.4BSD Operating System. Reading, MA: Addison-Wesley. 1996.

This book is a good reference for detailed information about the configuration and internals of the BSD kernel. There is a new version in development that will be based on FreeBSD instead of 4.4BSD.

BECK, MICHAEL, ET AL. Linux Kernel Internals, Second Edition. Reading, MA: Addison-Wesley. 1998.

A few new books on the internals of the Linux kernel are available, but we still like this older one. It’s a bit outdated, but it gives a very good explanation of the kernel’s inner workings.

SECTION TWO

NETWORKING

13 TCP/IP Networking

It would be hard to overstate the importance of networks to modern computing, although that doesn’t seem to stop people from trying. At many sites, web and email access are now the main activities for which computers are used. As of early 2000, the Internet is estimated to have 300 million users, and it still seems to be growing exponentially. Maintenance of local networks, Internet connections, web sites, and network-related software is a bread-and-butter portion of most sysadmins’ jobs.

TCP/IP is the networking protocol suite most commonly used with UNIX, MacOS, Windows, Windows NT, and most other operating systems. It is also the native language of the Internet. IP stands for Internet Protocol and TCP for Transmission Control Protocol.

TCP/IP defines a uniform programming interface to different types of network hardware, guaranteeing that systems can exchange data (“interoperate”) despite their many differences. IP, the suite’s underlying delivery protocol, is the workhorse of the Internet. TCP and UDP (the User Datagram Protocol) are transport protocols that are built on top of IP to deliver packets to specific applications.

TCP is a connection-oriented protocol that facilitates a conversation between two

Return Main Page Previous Page Next Page

®Online Book Reader