Writing Device Drivers

Miscellaneous Entry Points


The dump(9E) entry point is used to copy a portion of virtual address space directly to the specified device in the case of a system failure. It is also used to copy the state of the kernel out to disk during a checkpoint operation (see cpr(7), dump(9E)). It must be capable of performing this operation without the use of interrupts, since they are disabled during the checkpoint operation.

int xxdump(dev_t dev, caddr_t addr, daddr_t blkno, int nblk)

dev is the device number of the device to dump to, addr is the base kernel virtual address at which to start the dump, blkno is the first block to dump to, and nblk is the number of blocks to dump. The dump depends upon the existing driver working properly. See for more information.


int xxprint(dev_t dev, char *str)

The print(9E) entry point is called by the system to display a message about an exception it has detected. print(9E) should call cmn_err(9F) to post the message to the console on behalf of the system. Here is an example:

static int
 xxprint(dev_t dev, char *str)
 	cmn_err(CE_CONT, "xx: %s\n", str);
 	return (0);