views:

192

answers:

2

I want fetch the parameters of my hard disk. Using the technique described here.

  • This is code showing normal parameters of floppy disk:

    mov dl,00h
    mov ah,08h
    int 13h
    
  • This is code, showing not valid parameters of hard disk (may be, my hard disk space is big (LBA)):

    mov dl,80h 
    mov ah,08h 
    int 13h
    
  • And I've written this code:

    mov dl,80h
    mov ah,48h
    int 13h
    

The code is giving cf = 1(error). How do I fix it?

+3  A: 

On error, AH should contain the error code. What was it?

Ralf Brown's (excellent) interrupt list details them:

 00h    successful completion
 01h    invalid function in AH or invalid parameter
 02h    address mark not found
 03h    disk write-protected
 04h    sector not found/read error
 05h    reset failed (hard disk)
 05h    data did not verify correctly (TI Professional PC)
 06h    disk changed (floppy)
 07h    drive parameter activity failed (hard disk)
 08h    DMA overrun
 09h    data boundary error (attempted DMA across 64K boundary or >80h sectors)
 0Ah    bad sector detected (hard disk)
 0Bh    bad track detected (hard disk)
 0Ch    unsupported track or invalid media
 0Dh    invalid number of sectors on format (PS/2 hard disk)
 0Eh    control data address mark detected (hard disk)
 0Fh    DMA arbitration level out of range (hard disk)
 10h    uncorrectable CRC or ECC error on read
 11h    data ECC corrected (hard disk)
 20h    controller failure
 31h    no media in drive (IBM/MS INT 13 extensions)
 32h    incorrect drive type stored in CMOS (Compaq)
 40h    seek failed
 80h    timeout (not ready)
 AAh    drive not ready (hard disk)
 B0h    volume not locked in drive (INT 13 extensions)
 B1h    volume locked in drive (INT 13 extensions)
 B2h    volume not removable (INT 13 extensions)
 B3h    volume in use (INT 13 extensions)
 B4h    lock count exceeded (INT 13 extensions)
 B5h    valid eject request failed (INT 13 extensions)
 B6h    volume present but read protected (INT 13 extensions)
 BBh    undefined error (hard disk)
 CCh    write fault (hard disk)
 E0h    status register error (hard disk)
 FFh    sense operation failed (hard disk)

You also don't specify what your DS:SI is set to to recive the information. Has that been set correctly?


From your comment:

01h invalid function in AH or invalid parameter.

Check to see if the INT13 extensions are available for your BIOS. AH = 41h, DL = 80h (first drive), BX = 55AAh, INT13, carry will be clear on return if extensions are there.

paxdiablo
01h invalid function in AH or invalid parameter.|What I am don't doing ?
GLeBaTi
Does your BIOS support extensions? Int13/Ah=41 should be able to tell you that.
paxdiablo
@paxdiablo, could you please add a link to Ralf Brown's (excellent, I am sure!) interrupt list details, so people know your source?
Oddthinking
Done, @Oddthinking. Thanks for that good suggestion.
paxdiablo
Result of int 13h, ah=41hhttp://s39.radikal.ru/i084/1006/68/2d2518e06633.jpg
GLeBaTi
Your carry flag is set to 1 in that screen capture. Hence your BIOS does not support the extensions. Hence why your original call is complaining. What exactly is wrong the the AH=08h call? You might have to find another way to do what you want.
paxdiablo
Thank you very much.
GLeBaTi
A: 

Some computers do not save your ds and es registers properly so these should be restored upon returning from int-13 function-48 also check the buffer size as 1A 1E or 42 depending on version.

Big-G