Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ dkio(4S) — SunOS 4.0.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ip(4P)

sd(4S)

xy(4S)

dkctl(8)

DKIO(4S)  —  DEVICES AND NETWORK INTERFACES

NAME

dkio − generic disk control operations

DESCRIPTION

All Sun disk drivers support a set of ioctl’s for disk formatting and labeling 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
#define DKC_CSS12
#define DKC_NEC76513/∗ floppy on Sun386i ∗/
/∗ 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 ∗/
#defineDKIOCWCHK_IOWR(d, 115, int)/∗ Toggle write check ∗/

The DKIOCINFO ioctl returns a dk_info structure which tells the type 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.  The DKIOCWCHK enables or disables a disk’s write check capabilities. 

SEE ALSO

ip(4P), sd(4S), xy(4S), dkctl(8)

Sun Release 4.0  —  Last change: 25 March 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026