Writing Device Drivers

Disk I/O Controls

Sun disk drivers need to support a minimum set of I/O controls specific to Sun disk drivers. These I/O controls are specified in the dkio(7) manual page. Disk I/O controls transfer disk information to or from the device driver. In the case where data is copied out of the driver to the user, ddi_copyout(9F) should be used to copy the information into the user's address space. When data is copied to the disk from the user, the ddi_copyin(9F) should be used to copy data into the kernels address space. Table G-1 lists the mandatory Sun disk I/O controls.

Table G-1 Mandatory Sun Disk I/O Controls

I/O Control 

Description 

DKIOCINFO

Returns information describing the disk controller. 

DKIOCGAPART

Returns a disk's partition map. 

DKIOCSAPART

Sets a disk's partition map. 

DKIOCGGEOM

Returns a disk's geometry. 

DKIOCSGEOM

Sets a disk's geometry. 

DKIOCGVTOC

Returns a disk's Volume Table of Contents. 

DKIOCSVTOC

Sets a disk's Volume Table of Contents.