[comp.binaries.ibm.pc.d] WANTED: Low Level HD Formatter

gr0z+@andrew.cmu.edu (Gregory Phillip Rhoads) (01/29/91)

Help!

I have a hard disk that when I try to format, it gives me the error :

invalid media or track 0 bad - disk unusable

I have tried to find a public domain low-level formatting program, and
have not been successful.  Can any one recommend one that would do the
job?

Thanks

Greg

davidsen@sixhub.UUCP (Wm E. Davidsen Jr) (01/29/91)

In article <gbd77X200Voz4H8kcz@andrew.cmu.edu> gr0z+@andrew.cmu.edu (Gregory Phillip Rhoads) writes:

| I have tried to find a public domain low-level formatting program, and
| have not been successful.  Can any one recommend one that would do the
| job?

  The IBM "advanced diagnostics" have one, and WD has one on their BBS
(also posted here) which handles all WD AT bus controllers.
-- 
bill davidsen - davidsen@sixhub.uucp (uunet!crdgw1!sixhub!davidsen)
    sysop *IX BBS and Public Access UNIX
    moderator of comp.binaries.ibm.pc and 80386 mailing list
"Stupidity, like virtue, is its own reward" -me

ian@unipalm.uucp (Ian Phillipps) (01/30/91)

gr0z+@andrew.cmu.edu (Gregory Phillip Rhoads) writes:

>I have tried to find a public domain low-level formatting program, and
>have not been successful.  Can any one recommend one that would do the
>job?

Your disk controller may very well have the formatting program in its ROM.
Often this has a starting address of XXXX:5, where the rom starts at segment
XXXX.  You will need to know the correct drive parameters (e.g. no. of
tracks, whether pre-compensation is needed) before you do this.

To start the program, type
	DEBUG
