Xref: utzoo comp.sys.ibm.pc:18056 comp.misc:3095
Path: utzoo!utgpu!attcan!uunet!peregrine!elroy!ames!amdahl!pyramid!ctnews!starfish!cdold
From: cdold@starfish.Convergent.COM (Clarence Dold)
Newsgroups: comp.sys.ibm.pc,comp.misc
Subject: Re: Need program to show available drives
Message-ID: <632@starfish.Convergent.COM>
Date: 12 Aug 88 18:24:20 GMT
References: <6232@pyr.gatech.EDU>
Distribution: na
Organization: Convergent Technologies, San Jose, CA
Lines: 31

From article <6232@pyr.gatech.EDU>, by ccastsc@pyr.gatech.EDU (KEITH SCHAMIS):
> I need a program that runs on a ps/2 that can be called from a C program and    will return the values of the drives available on the machine.  Is there an     interrupt available that tells me that a drive is unavailable when I try to     access it?

AT (PC?) BIOS:
INT 13H, AH = 08H - Get Current Drive Parameters
Input:	AH = 	08h
	DL =	Drive Select:
		00h Drive A
		01h Drive B
		80h Drive C
		81h Drive D
	
Return:	AX = 	0
	BH = 	0
	BL = 	Drive Type from CMOS RAM
	CH =	Bits 0 to 7 of maximum number of cylinders
	CL =	Bits 7 and 6 are bits 9 and 8 of maximum cylinder number
		Bits 5-0 are maximum number of sectors per track
		DH =	Maximum number of heads
		DL =	Number of drives
	ES:DI =	DPB address

INT 13, AH = 10H - Test Drive Ready
Input:	AH =	10h
	DL =	Drive Select
Return:	AH =	00h Drive is ready
	CF = 	00h Succesful completion
		01h AH contains error code


In Microsoft C, int86() will give access to BIOS INTs.