The device driver currently supports AIX
and Digital Unix. The overall
function is similar, but the organization and packaging is quite different.
The aix driver consists of two modules: devpairdd, which is the actual
pseudo driver, and mkdevpair, which is the command which creates and
removes pseudo device pairs.
Devpairdd
Devpairdd is the actual device driver for both /dev/udev and /dev/sdev.
Each device is supported by the usual entry points: udevread(),
udevwrite(), sdevread(),
sdevwrite(), etc. The build procedures are a little odd - consult the
makefiles. Useful references for aix device drivers are:
"Technical Reference, Volume 5: Kernel and Subsystems" SC23-2618-01
"Technical Reference, Volume 6: Kernel and Subsystems" SC23-2618-01
"Writing a Device Driver" SC23-2593-03
"Kernel Extensions and Device Support Programming Concepts" SC23-2611-01
These are available from IBM. The numbers may change depending on the release
level.
Mkdevpair
The 'correct' way to configure aix device drivers involves writing a lot
of code to correctly interface with the ODM. I didn't do that - instead
I wrote the mkdevpair command, which creates and removes the devices on the
fly. We just add appropriate mkdevpair commands to /etc/rc.local. As far
as I can tell, there is only one drawback to this method - there is no
convenient way for mkdevpair to determine acceptable major numbers to
use for the devices, so you have to specify the desired major numbers as
arguments to mkdevpair. You can do an 'ls -l /dev' to
determine which
major numbers are available. The normal numbers are usually assigned
counting up from 1, so I usually use numbers close to 255.
The syntax is:
mkdevpair -c udev maj1 num sdev maj2
mkdevpair -r udev num sdev
where:
- -c
- means create devices
- -r
- means remove devices
- udev
- is the name of the devices the user will use
- num
- is the number of subdevices (i.e. udevname='/dev/pmt' and
numdev=4 results in device special files /dev/pmt, /dev/pmt.1,
/dev/pmt.2, and /dev/pmt.4
- maj1
- is the major number for the udev device(s)
- udev
- is the name of the device that tclient will use
- maj2
- is the major number for the sdev device.
Examples:
- mkdevpair -c /dev/pmt 250 2 /dev/pmt.server 251
Make a set of devices (/dev/pmt and /dev/pmt.1 on the udev side and
/dev/pmt.server on the sdev side), using a major number of 250 for the
udev side and 251 for the sdev side.
- mkdevpair -r /dev/pmt 4 /dev/pmt.server
Remove devices /dev/pmt, /dev/pmt.1, /dev/pmt.2, /dev/pmt.3, and
/dev/pmt.server
The sdev and udev drivers are seperated into two source files - sdev.c
and udev.c. These modules contain the same entrypoints (udevread(),
sdevread(), ...) as the aix devpairdd.c file.
The build procedures are quite different - see the 'decosf/INSTALL' file.