PDA

View Full Version : How to Low Level Format an IBM XT with orig XEBEC controller



billdeg
July 5th, 2005, 07:54 PM
This drove me crazy, trying to find a way to low-level format an IBM XT 5160 20 MB harddrive with an original XEBEC hard drive controller. Someone else will be glad to find this post...

c/r = "Hit the enter key"

A:>Debug c/r
-
-I 322 c/r
-I 321 c/r
-O 322 0 c/r
-I 321 c/r
-O 320 04 c/r
-O 320 00 c/r Note: This is the value for Drive C. Substitute
20 if formatting Drive D.
-O 320 00 c/r
-O 320 00 c/r
-O 320 05 c/r
-O 320 07 c/r Note: Before you hit this carriage return, be sure
you have typed the correct value shown in
the previous note for drive C or D.

Drive light should come on at this point and the controller will
begin doing a low-level format on the drive. [It takes hours, a good time to re-watch Lord of the Rings...]

When the drive has been formatted, the drive select light will
go out and you will be returned to the - prompt.

-I 321 c/r
-I 320 c/r
-Q

And you should now be back at the DOS prompt. At this point you
should enter FDISK, set the partition, and perform your high level
format.

[thanks Marvin Johnson of classiccmp and http://www.uncreativelabs.net/textfiles/drives/XEBEC.DOC]

Elar
July 6th, 2005, 10:04 AM
There's more elegant method by using INT 13 function 7:


;---INT 13-----------------------------
; INPUT:
; AH = HARD DISK COMMAND
;
; AH = 00 RESET DISK (DL=80H,81H)/DISKETTE
; AH = 01 READ THE STATUS OF THE LAST DISK OPERATION INTO AL
; NOTE&#58; DL < 80H - DISKETTE
; DL > 80H - DISK
; AH = 02 READ THE DESIRED SECTORS INTO MEMORY
; AH = 03 WRITE THE DESIRED SECTORS FROM MEMORY
; AH = 04 VERIFY THE DESIRED SECTORS
; AH = 05 FORMAT THE DESIRED TRACK
; AH = 06 FORMAT THE DESIRED BAD TRACK
; AH = 07 FORMAT THE DRIVE STARTING AT THE DESIRED TRACK
; AH = 08 RETURN THE CURRENT DRIVE PARAMETERS
; AH = 09 INITIALIZE DRIVE PAIR CHARACTERISTICS
; INT 41 POINTS TO DATA BLOCK
; AH = 0A READ LONG
; AH = 0B WRITE LONG
; READ AND WRITE LONG ENCOMPASS 512+4 BYTES ECC
; AH = 0C SEEK TO DESIRED TRACK
; AH = 0D ALTERNATE DISK RESET &#40;SEE DL&#41;
; AH = 0E READ SECTOR BUFFER
; AH = 0F WRITE SECTOR BUFFER
; AH = 10 TEST DRIVE READY
; AH = 11 RECALIBRATE
; AH = 12 CONTROLLER RAM DIAGNOSTIC
; AH = 13 DRIVE DIAGNOSTIC
; AH = 14 CONTROLLER INTERNAL DIAGNOSTIC
;
; REGISTERS USED FOR HARD DISK OPERATIONS
; AL - NUMBER OF SECTORS &#40;MAX RANGE 1-80H,
; FOR LONG 1-79H&#41;
; - INTERLEAVE VALUE FOR FORMAT COMMANDS
; CL - SECTOR NUMBER &#40;1-17, NOT VALUE CHECKED&#41;
; HIGH 2 BITS OF CYLINDER NUMBER ARE PLACED
; IN THE HIGH 2 BITS OF THE CL REGISTER
; CH - CYLINDER NUMBER &#40;0-1023, NOT VALUE CHECKED&#41;
; DL - DRIVE NUMBER &#40;80H-81H FOR DISK, VALUE CHECKED&#41;
; DH - HEAD NUMBER &#40;0-7 ALLOWED, NOT VALUE CHECKED&#41;
; ES&#58;BX - ADDRESS OF BUFFER FOR READS AND WRITES,
; &#40;NOT REQUIRED FOR VERIFY&#41;
;
; OUTPUT&#58;
; AH = STATUS OF CURRENT OPERATION
; CY = 0 SUCCESSFUL OPERATION &#40;AH=0 ON RETURN&#41;
; CY = 1 FAILED OPERATION &#40;AH HAS ERROR CODE&#41;
;
; IF DRIVE PARAMETERS WERE REQUESTED
; CL = MAX USEABLE VALUE FOR SECTOR NUMBER AND
; CYLINDER NUMBER HIGH BITS
; CH = MAX USEABLE VALUE FOR CYLINDER NUMBER
; DL = NUMBER OF CONSECUTIVE ACKNOWLEDGING DRIVES
; ATTACHED &#40;0-2&#41;
; DH = MAX USEABLE VALUE FOR HEAD NUMBER

billdeg
July 6th, 2005, 01:06 PM
My XT is currently into the 20th hour...how long is the low level format supposed to last? I have an IBM XT 20 MB drive.

barryp
July 6th, 2005, 05:37 PM
My XT is currently into the 20th hour...how long is the low level format supposed to last? I have an IBM XT 20 MB drive.

I have formatted larger drives in much less time.

billdeg
July 6th, 2005, 05:44 PM
I have aborted the low level format. I may try it again, or swap out the current drive with another same drive.

mbbrutman
July 6th, 2005, 10:00 PM
A 10 or 20MB hard should format within an hour .. I just did it a few weeks ago on the 5150 & 5161 combo I received.

The Xebec controller doesn't have an onboard BIOS extension to do the formatting, so you have to use this assembly language routine. It's sending commands to registers on the Xebec directly, programming it in its native language. Check for a typo - if you screwed up you told it to do something else besides a low level format.

Int 13 Function 7 is not going to cut it .. that's a high level format, not a low level format. Two different animals. Might as well just use the DOS format command. The low level format is controller specific and not part of any standard BIOS or DOS interrupt.

Elar
July 6th, 2005, 10:28 PM
On MFM (and RLE) drives format is always a low level format.

mbbrutman
July 7th, 2005, 07:24 AM
I stand corrected ... INT 13 on a machine that old does indeed do a low level format, not a high level format. My mistake ..




Mike

carlsson
July 8th, 2005, 02:28 AM
So, once users were not supposed to low level format disks anymore, did they reuse this interrupt hook for high level format and similar calling interface for programs that relied on the hard disk should get formatted in some way? :)