Jump to content

PDSK_READPHYSTRACK

From EDM2


Category
IOCTL_PHYSICALDISK (09h)
Function
PDSK_READPHYSTRACK (64h)
Description
Read Physical Track

Description

Performs a physical read track.

Command Information

A bit field as follows:

  • Bit 0: If clear (0), the track layout contains nonconsecutive sectors or does not start with Sector 1. If set (1), the track layout starts with Sector 1 and contains only consecutive sectors.
  • All other bits are reserved and must be set to 0.

Head

The physical head on the drive that performs the operation.

Cylinder

The cylinder for the read.

First Sector

The logical sector number within the Track Layout Table that starts the I/O operation. Note that the sector numbers start with 0. For example, the third sector is number 2.

Number of Sectors

The number of sectors to read (up to the maximum specified in the track table; the IOCtl subfunctions do not step heads/tracks).

Track Layout Table

Field Length
Sector Number for Sector 1 WORD
Sector Size for Sector 1 WORD
Sector Number for Sector 2 WORD
Sector Size for Sector 2 WORD
Sector Number for Sector 3 WORD
Sector Size for Sector 3 WORD
... ...
Sector number for Sector n WORD
Sector size for Sector n WORD

Parameter Packet Format

Field Length C Datatype
Command Information BYTE BYTE
Head WORD USHORT
Cylinder WORD USHORT
First Sector WORD USHORT
Number of Sectors WORD USHORT
Track Layout Table BYTES BYTE[]

Related C Data Structure: The TRACKLAYOUT data structure can be used by C programmers. To include this data structure in your file, make sure INCL_DOSDEVIOCTL is defined before you include OS2.H.

Data Packet Format

The Data Packet is a buffer. The buffer must be large enough to hold requested data.

Field Length C Datatype
Buffer BYTES UCHAR[]

Returns

Possible values are shown in the following list:

Code Description
0 NO_ERROR
1 ERROR_INVALID_FUNCTION
6 ERROR_INVALID_HANDLE
15 ERROR_INVALID_DRIVE
31 ERROR_GEN_FAILURE
87 ERROR_INVALID_PARAMETER
111 ERROR_BUFFER_OVERFLOW
115 ERROR_PROTECTION_VIOLATION
117 ERROR_INVALID_CATEGORY
119 ERROR_BAD_DRIVER_LEVEL
163 ERROR_UNCERTAIN_MEDIA
165 ERROR_MONITORS_NOT_SUPPORTED

Remarks

This function is used to perform the operations specified on the physical drive in this request. This is similar to the Category 08h commands, except that the I/O is done offset from the beginning of the physical drive instead of from the beginning of the extended volume associated with the unit number (Category 08h). The Track Layout Table passed in the Parameter Packet is used to determine the sector number, which is passed on to the disk controller for the operation. In cases where the sectors are oddly numbered or are nonconsecutive, this request breaks into n single sector operations and reads one sector at a time. Note also that the device driver does not correctly read a non-512 byte sector if the READ operation would generate a DMA violation error. Applications should be written so that this error does not occur. The sector table that is specified provides information that is used during the READ track operation.