[comp.os.msdos.programmer] Insert disk message...

melling@cs.psu.edu (Michael D Mellinger) (06/03/91)

Is there a way to avoid the "Insert disk in B drive message..." when I
change the A drive to B from within my MS C(6.0) program on a single
floppy system?  Right now it always prompts the user to insert a disk
into drive B and to hit RETURN even if there is already a disk in the
drive.

-Mike

ralf+@cs.cmu.edu (Ralf Brown) (06/05/91)

In article <$d4Hl83l@cs.psu.edu> melling@cs.psu.edu (Michael D Mellinger) writes:
}Is there a way to avoid the "Insert disk in B drive message..." when I
}change the A drive to B from within my MS C(6.0) program on a single
}floppy system?  Right now it always prompts the user to insert a disk

There is a DOS call for DOS 3.2 and up.  For earlier versions, you'll need to
poke a byte in low memory (0050h:0004h if memory serves).

INT 21 - DOS 3.2+ - IOCTL - GET LOGICAL DRIVE MAP
        AX = 440Eh
        BL = drive number (00h=default,01h=A:,etc)
Return: CF set on error
            AX = error code (01h,0Fh) (see AH=59h)
        CF clear if successful
            AL = 00h block device has only one logical drive assigned
                 1..26 the last letter used to reference the drive (1=A:,etc)
SeeAlso: AX=440Fh,INT 2F/AX=122Bh
----------21440F-----------------------------
INT 21 - DOS 3.2+ - IOCTL - SET LOGICAL DRIVE MAP
        AX = 440Fh
        BL = physical drive number (00h=default,01h=A:,etc))
Return: CF set on error
            AX = error code (01h,0Fh) (see AH=59h)
        CF clear if successful
            drive now responds to next logical drive number
Note:   maps logical drives to physical drives, similar to DOS's treatment of
          a single physical floppy drive as both A: and B:
SeeAlso: AX=440Eh,INT 2F/AX=122Bh
-- 
{backbone}!cs.cmu.edu!ralf  ARPA: RALF@CS.CMU.EDU   FIDO: Ralf Brown 1:129/53
BITnet: RALF%CS.CMU.EDU@CARNEGIE   AT&Tnet: (412)268-3053 (school)   FAX: ask
DISCLAIMER?  Did  | It isn't what we don't know that gives us trouble, it's
I claim something?| what we know that ain't so.  --Will Rogers

campbell@cutmcvax.cs.curtin.edu.au (Trevor George Campbell CC361) (06/07/91)

melling@cs.psu.edu (Michael D Mellinger) writes:


>Is there a way to avoid the "Insert disk in B drive message..." when I
>change the A drive to B from within my MS C(6.0) program on a single
>floppy system?  Right now it always prompts the user to insert a disk
>into drive B and to hit RETURN even if there is already a disk in the
>drive.

I suspect NOT as DOS always thinks (and makes it look like) there are 2 floppy
disks on a machine with only one real physical drive. I'm not sure if there
is a way to detect if only one floppy or two are available (system config.
byte / and interrupt (?? int 11h) spring to mind as possabilities. From memory
there is a byte or two that tell how many drives are attached), although
you would have to check these and then write you program to (itself) do the 
redirecting of all requests to drive B to drive A (ie: change the filename's
that you open)...

Hope this helps some...

Trevor
--
Trevor          alias  <**<TOMCAT>**>

tuo em tel esaelP ,lanimret siht edisni kcuts m`I pleH



(
for all of you out there who can't read backwards.....
Help i'm stuck inside this terminal, Please let me out
)

rennyk@apex.com (Renny K) (06/20/91)

In article <campbell.676286703@cutmcvax> campbell@cutmcvax.cs.curtin.edu.au (Trevor George Campbell CC361) writes:
>melling@cs.psu.edu (Michael D Mellinger) writes:
>
>
>>Is there a way to avoid the "Insert disk in B drive message..." when I
>>change the A drive to B from within my MS C(6.0) program on a single
>>floppy system?  Right now it always prompts the user to insert a disk
>>into drive B and to hit RETURN even if there is already a disk in the
>>drive.
>

>I suspect NOT as DOS always thinks (and makes it look like) there are 2 floppy
>disks on a machine with only one real physical drive. I'm not sure if there
>is a way to detect if only one floppy or two are available (system config.
>byte / and interrupt (?? int 11h) spring to mind as possabilities. From memory
>there is a byte or two that tell how many drives are attached), although
>you would have to check these and then write you program to (itself) do the 
>redirecting of all requests to drive B to drive A (ie: change the filename's
>that you open)...
>

Yes there is a way to do this.  DOS keeps track of which disk is currently in
effect (i.e. which logical drive is being used A: or B:) in a location in the
BIOS area in low memory.  I don't know off hand what the location is. 

E-mail me if you'd like me to look it up, or if you have any references try
them. (Peter Norton's Programmer's Guide is good).

					Renny

-- 
-------------------------------------------------------------------------------
Renny Koshy						rennyk@apex.com
Apex Computer, Redmond, WA.