Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ hd(4) — AOS 4.3

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

fd(4)

disk(4)

diskpart(8)

format(8R)

minidisk(8R)

newfs(8)

sautil(8R)

HD(4)  —  

NAME

hd − hard disk interface

SYNOPSIS

For the IBM RT PC:
controller hdc0 at iocc0 csr 0xf00001f0 priority ?
controller hdc1 at iocc0 csr 0xf0000170 priority ?
disk hd0 at hdc0 drive 0
disk hd1 at hdc0 drive 1
disk hd2 at hdc ? drive ?

For the IBM 6152 Academic System:
controller hdc0 at iocc0 csr 0xffffffff priority 14
disk hd0 at hdc0 drive 0
disk hd1 at hdc0 drive 1

DESCRIPTION

On the IBM RT PC, this driver supports the fixed-disk function of the IBM Personal Computer AT Fixed Disk and Diskette Adapter, the Enhanced Small Device Interface Magnetic Media Adapter, and the Extended ESDI Magnetic Media Adapter.  The diskette function of the adapter is supported by the fd(4) driver. The driver supports, at most, three hard disks on each of two adapters (for a total of six hard disks). Physical considerations limit the actual number of disks in a system to one or three, depending upon model. An Extended ESDI adapter will support up to three hard disks; the others are limited to at most two disks.

On the IBM 6152 Academic System, this driver supports the Personal System/2 fixed-disk adapters.  The driver supports, at most, two hard disks on one adapter. 

The “a,” “b” and “g” partitions are by convention used for root, swap and user areas respectively. The “c” partition maps the physical area defined as the IBM/4.3 partition which includes disk space allocated for bootstraps and the replacement pool for bad blocks.  On the IBM 6152 Academic System, the “h” partition is used to map the entire physical disk.  This includes the first sector of the disk and may include areas used by other operating systems.  The “h” partition is used by fdisk(8R) to access the master boot record partition table. 

Files with minor device numbers 0 through 7 refer to partitions of drive 0; minor devices 8 through 15 refer to drive 1, and so on.  The standard device names begin with “hd”, followed by the drive number and then a letter a-h for partitions 0-7, respectively. 

The block files access the disk via the system’s normal buffering mechanism and may be read and written without regard to physical disk records.  There is also a “raw” interface that provides for direct transmission between the disk and the user’s read or write buffer.  The names of the raw files conventionally begin with an extra r.  A single read or write call results in exactly one I/O operation; therefore, raw I/O is more efficient when many words are transmitted.  This is especially true for the Personal System/2, as each I/O operation results in exactly one interrupt and no PIO transfer of the sector buffer is required.  On the IBM RT PC, when using an Extended ESDI adapter data is transferred via DMA.  For raw I/O with the older IBM RT PC adapters, each 512-byte block still results in an interrupt and the PIO transfer of the sector buffer in or out of main memory. 

In raw I/O, counts should be multiples of 512 bytes (a disk sector).  Likewise, seek(2) calls should specify multiples of 512 bytes. For performance reasons, the user’s buffer should be aligned on a fullword boundary when the raw device is used.  Ensuring that the buffer does not cross a page boundary further improves performance.

DISK SUPPORT ON THE IBM RT PC

