[comp.os.minix] Minix/MessDOS disk formatting.... please HELP!

johnf@runx.ips.oz (John F. Baird) (05/11/88)

I am desperately trying to get my 68000/Z80 based system to format a disk for
use with MSDOS/Minix. The system uses a WD1772, rather than the NEC uPD765
used in the IBM PC, and I think this may be the problem. The WD1772 has no
trouble at all reading and writing MSDOS disks; It can read the disks that it
formats too. I know my 68000 program to initialise an empty MSDOS filesystem
is OK, because it works when used on a diskette formatted under MSDOS (I'm
quite confidant of this).

The WD1772 seems far less picky about what it will and won't read. After I
format a disk on it and initialise it with an MSDOS filesystem, the IBM PC
gives "General Failure" or "Not Ready" errors - but several retries gets it to
work!. Very odd. I played around with different formats and at best, the IBM
PC threw up errors every now and then - at worst, it happened every sector.
MSDOS's next to useless error messages do not help the diagnosis.

What am I doing wrong?. Has anyone got the source for a diskette formatting
program for a Western-Digital controller, that produces disks the NEC
controller CAN read?. Does MINIX ST include the source to a formatting program
the may help my plight?

Even when formatting exactly as per the data sheets for the NEC controller, It
still doesn't work. I'm formatting in MFM with 9 sectors per track, 40 tracks,
2 sides, no interleaving, 512 byte sectors, with an IAM after the index hole.
The WD1772 can read the result OK - why can't the uPD765?. Does the IBM PC do
something strange with the Data Address Mark/Deleted Data Adddress Mark? (I
never write a Deleted DAM)

Precisely, the bytes going to disk are:
(count is decimal, byte is hex)
<index hole>
    80 x 4E - Start/End of track Gap
    12 x 00 - Index Field sync bytes
     3 x C2 - Missing clock between bits 3 & 4. (FD1772 = F6H)
     1 x FC - Index Address Mark
    50 x 4E - (Gap 1) End of Index Field gap
.---12 x 00 - Identification field sync bytes
R    3 x A1 - Missing clock between bits 4 & 5 (FD1772 = F5H)
E    1 x FE - Identification Address Mark
P    1 x cyclinder number (0 to 39)
E    1 x head number (0 to 1)
A    1 x sector number (1 to 9)
T    1 x 02 - Sector length is 512 bytes.
     2 x CRC - Generated automatically by FD1772 = 1 x F7H
9   22 x 4E - (Gap 2) End of Identification Field gap
    12 x 00 - Data Field sync bytes
T    3 x A1 - Missing Clock between bits 4 & 5 (FD1772 = F5H)
I    1 x FB - Data Address Mark
M  512 x E5 - Data!!!
E    2 x CRC - Generated automatically by FD1772 = 1 x F7H
.---80 x 4E - (Gap 3) End of Data Field gap
     n x 4E - Writes till next inddex pulse (end of track)

Has anybody got any hints on what I may be doing wrong?. The "LOST DATA" bit
in the FD1772's status register indicates that everything is going to disk OK.
Many Many Many thanks to anybody that can help!
Please reply via mail to the address below; I'm likely to miss it in the
newsgroup.
                                      Greyham.
* Greyham Stoney:
* Incoming Mail: greyham@utscsd.oz (I cant send out from here)
* University of Technology, Sydney: (Amdahl) /ele/student/greyham
* Outgoing Mail: johnf@runx.oz (please dont send to here)
ACSnet: greyham@utscsd				CSNET:	greyham@utscsd.oz
ARPA:	greyham%utscsd.oz@seismo.css.gov	JANET:  utscsd.oz!greyham@ukc
UUCP:	{enea,hplabs,mcvax,prlb2,seismo,ubc-vision,ukc}!munnari!utscsd.oz!greyham

henkp@nikhefk.UUCP (Henk Peek) (05/24/88)

In article <1512@runx.ips.oz> johnf@runx.ips.oz (John F. Baird) writes:
-I am desperately trying to get my 68000/Z80 based system to format a disk for
-use with MSDOS/Minix. The system uses a WD1772, rather than the NEC uPD765
-used in the IBM PC, and I think this may be the problem. The WD1772 has no
-trouble at all reading and writing MSDOS disks; It can read the disks that it
-formats too.
-The WD1772 seems far less picky about what it will and won't read. After I
-format a disk on it and initialize it with an MSDOS filesystem, the IBM PC
-gives "General Failure" or "Not Ready" errors - but several retries gets it to

-What am I doing wrong?. Has anyone got the source for a diskette formatting

Yes there is a format problem. The WD FD controllers writing the first
address mark under the index hole and the 765 can't find a address mark
in the index pulse (index hole). (It writes its first address mark
after the index hole :-)
There is an easy cure to read a WD formatted floppy with a 765 controller:
Put a small sticker over the index hole on the floppy disk jacket.
The 765 can now search the hole trac for address marks. Only when
something goes wrong the floppy controller doesn't timeout.
(The timeout function counts ~3 index pulses.) You could use alarm().

Henk Peek ..!uunet!mcvax!nikhefk!henkp.UUCP