[comp.sys.ibm.pc] Interrupt to find out what drives you have...

bill@vax1.acs.udel.EDU (William Tsai) (08/03/89)

I have to write a program which automatically detects the floppy
devices installed in a system.  I am not sure if there is a way
besides reading directly from CMOS seup area, and IBM's bios listing
is not clear at all on how to use that routine.  If anyone can help,
please let me know.

-- 
       Bill Tsai
University of Delaware CIS		ARPA:  bill@vax1.acs.udel.EDU
     (302) 738-1716	" The computer doesn't hate everybody - just you... "

csachs@oucsace.cs.OHIOU.EDU (Colin Sachs) (08/18/89)

(William Tsai) writes:
> I have to write a program which automatically detects the floppy
> devices installed in a system.  I am not sure if there is a way
> besides reading directly from CMOS seup area, and IBM's bios listing
> is not clear at all on how to use that routine. 

INT 11h loads the AX register with information pertaining to peripheral
equiptment.  The bit settings in AX are:

   Bit   15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
         |  |  |  |  |  |  |  |  |  |  |  |  |__|  |  Current Disk Drive
         |  |  |  |  |  |  |  |  |  |  |__|  |     Math Coprocessor
         |  |  |  |  |  |  |  |  |__|  |     System board RAM (64K blocks)
         |  |  |  |  |  |  |  |  |     Initial Video Mode
         |  |  |  |  |  |__|  |  Number of disk drives -1
         |  |  |  |  |  |     DMA present? (0 yes, 1 no)
         |  |  |  |  Number of RS232 card in system
         |__|  |  Game I/O attached (not used on AT)
         |     Serial printer attached (PC Jr. only)
         Number of printers attached

(source: Peter Norton Programmer's Guide to the IBM PC, Microsoft Press '85)

Mask out all the irrelevant bits and interprete the remaining number.

-- 
Colin Sachs    -    csachs@oucsace.cs.ohiou.edu

   "I believe in everything; nothing is sacred.
    I believe in nothing; everything is sacred."  -the Chink