delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/01/06:40:30

Date: Sun, 1 Mar 1998 13:38:58 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Nicos P. Skouras" <nps1 AT bugsy DOT org>
cc: djgpp AT delorie DOT com
Subject: Re: bios_disk and Win32
In-Reply-To: <34F87665.7503@bugsy.org>
Message-ID: <Pine.SUN.3.91.980301133830.13547P-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019