Mail Archives: djgpp/1998/03/01/06:40:30
On Sat, 28 Feb 1998, Nicos P. Skouras wrote:
> Under DOS & Win16 the function bios_disk can be used to directly
> access individual sectors on a floppy disk.
> Is there a Win32 equivalent mechanism?
Are you talking about a program compiled with DJGPP which you run from
Windows 95 DOS box? If so, you need to know that Windows requires the
volume to be locked before it will allow direct disk access to it.
I'm not aware about any problems accessing floppies for reading, but
if your problems are with writing, maybe you need to lock the drive.
There is a DOS function (see an excerpt from the Interrupt List below)
to do that.
--------D-21440DCX084A-----------------------
INT 21 - MS-DOS 7.0 - GENERIC IOCTL - LOCK LOGICAL VOLUME
AX = 440Dh
CX = 084Ah (category code 08h, minor code 4Ah)
BL = drive number (00h=default,01h=A:,etc)
BH = lock level (00h-04h)
DX = drive permissions (see #1262) for Level 1 lock or second
Level 0 lock when formatting
Return: CF set on error
AX = error code (01h,02h,etc.) (see #1366 at AH=59h/BX=0000h)
CF clear if successful
Notes: the logical volume must be locked before direct disk accesses are
permitted by Windows95
the commandline LOCK issues a level 4 lock
SeeAlso: AX=440Dh"DOS 3.2+",AX=440Dh/CX=084Bh,AX=440Dh/CX=086Ah
SeeAlso: AX=440Dh/CX=086Ch
Bitfields for drive permissions:
Bit(s) Description (Table 1262)
0 allow writes
1 disallow new file mappings
2 volume locked for formatting
--------D-21440DCX084B-----------------------
- Raw text -