How to tell if Drive B is attached **SUMMARY**

How to tell if Drive B is attached **SUMMARY**

Post by Jeff Beadl » Thu, 21 Jun 1990 00:52:16



Overall, I received several of the same answers, that being _nflops.  However,
one response stands out, from Patti Ryan.  It looks at the drive map, and then
if drive B is not present it maps it out.

Thanks again for your help!

        -Jeff

--

Utek Engineering, Tektronix Inc.        +1 503 685 2568
                        SPEEA - Just say no.

-----------------------------------------------------------------------------
The "Winning" solution.  (It was also the first :-)
-----------------------------------------------------------------------------

Jeff -
    Here is a little C function I wrote which returns the true
drive map. It uses the protected system variable _nflops at
$0x4A6 which indicates the actual number of floppies connected.
Hope this solves your problems.
                                      - Patti -

#include <osbind.h>

long drive_map() /* This function returns a bit-wise encoded list */
                 /* of the available disk drives. It does not */
                 /* indicate drive B arbitrarily as does Drvmap(). */
{
    register long user_stack = Super( 0L );
    register unsigned int _nflops = *( unsigned int * )0x4A6;
    register long map = Drvmap();
    Super( user_stack );
    if ( _nflops > 0 ) {
        _nflops *= 2;
        _nflops += 65531;
        map &= ( long ) _nflops;
    }
    return( map );

Quote:}

-----------------------------------------------------------------------------
The following 6 folks gave information regarding _nflops.

There is an official system variable called _nflops in the $4xx area which
you can use for that purpose. It contains 1 if you only have drive A and
2 for both drives. The address is $4A6.

------------------------------------------------------------------------------
And, for the most obscure answer:
------------------------------------------------------------------------------

Hi
===
You could select your Drive(A,B) Via the Soundchip which controls the Drive-
select Siganls off the Floppy Bus, turn via FD1772 the Motor on and request all
Indexpulses an IRQ, if you won't get on Indexpulse in 1 s (there should be
300 /s ) you probably haven't connected a Drive.(thsi can only be used with
3.5" Drives, because those have an Hardwires Indexpuls(the turning Motor
creates it) If you Use 5 1/4 " Drives you have to search an other Way to get
to your Information(I don't know if my way will work....)

------------------------------------------------------------------------------

End of summaries.

Thanks again for your help!

 
 
 

1. TECH: How to tell if drive B is REALLY attached?

I need to know if drive B is REALLY attached.  "Drvmap" (Which, by the way is
NOT my friend :-) says that there is a drive B, even if there isn't.  I'm
guessing that this is so the "logical" drive switching works.

I've seen other programs that have done this, but NOTHING in the documentation
that I have here.  Can anyone shed light on this?

C answers are perfered, but assembler will do.

Please email them to me, and I'll follow up in a week or two.

        -Jeff

--

Utek Engineering, Tektronix Inc.        +1 503 685 2568
                        SPEEA - Just say no.

2. RemoteAccess Virus?

3. Wanted: How to tell if drive B is REALLY attached?

4. Anyone tried Silencer?

5. Can two floppy drives be attached to the internal Mega floppy connector?

6. Quick Procmail question

7. Attaching CHINON drive to the ST (to be continued...)

8. DNS zone transfers

9. Attaching SCSI drives

10. Attaching a CHINON drive to the ST (the saga continues...)

11. Attaching a CHINON drive to the ST

12. (IBM) 1.44 drives - am I silly or what??

13. Using 5 1/4" Disk Drives (Summary)