The driver reads the configuration record (cylinder 0, track 0, sector 2 using the convention of disk(4) to determine the geometry of the disk; this record is originally written by the format(8R) program and is further described in disk(4).

The origin and size (in sectors) of the default partitions on each drive are as follows.  The character “?” stands for a drive number in the range 0-2. 

hd40m 40 Mbyte hard disk partitions
 diskstartlengthcapacitycylinders
hd?a   85 15884  7.8 MB   1 -  187
hd?b15980 10032  4.9 MB 188 -  306
hd?c    0 87040 42.5 MB   0 - 1023
hd?d26095 15884  7.8 MB 307 -  493
hd?f41990 43945 21.5 MB 494 - 1010
hd?g26095 59840 29.2 MB 307 - 1010

hd40r 40 Mbyte hard disk partitions
 diskstartlengthcapacitycylinders
hd?a  119 15884  7.8 MB   1 -  134
hd?b16065 10032  4.9 MB 135 -  219
hd?c    0 87227 42.6 MB   0 -  732
hd?d26180 15884  7.8 MB 220 -  353
hd?f42126 43911 21.4 MB 354 -  722
hd?g26180 59857 29.2 MB 220 -  722

hd70m 70 MByte hard disk partitions
 diskstartlengthcapacitycylinders
hd?a  136 15884  7.8 MB   1 -  117
hd?b16048 33440 16.3 MB 118 -  363
hd?c    0139264 68.0 MB   0 - 1023
hd?d49504 15884  7.8 MB 364 -  480
hd?e65416 55936 27.3 MB 481 -  892
hd?f121448 16592  8.1 MB 893 - 1014
hd?g49504 88536 43.2 MB 364 - 1014

hd70r 70 MByte hard disk partitions
 diskstartlengthcapacitycylinders
hd?a  252 15884  7.8 MB   1 -   64
hd?b16380 33440 16.3 MB  65 -  197
hd?c    0142632 69.6 MB   0 -  565
hd?d49896 15884  7.8 MB 198 -  261
hd?e66024 55936 27.3 MB 262 -  483
hd?f121968 19404  9.5 MB 484 -  560
hd?g49896 91476 44.7 MB 198 -  560

hd70e 70 MByte hard disk partitions
 diskstartlengthcapacitycylinders
hd?a  245 15884  7.8 MB   1 -   65
hd?b16170 33440 16.3 MB  66 -  202
hd?c    0142835 69.7 MB   0 -  582
hd?d49735 15884  7.8 MB 203 -  267
hd?e64190 55936 27.3 MB 268 -  496
hd?f118580 19600  9.6 MB 497 -  576
hd?g49735 91630 44.7 MB 203 -  576

hd310h 310 MByte hard disk partitions
diskstartlengthcapacitycylinders
hd?a  510 15884  7.8 MB   1 -   32
hd?b16830 33440 16.3 MB  33 -   98
hd?c    0 606390296.1 MB   0 - 1188
hd?d 342210 15884  7.8 MB 671 -  702
hd?e358530 55936 27.3 MB 703 -  812
hd?f414630 190230 92.9 MB 813 - 1185
hd?g342210 262650128.2 MB 671 - 1185
hd?h50490 291346142.3 MB  99 -  670

hd114e 114 MByte hard disk partitions
 diskstartlengthcapacitycylinders
hd?a  245 15884  7.8 MB   1 -   65
hd?b16170 33440 16.3 MB  66 -  202
hd?c    0224175109.4 MB   0 -  914
hd?d49735 15884  7.8 MB 203 -  267
hd?e65660 55936 27.3 MB 268 -  496
hd?f121765100940 49.3 MB 497 -  908
hd?g49735172970 84.4 MB 203 -  908

It is unwise for all these special files to be present in one installation, because addresses overlap and protection becomes a sticky matter.  The hd?a partition is normally used for the root file system, the hd?b partition as a paging area, and the hd?c partition for access to the entire disk, including boot and configuration information at the start of the disk and bad-block and diagnostic regions at the end of the disk.  The safest way of using an entire disk as a single partition is NOT use of the hd?c partition.  Instead, the minidisk(8R) standalone utility should be used to define a partition that starts where the hd?a partition from the appropriate table above would (in other words, with the second cylinder) and ends where the hd?g would.  If the hd?c partition is (unwisely) used for a filesystem, the following should be considered: The hd?c partitions cannot be used as filesystems with an: hd70e, hd114e, or an hd310h disk due to the location of the hidden defect table.  Other hd1c and hd2c partitions may be used as a filesystem provided that the bad-block forwarding table is not too large and the bad-block and diagnostic regions are not used. The newfs(8) program enforces this restriction. The hd0c partition cannot be used as a filesystem, because the root is normally on hd0a, swap is on hd0b, and /usr is on hd0g. In addition, the diagnostics write on hd0 following the bad-block table. 

Standard partition tables are calculated using the diskpart(8) program. Non-standard disk partitions may be created using the minidisk(8R) menu selection of the sautil(8R) standalone utilities. 

DISK SUPPORT ON THE IBM 6152 ACADEMIC SYSTEM

Disk geometry is provided by PS/2 initialization code at boot time.  The number of cylinders per drive, tracks per cylinder (heads) and number of sectors per track is provided as well as the starting cylinder and size of the IBM/4.3 partition. 

As the size of any IBM/4.3 physical partition is determined solely by the user at system configuration time, there can be no default partitionings.  The partition information must be recorded on the disk itself.  For reasons of code compatibility and support of existing disk formats, the VRM minidisk table is used for this purpose.  Therefore, any disk with a IBM/4.3 physical partition must have a valid VRM minidisk table defining the existence of partitions. 

These disk partitions are created using the minidisk(8R) menu selection of the sautil(8R) standalone utilities. 

FILES

/dev/hd[0-2][a-h]block files
/dev/rhd[0-2][a-h]raw files

SEE ALSO

fd(4), disk(4), diskpart(8), format(8R), minidisk(8R), newfs(8), sautil(8R)

“Chapter 3.  Preparing Your Fixed Disk” in Disk Operating System Version 3.30, 80X0667, First Edition (April 1987). 

DIAGNOSTICS

HD: adapter @ 0x%x TIMED OUT (0x%x & 0x%x != 0x%x).  The adapter did not complete an operation in a reasonable length of time.  Probable cause: defective adapter. 

HD: Hard Disk I/O Error.  An unrecoverable error occurred.  If appropriate, numerous retry attempts have been made but all failed. 

HD: Write Fault.  Probable cause: bad drive. 

HDINIT: Disk I/O Error CMD=0x%x.  The adapter reported an error while it was being initialized. 

hd%d: %d blocks forwarded to zero - reformat required.  Run the format(8R) utility. 

hdc%d: diagnose=0x%x ERROR.  Probable cause: defective adapter. 

hdc%d: lost interrupt(s).  A timer watching the adapter detected no interrupt for an extended period of time while operation(s) were outstanding.  Either the hd device driver or the adapter is failing.  Recovery is attempted and the operation(s) are retried, which may cause the message to repeat. 

hd: hd%d%c bn=%d Status=0x%b,0x%b ErrA=0x%x ErrB=0x%x (IBM RT PC only)
hd: hd%d%c bn=%d Err=0x%b Status=0x%b Cyl=%d Hd=%d Sect=%d SCT=%d
Generic status messages which follow many of the more specific error messages. The second form appears only when the error occurred on an non-DMA operation, including all IBM 6152 Academic System operations. The first form is for DMA operations.  If known, the specific drive, partition, and block number associated with the error are printed.  The block number is relative to the start of the partition.  The contents of various adapter registers are displayed.

hd%d: %s; interleave factor is %d to 1 (IBM RT PC)
hd%d: %s type (%d cyl, %d tracks, %d sectors); interleave factor is %d to 1 (IBM RT PC)
hd%d: %d mb allocated for IBM/4.3 (IBM 6152 Academic System)
hd%d: %d cylinders %d tracks %d sectors. (IBM 6152 Academic System)
Informational message displayed during autoconfiguration.  If the drive type shown is "unknown" then the configuration record may be damaged.

For the IBM RT PC only:

HD: BAD INTERRUPT! ADAPTER NOT ACTIVE! 
HD: BAD INTERRUPT! NO SUCH DRIVE!
HD: BAD INTERRUPT! DRIVE/QUEUE NOT ACTIVE!
HD: BAD INTERRUPT! INVALID STATUS!
HD: BAD INTERRUPT? UNEXPECTED STATUS!
These messages occur only when operating the EESDI adapter in DMA mode.  Probable cause: adapter failure (or hd device driver bug).

HD: DMA CHANNEL ABUSE!!.  All the hard disk DMA channels are in “exclusive” use so the hd driver was unable to get a DMA channel. 

HD: HDXBREL: HELP! xbp=0x%x NOT AN XBUF! 
HD: HDDBUFDEQ: bp 0x%x not on dp 0x%x queue!
HD: HDDDEVDEQ: dp 0x%x not on ic 0x%x queue!
These messages “can’t happen.” Probable cause: bug in hd device driver.

HD: HDDUNGO: dma_free_map FAILED!!.  Probable cause: bug in dma device driver. 

HD: OUT OF XBUFS! NHDXBUF=%d.  The supply of buffer extensions has been exhausted.  NHDXBUF is the number of buffer extensions configured into your kernel. 

HDINT: DISK BUSY!? - INT. SWALLOWED (choke)
HDINT: NO DRQ (0x%x, 0x%x) - INT. TREATED AS WRITE REQUEST COMPLETE!!
HDINT: NO I/O IN PROGRESS!!
HDINT: NO STATUS - INT. IGNORED
HDINT: NO WRITE IN PROGRESS - INT. SWALLOWED (choke)
These messages occur only when DMA is not being used.  Probable cause: adapter failure (or hd device driver bug).

hd%d: bad/missing configuration record.  No valid configuration record was found at sector 1 during autoconfiguration.  This probably means that the start of the disk has been overwritten.  The disk will be unusable until the configuration record has been restored from a backup copy, or rebuilt with format(8R). 

hd%d: no bad-block table
Indicates that no bad-block table was found at sector 8 during autoconfiguration. This probably means that the start of the disk had been overwritten and that the disk will not be usable until the bad-block information is restored from a backup image of the disk, or rebuilt by reformatting the entire disk.

hdc%d: ec level 0x%x microcode level 0x%x configuration_bits 0x%x.  Informational message during autoconfiguration.  This shows the adapter engineering change level, microcode level, and what drives it thinks are attached to it. 

hdc%d: unknown adapter type 0x%x.  During autoconfiguration it was noticed that the ROS was unable to identify the type of the specified disk adapter.  This may later result in strange behavior. 

hdswitch: nothing to start??.  Probable cause: bug in hd device driver. 

panic: hddbadblk.  Probable cause: EESDI adapter failure (or hd device driver bug). 

panic: hddgo bp
panic: hddgo channel
panic: hddgo dp->b_actf
panic: hddgo ioaddr
panic: hddgo len
panic: hddgo len0
panic: hddgo pointers.  These panics indicate bugs in the hd device driver. 

panic: hddstart tcws.  Probable cause: bug in dma device driver. 

panic: hdstrategy b_bcount.  Probable cause: bug in whatever called the hd device driver. 

BUGS

In raw I/O read(2) and write(2) truncate file offsets to 512-byte block boundaries, and write scribbles zeroes on the tail of incomplete blocks.  Thus, in programs likely to access raw devices, read, write, and lseek(2) should always deal in 512-byte multiples.

In raw I/O, the buffer must be aligned on a fullword boundary. 

DMA and overlapped seeks (and transfers) are done only with the Extended ESDI adapter. 

PRPQs 5799-WZQ/5799-PFF: IBM/4.3  —  Sept 1988

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