mapdevice(D2DK) —
.IX \f4mapdevice\fP(D2DK)
NAME
mapdevice − map boot information into root dev_t
SYNOPSIS
#include <sys/types.h>
#include <sys/buf.h>
int prefixmapdevice(struct bootcmd ∗info, dev_t ∗dev);
ARGUMENTS
infoPointer to the bootcmd structure.
devPointer to a dev_t.
DESCRIPTION
The mapdevice routine is called indirectly (through cdevsw) by the kernel to convert the boot arguments into the dev_t for the boot device. This entry point is optional, but any device driver that may be responsible for the boot device must include it.
At boot time, the kernel offers the bootcmd structure returned by the boot block to each device driver that has a mapdevice entry point. The first device driver to accept the bootcmd information is assumed to have validly mapped the information into the dev_t for the boot device; searching is then discontinued and kernel initialization continues.
For disks, dev_t should represent the slice for the root disk as specified in the bootcmd structure. For tapes, dev_t should represent the no rewind device for a tape at the specified address.
RETURN VALUES
If the device driver is not the device responsible for the boot device or if the device driver is not configured to deal with the device specified by the bootcmd structure, a −1 is returned. Otherwise a zero is returned, and the dev_t corresponding to the bootcmd information is stored.
DDI/DKI