Thread View: comp.sys.ibm.pc.programmer
2 messages
2 total messages
Started by Thomas Dwyer III
Tue, 26 Jun 1990 16:40
how do you detect a hard drive?
Author: Thomas Dwyer III
Date: Tue, 26 Jun 1990 16:40
Date: Tue, 26 Jun 1990 16:40
9 lines
916 bytes
916 bytes
Hi there. I've been programming the PCs for years, and this may be a silly question, but what is the best method to determine if a hard drive exists on a machine (PC through PS/2 models)? Examples in ASM or C would be appreciated. Thomas Dwyer III TOMIII @ MTUS5.BITNET Network Programmer Michigan Technological University
Re: how do you detect a hard drive?
Author: Dhanapong Saengrussamee, Univers...
Date: Wed, 27 Jun 1990 18:13
Date: Wed, 27 Jun 1990 18:13
40 lines
2110 bytes
2110 bytes
In article <90177.114030TOMIII@MTUS5.BITNET>,
TOMIII@MTUS5.BITNET (Thomas Dwyer III) writes:
> Hi there. I've been programming the PCs for years, and this may be a
> silly question, but what is the best method to determine if a hard
> drive exists on a machine (PC through PS/2 models)? Examples in ASM
> or C would be appreciated.
>
> Thomas Dwyer III
--
Have you try Intr $21 function $1C yet? Call with AH = $1C and DL is the drive
number in question (0=default, 1=A, 2=B, ...). Look at the first byte of the
return at DS:BX, if it is $0F8 then it is harddisk. It's worked for me...
Something like:
MOV AH,1CH
MOV DL,03H ;drive code, 0 default, 1=A, 2=B, ...
INT 21H
CMP BYTE PTR DS:[BX],0F8H
JE FIXED
JMP FLOPPY
FIXED: .....
FLOPPY: .....
should work, methink ;-}.
__Mouse.o()~
-----------------------------------+------------------------------------------
Dhanapong "Mouse" Saengrussamee | AppleLink : U1364 | BITNET : mouse@untvax
Technical Support, CECS Dept., | BIX : d.mouse.s | CompuServe : 71301,1516
University of North Texas, | GENie : d.saengrussa | IP : 129.120.1.4
PO Box 5155, Denton, TX 76203-5155 | Internet : mouse@vaxb.acs.unt.edu
voice (817) 565-4379 | SPAN : utspan::utandx::untvax::mouse
fax (817) 565-4425 | THENet : untvax::mouse
------------------- UUCP : {...!uunet!convex!iex}!ntvax!vaxb.acs.unt.edu!mouse
This is not the end. <-- This is a quote from a movie not a
This is not the beginning of the end. < disclaimer. I am, just a graduate
This is the end of the beginning. < student, not allowed to disclaim
- R. Sherman < anything.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads