[comp.misc] Need program to show available drives

ccastsc@pyr.gatech.EDU (KEITH SCHAMIS) (08/11/88)

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?

Thanks in advance


-- 
KEITH SCHAMIS
Georgia Insitute of Technology, Atlanta Georgia, 30332
uucp: ...!{akgua,allegra,amd,hplabs,ihnp4,seismo,ut-ngp}!gatech!gitpyr!ccastsc
ARPA: ccastsc@pyr.ocs.gatech.edu

cdold@starfish.Convergent.COM (Clarence Dold) (08/13/88)

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.