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

Amardeep S Chana vxlzneo02 at sneakemail.com
Mon Jan 19 23:47:56 EST 2004


"Roger Taylor" <rtaylor at bayou.com> wrote in
message news:5.1.0.14.0.20040119203610.02100bd0 at pop.bayou.com...
> At 10:37 AM 1/19/2004 -0500, you wrote:
>
> >It seems that sometime after Windows 98, the API to set the floppy drive
> >parameters to 256 byte sectors instead of 512 has been removed.
>
> In this case, maybe a 98 hacker could disassemble the calls involved in
> doing this and share the code.
>

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.

Utilities like DSKINI.EXE and any other DOS based program that works on
non-512 byte sectors must do so by accessing the disk controller port
registers directly.  This works under MS-DOS, Windows 3.x, and Windows
9x/Me.  It does not work under Windows NT, 2000, or XP because the NT family
kernel does not permit hardware port access from user mode software.

The kernel drivers do create virtual I/O ports for most standard devices
such as serial ports, disk controllers, etc.  I/O access to ports at these
standard locations are trapped then passed to the device driver associated
with those addresses.  The driver then attempts to emulate the intended
effect of the port access.  Due in part to the latency introduced by this
mechanism and in part to the inaccuracy of the emulation, direct disk I/O
code intended for MS-DOS rarely works.

That is the reason why those utilities fail under Windows NT/2000/XP and not
because some alleged API was removed by some evil guy trying to set your
disk I/O agenda.

That said, there is one function that was removed from Windows XP: a 720K
double density diskette cannot be formatted.  Existing disks are recognized
for read/write.  But they removed the option to format them both from the
GUI and the command line.

Amardeep






More information about the Coco mailing list