[Coco] Re: Disk Basic and 512 byte block floppies.

John E. Malmberg wb8tyw at qsl.net
Tue Jan 20 19:59:36 EST 2004


Amardeep S Chana wrote:

> Okay... this issue needs to be put to bed once and for all and I want to
> make it perfectly clear:  There is no PC BIOS, MS-DOS, or Windows API to set
> a sector size other than 512 bytes, and there NEVER HAS BEEN.  This is in
> contrast with x86 Linux which does have device driver support for special
> formats.

There is a MS-DOS API for doing setting disk parameters including the 
sector size, and it has been documented to work for all versions of 
MS-DOS since 2.x.

The supported method of using it broke with 3.x, where you were supposed 
to point the vector for the disk parameters at local memory and restore 
the vector after the call.

For 3.x you need to modify the data at the vector directly.

According to Undocumented DOS, this bug introduced with 3.x was fixed in 
4.x and later.

Much of the documentation for that API has been removed from the MSDN 
documentation that I have for my old copy of Visual Studio.  But it is 
still in my even older Symantec C++ kit.

So yes there is a documented PC BIOS and MS-DOS API to set the sector 
size of floppy disks.

The API has been tested to work in the DOS Emulators in Windows 95,98, 
and Windows NT 4.0.

It does not work in Windows 2000 and apparently Windows XP.

I do not have a Windows ME system to test on.


Direct access to the hardware is not needed for the operating systems 
that it works on.


The MS-DOS API also provides the ability to access the disk sectors 
directly.

Microsoft Windows NT and successors provides a native API to do this, 
but this API is not implemented in Windows 9x.  This API does not allow 
you to set the sector size, but you can look at it.

Microsoft Windows 95/9x provides a helper .VXD file to access disk 
sectors directly.  This API does not allow you to set the sector size 
either, but again you can look at it.


By having the COCO being able to copy disks to and from the 512 byte 
sector format, it will be possible to use GUI tools on these 512 byte 
disks to manipulate the files.


The MS-DOS specification originally included low level support for many 
disk formats for compatibility with CP/M.  Demand for such compatibility 
was apparently nearly non-existent, as no one noticed that the cloned 
BIOS did not implement many of the required types.

The IBM BIOS did implement support for all the types up to the PC-AT, I 
have not tested anything later.  A real IBM PC-AT can read and probably 
write Tandy 2000 quad density disks.  The "CLONE" 100% compatibles of 
the time using the Phoenix BIOS could not.

Much of the true history of the IBM PC has been re-written from what 
actually happened.

The original specifications for what was needed to be compatible with an 
IBM PC were revised a few years after the original release to require 
strict hardware compatibilty where it used to state that direct access 
to the hardware was not allowed for compatible software.

Software written to the original IBM / Microsoft specifications would 
run on the non 100% clones like the Tandy 2000.

-John
wb8tyw at qsl.network
Personal Opinion Only





More information about the Coco mailing list