Next | Prev | Up | Top | Contents | Index

Configuring a Kernel-level SCSI Driver

Chapter 2, "Writing a Device Driver," gives a detailed description of how to configure a kernel to include a new driver. This section presents only the material that is unique to SCSI drivers. Recall that you must:

  1. Create the object code for the driver you want to include in the kernel.

  2. Move that object code to the directory /usr/sysgen/boot.

  3. Edit the system file. Use a directive telling lboot, the configuration utility, how to include your driver and specify which memory space your device will allocate. Install it in the /var/sysgen/system directory using the driver name appended by .sm.

  4. Create a master file in the directory /usr/sysgen/master.d.

  5. Create a new kernel. (To create a debuggable kernel, see "Making a Debuggable Kernel" in Chapter 10, "Driver Installation and Testing.")
To edit the system file (/usr/sysgen/system) to include a SCSI driver, use the INCLUDE directive to tell lboot to unconditionally add the named SCSI module into the new kernel.

To create a master file, create an ASCII file, enter the appropriate information (described below), and move the file to the /usr/sysgen/master.d directory. The name of the master file must correspond to the name of the file containing the object code for the driver.

Ensure that the FLAG field of the master file includes at least the character device flag c and the software driver flag s. You must flag all SCSI device drivers as software drivers (drivers that do not control actual hardware) because lboot cannot probe for SCSI devices.[12] If lboot tries to probe for a SCSI device, it fails, then assumes that the device is not present, and does not include your SCSI device driver in the kernel.

For example, assume that you want your kernel to include a device driver for a SCSI device that you call sdk. Create the object code for the device driver, and move the sdk.o object file to the directory /usr/sysgen/boot. After examining /usr/include/sys/major.h, you determine that major device number 61 is available and can be used for the device, sdk. Create a file sdk.sm with the following line, and also add it to the system file:

INCLUDE: sdk

You then create a master ASCII file called /usr/sysgen/master.d/sdk and enter:

*
* sdk
*
*FLAG   PREFIX   SOFT   #DEV   DEPENDENCIES
 sc     sdk_     61       -     scsi
Under "DEPENDENCIES," you must list "scsi." This indicates that the SCSI interface driver must be present. The SCSI interface is described later in this chapter.


[12] Although lboot does probe for the SCSI controller, the target devices that the SCSI controller manages cannot be probed by a memory reference/access.
Next | Prev | Up | Top | Contents | Index