The IOCC_GEOMETRY CommandCode consists of all the CommandModifiers responsible for setting and returning information about the capacity of a unit.
The CommandModifiers are described in the following table:
┌──────────────────────────────┬──────────────────────────────┐ │CommandModifier │Description │ ├──────────────────────────────┼──────────────────────────────┤ │IOCM_GET_MEDIA_GEOMETRY │Returns the geometry of the │ │ │current media in a drive. │ │ │For non-removable media │ │ │devices, the geometry returned│ │ │must be identical to the │ │ │geometry returned by │ │ │IOCM_GET_DEVICE_GEOMETRY. │ ├──────────────────────────────┼──────────────────────────────┤ │IOCM_SET_MEDIA_GEOMETRY │Informs the adapter device │ │ │driver of the required media │ │ │geometry in preparation for │ │ │formatting. This command is │ │ │mandatory only for standard │ │ │diskette media. │ ├──────────────────────────────┼──────────────────────────────┤ │IOCM_GET_DEVICE_GEOMETRY │Returns the device geometry │ │ │compatible with INT 13h BIOS │ │ │function 08h. │ │ │If the INT 13h support for a │ │ │device provides translation, │ │ │the INT 13h geometry of the │ │ │device must be returned with │ │ │the BIOS translation performed│ │ │within the driver. That is, │ │ │the driver must emulate any │ │ │INT 13h translation performed │ │ │by BIOS. │ ├──────────────────────────────┼──────────────────────────────┤ │IOCM_SET_LOGICAL_GEOMETRY │Indicates that the geometry │ │ │recorded in the file system │ │ │tables on the media does not │ │ │match the physical media │ │ │geometry reported by the │ │ │device driver. │ │ │The driver should convert RBA │ │ │to CHS addresses according to │ │ │the geometry passed in this │ │ │IORB, rather than using the │ │ │media geometry the driver is │ │ │reporting. The device driver │ │ │should stop performing this │ │ │translation if a media change │ │ │indication is detected. │ │ │Support of this command is │ │ │mandatory only for standard │ │ │diskette media. │ └──────────────────────────────┴──────────────────────────────┘
Remarks
Support:
Format of IORB
IOCC_GEOMETRY Description
This section defines the IORB_GEOMETRY and GEOMETRY control blocks. (See the table below.)
┌─────────────────┬─────────────────┬─────────┬─────────────────┐│Field Name │C Type │Length │Description │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │iorbh │IORBH │DB(68) │IORB header │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │pGeometry │PGEOMETRY │DD │Pointer to │ │ │ │ │GEOMETRY │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │GeometryLen │USHORT │DW │Length of │ │ │ │ │GEOMETRY data │ └─────────────────┴─────────────────┴─────────┴─────────────────┘
On entry to the driver:
iorbh
See IORB General Format.
pGeometry
contains a far pointer to the block of storage (length = GeometryLen)
allocated by the caller for the GEOMETRY.
GeometryLen
contains the size of the block of storage, in bytes, for the GEOMETRY structure
(pGeometry).
GEOMETRY Description
┌─────────────────┬─────────────────┬─────────┬─────────────────┐ │Field Name │C Type │Length │Description │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │TotalSectors │ULONG │DD │Number of sectors│ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │BytesPerSector │USHORT │DW │Bytes per sector │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │Reserved │USHORT │DW │Reserved │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │NumHeads │USHORT │DW │Number of heads │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │TotalCylinders │ULONG │DD │Number of │ │ │ │ │cylinders │ ├─────────────────┼─────────────────┼─────────┼─────────────────┤ │SectorsPerTrack │USHORT │DW │Number of sectors│ │ │ │ │per track │ └─────────────────┴─────────────────┴─────────┴─────────────────┘
On entry to the driver for SET CommandModifiers, and on exit from the driver for GET CommandModifiers, the following apply:
TotalSectors
contains the total number of sectors.
BytesPerSector
contains the number of bytes per sector. The IBM OS/2 2.0 File System supports
only a value of 512.
Reserved
contains a 0. This alignment field ensures that the GEOMETRY structure
aligns with SCSI Read Capacity output.
NumHeads
contains the number of heads.
TotalCylinders
contains the number of cylinders.
SectorsPerTrack
contains the number of sectors per track.
Note: SCSI devices normally do not support cylinder/head/sector (CHS) addressing. However, to maintain INT 13h BIOS compatibility, most controllers create CHS mapping for the devices they support. For non-boot devices, which do not provide INT 13h support, NumHeads, TotalCylinders, and SectorsPerTrack can be set to 0, and the device manager will select appropriate CHS values.
On exit, the driver sets the Status and ErrorCode fields of the IORBH to reflect the results of the IOCC_GEOMETRY request.
Return Codes
Following is a list of the IOCC_GEOMETRY error codes:
IOERR_CMD_NOT_SUPPORTED
IOERR_CMD_SYNTAX
IOERR_CMD_SW_RESOURCE
IOERR_UNIT_NOT_ALLOCATED
IOERR_UNIT_NOT_READY
IOERR_UNIT_PWR_OFF
IOERR_MEDIA_NOT_FORMATTED
IOERR_MEDIA_NOT_SUPPORTED
IOERR_MEDIA_CHANGED
IOERR_MEDIA_NOT_PRESENT
IOERR_ADAPTER_HOSTBUSCHECK
IOERR_ADAPTER_DEVICEBUSCHECK
IOERR_ADAPTER_OVERRUN
IOERR_ADAPTER_UNDERRUN
IOERR_ADAPTER_DIAGFAIL
IOERR_ADAPTER_TIMEOUT
IOERR_ADAPTER_DEVICE_TIMEOUT
IOERR_ADAPTER_REQ_NOT_SUPPORTED
IOERR_ADAPTER_REFER_TO_STATUS
IOERR_DEVICE_DEVICEBUSCHECK
IOERR_DEVICE_REQ_NOT_SUPPORTED
IOERR_DEVICE_DIAGFAIL
IOERR_DEVICE_BUSY
IOERR_DEVICE_OVERRUN
IOERR_DEVICE_UNDERRUN
For a detailed description of all the return codes, see Error Handling.