DKIO(4S) — SPECIAL FILES
NAME
dkio − generic disk control operations
DESCRIPTION
All Sun disk drivers support a set of ioctl’s for disk formatting and labelling operations. Basic to these ioctl’s are the definitions in <sun/dkio.h>:
/∗
∗ Structures and definitions for disk io control commands
∗/
/∗ Disk identification ∗/
struct dk_info {
intdki_ctlr;/∗ controller address ∗/
shortdki_unit;/∗ unit (slave) address ∗/
shortdki_ctype;/∗ controller type ∗/
shortdki_flags;/∗ flags ∗/
};
/∗ controller types ∗/
#defineDKC_UNKNOWN0
#defineDKC_SMD21801
#defineDKC_DSD52155
#defineDKC_XY4506
#defineDKC_ACB40007
#define DKC_MD218
/∗ flags ∗/
#defineDKI_BAD1440x01/∗ use DEC std 144 bad sector fwding ∗/
#defineDKI_MAPTRK0x02/∗ controller does track mapping ∗/
#defineDKI_FMTTRK0x04/∗ formats only full track at a time ∗/
#defineDKI_FMTVOL0x08/∗ formats only full volume at a time ∗/
/∗ Definition of a disk’s geometry ∗/
struct dk_geom {
unsigned shortdkg_ncyl;/∗ # of data cylinders ∗/
unsigned shortdkg_acyl;/∗ # of alternate cylinders ∗/
unsigned shortdkg_bcyl;/∗ cyl offset (for fixed head area) ∗/
unsigned shortdkg_nhead;/∗ # of heads ∗/
unsigned shortdkg_bhead;/∗ head offset (for Larks, etc.) ∗/
unsigned shortdkg_nsect;/∗ # of sectors per track ∗/
unsigned shortdkg_intrlv;/∗ interleave factor ∗/
unsigned shortdkg_gap1;/∗ gap 1 size ∗/
unsigned shortdkg_gap2;/∗ gap 2 size ∗/
unsigned shortdkg_apc;/∗ alternates per cyl (SCSI only) ∗/
unsigned shortdkg_extra[9];/∗ for compatible expansion ∗/
};
/∗ disk io control commands ∗/
#defineDKIOCGGEOM_IOR(d, 2, struct dk_geom)/∗ Get geometry ∗/
#defineDKIOCSGEOM_IOW(d, 3, struct dk_geom)/∗ Set geometry ∗/
#defineDKIOCGPART_IOR(d, 4, struct dk_map)/∗ Get partition info ∗/
#defineDKIOCSPART_IOW(d, 5, struct dk_map)/∗ Set partition info ∗/
#defineDKIOCINFO_IOR(d, 8, struct dk_info)/∗ Get info ∗/
The DKIOCGINFO ioctl returns a dk_info structure which tells the kind of the controller and attributes about how bad-block processing is done on the controller. The DKIOCGPART and DKIOCSPART get and set the controller’s current notion of the partition table for the disk (without changing the partition table on the disk itself), while the DKIOCGGEOM and DKIOCSGEOM ioctl’s do similar things for the per-drive geometry information.
SEE ALSO
Sun Release 3.2 — Last change: 25 July 1986