then
	G=XXXX:5 (where you've found XXXX by hunting round the memory)

Look to the supplier of the disk controller board (or your system) for
advice.

Ian

gottlieb@umbc5.umbc.edu (Mr. Robert Gottlieb; CMSC (UGRAD)) (01/30/91)

Or you could just get a utility off some place like simtel or
terminator.cc.umich.edu like hdset that does all that for you without
you even having to know any addresses.  I don't know for sure that this
utility is at one of these sites, I just know that both sites have quite
a bit of stuff for msdos and also for hard drives.  Of course this is
assuming you have ftp access.  Good Luck!


/*  Robert Allen Gottlieb               Internet: gottlieb@umbc5.umbc.edu */
/* "It is better to be pissed off than pissed on."                        */
/*  These opinions herein are not that of UMBC, but that of Jr, my cat,   */
/*  and me.                                                               */

indra@brahms.amd.com (Indra Singhal) (01/31/91)

ian@unipalm.uucp (Ian Phillipps) writes:

>Your disk controller may very well have the formatting program in its ROM.
>Often this has a starting address of XXXX:5, where the rom starts at segment
>XXXX.  You will need to know the correct drive parameters (e.g. no. of
>tracks, whether pre-compensation is needed) before you do this.

>To start the program, type
>	DEBUG
>then
>	G=XXXX:5 (where you've found XXXX by hunting round the memory)

The two most typical values for XXXX are: C800 or CC00. Give that a try.

Good Luck. Do you know what controller you have?


--
iNDRA | indra@amd.com or {ames apple uunet}!amd!indra
      | (Indra Singhal) (408) 749-5445; Advanced Micro Devices
      | MS 167; Box 3453; 901, Thompson Pl., Sunnyvale, CA 94088

tcs@mailer.jhuapl.edu (Carl Schelin) (01/31/91)

In article <1991Jan29.180600.28788@unipalm.uucp>, ian@unipalm.uucp (Ian Phillipps) says:
>
>gr0z+@andrew.cmu.edu (Gregory Phillip Rhoads) writes:
>
>>I have tried to find a public domain low-level formatting program, and
>>have not been successful.  Can any one recommend one that would do the
>>job?
>
>Your disk controller may very well have the formatting program in its ROM.
>Often this has a starting address of XXXX:5, where the rom starts at segment
>XXXX.  You will need to know the correct drive parameters (e.g. no. of
>tracks, whether pre-compensation is needed) before you do this.
>
>To start the program, type
>        DEBUG
>then
>        G=XXXX:5 (where you've found XXXX by hunting round the memory)
>
>Look to the supplier of the disk controller board (or your system) for
>advice.
>
>Ian

This only works on XT type controllers. The three 'XXXX's that I've seen
are G=C800:5 (standard, most use this), G=C800:1 (only seen this on one
board and I can't remember which), G=C800:7 (someone else mentioned
this one to me so it may or may not be true). I think there is another one
for a second hard drive. Something like CC00:5? Not sure.

Also, the WD XT controllers usually (<- note this) only ask for interleave
unless you ask for advanced formatting options (95% of drives don't need
the advanced options). 

Adaptec (sp) asks for all this other information most of the time.

Carl Schelin
tcs@mailer.jhuapl.edu

w8sdz@vela.acs.oakland.edu (Keith Petersen) (02/01/91)

---Forwarded message:
 Date: Tue, 20 Jun 89 13:42:58 CDT
 From: "Rich Winkel - UMC Math Department" <MATHRICH@UMCVMB.MISSOURI.EDU>
 To: Info-IBMPC@WSMR-SIMTEL20.ARMY.MIL
 Subject: Re: Resetting Interleave on a Slow Hard Disk

Your low disk performance is probably due to a non-optimal interleave
factor.  The interleave is a number which indicates how many physical
sectors lie between consecutive logical sectors on a track.  With a fast
enough controller and cpu, the logical sectors could be placed in
sequential order around the track, but with a PC-level machine reading
consecutive sectors, by the time the machine is finished digesting sector
N, the next physical sector has already passed by the head, so it can't be
read until the disk undergoes a full rotation.  The solution is to place
logical sector N+1 two or more sectors away from sector N, so that N+1 is
about to pass under the head at the same time that the hardware is ready
for it.  Anyway, on PC style machines, an interleave of 3 is usually best.
The original IBM XTs came with an interleave factor of 6, so the hard disk
had about half the performance that it was capable of.  The interleave
factor is determined at 'primary format' time.  Primary formatting is NOT
what the dos FORMAT.COM does.  If you want to do a primary format, you
have to either use debug to write your own short machine language program,
or, on some hard disk controllers, you can run a relatively 'user
friendly' routine that's built into your hard disk bios at address C800:5.
I recommend writing the program, since not all controllers have the C800:5
routine.  Here's what you do:

DEBUG                     (run debug.com from the dos prompt)
A 100                     ; assemble a program
MOV AX,0703               ; the 03 here is the interleave to use
XOR BX,BX
MOV ES,BX                 ; this gets around a pesky bug in the XT bios
MOV CX,0001
MOV DX,0080               ; use 80 for the first hard disk, 81 for second
INT 13                    ; do the format ... takes a few minutes
INT 20                    ; terminate program
(enter a null line here to get out of input mode)
G                         (run the program that you just typed in)
Q                         (exit to dos)

After this, you'll need to run FDISK and the dos FORMAT to finish setting
up the disk.  Of course, don't forget to BACK UP YOUR FILES before you do
anything ... this procedure will wipe the slate clean.

Rich

robl@idca.tds.PHILIPS.nl (R. Luursema) (02/01/91)

indra@brahms.amd.com (Indra Singhal) writes:
>ian@unipalm.uucp (Ian Phillipps) writes:
>
>>Your disk controller may very well have the formatting program in its ROM.
>>Often this has a starting address of XXXX:5, where the rom starts at segment
>>XXXX.  You will need to know the correct drive parameters (e.g. no. of
>>tracks, whether pre-compensation is needed) before you do this.
>
>>To start the program, type
>>	DEBUG
>>then
>>	G=XXXX:5 (where you've found XXXX by hunting round the memory)
>
>The two most typical values for XXXX are: C800 or CC00. Give that a try.

Right.

The entry point (:5) seems to differ from manufacturer to manufacturer.
I used to have an XT with an full size DTC disk controller, that starts
its low-level formatting program at C800:CCC . I know of two other 
types of controllers that have entry points at C800:6 and C800:9 .

So before you start, do an U(nassemble) at that location, to see if
there are valid instructions. Most probably you will find an jump
instruction at the first location.

If you cannot find the HD BIOS using debug, or there is no EPROM on 
your disk controller card, or the disk controller is integrated on the 
motherboard, then the HD BIOS functions are included in the system 
BIOS and will probably not include a low level formatter within that 
BIOS. In that case you need an external formatting program, which 
should be supplied with you system when you bought it.

Be sure to check the cables to your HD, and its drive type setup in 
cmos on ATs, or jumpers/switches on XTs. 

Success.

Rob.