| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | HD - Detected as floppy? |
Tim Strike wrote in a message to All:
TS> I'm using the following assembly code to try and determine
TS> the drive type. The reason I'm using this code is because
TS> it's a DOS program running in a OS/2 session (but
TS> potentially running on just vanilla DOS or Win95, or
TS> whatever).
TS> mov bl,b ; b contains the drive
TS> add bl,1 ; adjust drive (for proper #)
TS> mov ax,$4408 ; set I/O function
TS> int $21 ; call INT 21
TS> jc {at}nodrive ; not a valid drive (oops)
TS> cmp ax,0 ; check
TS> je {at}floppy ; if zero, it's a floppy!
TS> mov al,2 ; set as type HD
TS> jmp {at}done
TS> {at}floppy:
TS> mov al,1 ; floppy found!
TS> jmp {at}done
TS> {at}nodrive:
TS> mov al,0
TS> {at}done:
--------D-214408-----------------------------
INT 21 - DOS 3.0+ - IOCTL - CHECK IF BLOCK DEVICE REMOVABLE
AX = 4408h
BL = drive number (00h = default, 01h = A:, etc)
Return: CF clear if successful
AX = media type (0000h removable, 0001h fixed)
CF set on error
AX = error code (01h,0Fh) (see #0811 at AH=59h)
SeeAlso: AX=4400h,AX=4409h,INT 2F/AX=122Bh
TS> Now, under an OS/2 DOS box with HPFS, this returns the drive
TS> type as "floppy" when it's really a HD. This works fine
TS> under DOS 6.22/Win95 without a problem.
TS> Does OS/2 return something for this function call? Does it
TS> return different values for this function call? Is there
TS> another interupt I can call instead?
TS> And no, I'm not presently an OS/2 user . . . just trying to
TS> track down a bug, that's all . . . otherwise I'd check myself.
It works as expected on my OS/2 system using the 8.241 (FP17) kernel.
My C: partition is HPFS:
-a100
1656:0100 mov bl,3
1656:0102 mov ax,4408
1656:0105 int 21
1656:0107 int 3
1656:0108
-g=100
AX=0001 BX=0003 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=1656 ES=1656 SS=1656 CS=1656 IP=0107 NV UP EI PL NZ NA PO NC
1656:0107 CC INT 3
It also works as expected on my D: partition, which is FAT:
-a100
1656:0100 mov bl,4
1656:0102 mov ax,4408
1656:0105 int 21
1656:0107 int 3
1656:0108
-g=100
AX=0001 BX=0004 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=1656 ES=1656 SS=1656 CS=1656 IP=0107 NV UP EI PL NZ NA PO NC
1656:0107 CC INT 3
My A: floppy is correctly shown as a floppy:
-a100
1656:0100 mov bl,1
1656:0102 mov ax,4408
1656:0105 int 21
1656:0107 int 3
1656:0108
-g=100
AX=0000 BX=0001 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=1656 ES=1656 SS=1656 CS=1656 IP=0107 NV UP EI PL NZ NA PO NC
1656:0107 CC INT 3
Surprisingly, my CD-ROM on E: generates an error with the carry bit set:
-a100
1656:0100 mov bl,5
1656:0102 mov ax,4408
1656:0105 int 21
1656:0107 int 3
1656:0108
-g=100
AX=0001 BX=0005 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=1656 ES=1656 SS=1656 CS=1656 IP=0107 NV UP EI PL NZ NA PO CY
1656:0107 CC INT 3
Be aware that the DOS version comes back as 20.30 under OS/2:
-a100
1656:0100 mov ah,30
1656:0102 int 21
1656:0104 int 3
1656:0105
-g=000
AX=1E14 BX=0000 CX=0000 DX=0000 SP=FFEE BP=0000 SI=0000 DI=0000
DS=1656 ES=1656 SS=1656 CS=1656 IP=0104 NV UP EI PL NZ NA PO NC
1656:0104 CC INT 3
If you want to pursue this further, the OS2DOS echo is probably appropriate.
-- Mike
---
* Origin: N1BEE BBS +1 401 944 8498 V.34/V.FC/V.32bis/HST16.8 (1:323/107)SEEN-BY: 50/99 270/101 620/243 711/401 409 410 413 430 808 809 934 955 SEEN-BY: 712/407 515 517 628 713/888 800/1 @PATH: 323/107 396/1 270/101 712/515 711/808 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.