Int 25 (Absolute Disk Read)

How do I execute an Interupt 25 to read sectors from a hard drive.
I can execute an Int 25 (Absolute Disk Read) on the A or B Drive but NOT the C Drive.
Registers AL, CX, DX, and DS:BX are set to appropriate values but Int 25 returns the error code 0207 in AX.
My DOS manual states this to be -
02 - Bad address mark,
07 - Unknown media type
but this is almost meaningless to me, is a call to another Interupt required for DOS to 'know' the media type.
I've tried my code on two seperate machines, on both I can read the A drive but not the C drive.

Any help would be greatly appreciated
Simon 204


Comments

  • Drive C is drive 2 for int25 and int26 ..
    Do you work under dos or windows?

  • : Drive C is drive 2 for int25 and int26 ..
    : Do you work under dos or windows?
    :
    :
    The following two (2) pieces of code are what I'm using,
    The first reads the root directory from the 'A' drive successfully.
    The second "should" read the root directory from my 'C' drive, BUT,
    it returns the error code [0207] in Ax, and the carry flag set.

    mov ax, 0 ; 0 = A, 1 = B, 2 = C Drive
    mov bx, 1000 ; offset of data buffer area
    mov cx, 20 ; number of sectors to be read (total size of the root dir)
    mov dx, 13 ; sector to be read (the first sector of the root dir)
    int 25 ; ****(Absolute disk read)****
    int 3



    mov ax, 2 ; 0 = A, 1 = B, 2 = C Drive
    mov bx, 1000 ; offset of data buffer area
    mov cx, 20 ; number of sectors to be read
    mov dx, 15d ; sector to be read
    int 25 ; ****(Absolute disk read)****
    int 3

    The code is entered via a script file (.scr) of plain vanilla dos-text,
    and processed with Debug.

    I have tried this with the same results on :-
    a 486DX2 running MS-DOS 6.21 and from a dos window within Windows 3.11,
    with the default drive = A, B and C.
    and also a Pentium from DOS and also from a dos window within Windows 95.

    I've tried using INT 21 function 1A to pre-set the DTA,
    I've tried using INT 21 function 0E to set the default drive,
    I've tried using INT 21 function 1C to get drive info,
    I've tried using INT 13 function
    with out any change.

    DOS is able to access the C drive normally,
    Debug will access the C drive using, -L 1000 2 15d 20

    I've read more on DOS Interupts, the FAT, PSP, sector and clusters in the last three weeks than most mortal men would ever want to know, and I still can't get INT 25 to read my hard drive.

    Please help !
    Simon 204

  • I've found referance (on Ralf Browns Interupt List) to a second form of use of INT 25 for disks larger than 32 Meg. This may be the answer I'm looking for, I'm still looking.

    Simon 204
  • I tryed your code in my pc .. but the INT25 return 0207h in AX

    If you have a C compiler for msdos, please try with absread and abswrite ...

    cod

  • : I tryed your code in my pc .. but the INT25 return 0207h in AX
    :
    : If you have a C compiler for msdos, please try with absread and abswrite ...
    :
    : cod
    :
    :
    I HAVE THE ANSWER !!!

    There is a second format for the Int 25 & 26,
    for use with a disk that has a capacity greater than 32 Mb,
    ie, requiring more than 16 bit addresses for that number of sectors.

    Ralf Brown's Interrupt List put me in the write dirrection,
    HelpPC 2.1, I found very criptic,
    but the second edition of 'Advanced Programming MS-DOS' by Ray Duncan made everything so easy. Ironically I have a copy of the first edition but it makes no metion of the 32 Meg restriction, the library holding a copy of the 2nd edition has been closed for three weeks while they rearrange the shelves.

    Thank you for your assistance
    Happy thoughts from Western Australia
    Simon



  • : : I tryed your code in my pc .. but the INT25 return 0207h in AX
    : :
    : : If you have a C compiler for msdos, please try with absread and abswrite ...
    : :
    : : cod
    : :
    : :
    : I HAVE THE ANSWER !!!
    :
    : There is a second format for the Int 25 & 26,
    : for use with a disk that has a capacity greater than 32 Mb,
    : ie, requiring more than 16 bit addresses for that number of sectors.
    :
    : Ralf Brown's Interrupt List put me in the write dirrection,
    : HelpPC 2.1, I found very criptic,
    : but the second edition of 'Advanced Programming MS-DOS' by Ray Duncan made everything so easy. Ironically I have a copy of the first edition but it makes no metion of the 32 Meg restriction, the library holding a copy of the 2nd edition has been closed for three weeks while they rearrange the shelves.
    :
    : Thank you for your assistance
    : Happy thoughts from Western Australia
    : Simon
    :

    ===============================================================


    Simon:
    I am also trying to get INT 25H read to work for >32MB with little success. I believe my WORD and DWORD formats for the 'disk read packets' may be incorrect.
    1. Did you obtain Duncan 2nd edition?
    2. Have you made >32MB work?
    3. Did you use AL=80H for C:
    4. What does your 'disk read packet' look like in RAM when using the DEBUG d- command? Any spaces between the three sets of packet numbers? Are the DWORD numbers ordered backwards? Least significant first, most significant second?
    DWORD (Starting sector number)
    WORD (Number of sectors)
    DWORD (Buffer transfer address)
    5. What does your working code for C: look like? Thanks, triggerme
  • [green]
    INT 13h AH=2 read sectors into memory
    looks interesting, ya might try that.
    I thought INT 25h was for small disks & INT 13h was for larger disks?
    Since you've got Ralf Browns int list, look around in the INT 13 area,
    there are a bunch of DISK interrupts there.
    Bitdog
    [/green]

  • : : : I tryed your code in my pc .. but the INT25 return 0207h in AX
    : : :
    : : : If you have a C compiler for msdos, please try with absread and abswrite ...
    : : :
    : : : cod
    : : :
    : : :
    : : I HAVE THE ANSWER !!!
    : :
    : : There is a second format for the Int 25 & 26,
    : : for use with a disk that has a capacity greater than 32 Mb,
    : : ie, requiring more than 16 bit addresses for that number of sectors.
    : :
    : : Ralf Brown's Interrupt List put me in the write dirrection,
    : : HelpPC 2.1, I found very criptic,
    : : but the second edition of 'Advanced Programming MS-DOS' by Ray Duncan made everything so easy. Ironically I have a copy of the first edition but it makes no metion of the 32 Meg restriction, the library holding a copy of the 2nd edition has been closed for three weeks while they rearrange the shelves.
    : :
    : : Thank you for your assistance
    : : Happy thoughts from Western Australia
    : : Simon
    : :
    :
    : ===============================================================
    :
    :
    : Simon:
    : I am also trying to get INT 25H read to work for >32MB with little success. I believe my WORD and DWORD formats for the 'disk read packets' may be incorrect.
    : 1. Did you obtain Duncan 2nd edition?
    : 2. Have you made >32MB work?
    : 3. Did you use AL=80H for C:
    : 4. What does your 'disk read packet' look like in RAM when using the DEBUG d- command? Any spaces between the three sets of packet numbers? Are the DWORD numbers ordered backwards? Least significant first, most significant second?
    : DWORD (Starting sector number)
    : WORD (Number of sectors)
    : DWORD (Buffer transfer address)
    : 5. What does your working code for C: look like? Thanks, triggerme
    :

    triggerme
    1 Yes, Duncan 2nd edition shows a second form of Int 25 & 26.
    HelpPc 2.1 also shows the second form referring to it as for DOS 4 and above.
    2 Yes, it dose work and I will send the details after checking my notes. The crux of it all is that any disk >32 Mb requires more than a 16 bit address for that number of sectors, hence Ax is not big enough.
    3 I can't remember the exact format off hand, I will check my notes and get back to you, rather than lead you astray.
    4 Yes, DWORDs use the little indian convention. No spaces.
    5 I didn't use C, only debug.
    Simon
  • : : : : I tryed your code in my pc .. but the INT25 return 0207h in AX
    : : : :
    : : : : If you have a C compiler for msdos, please try with absread and abswrite ...
    : : : :
    : : : : cod
    : : : :
    : : : :
    : : : I HAVE THE ANSWER !!!
    : : :
    : : : There is a second format for the Int 25 & 26,
    : : : for use with a disk that has a capacity greater than 32 Mb,
    : : : ie, requiring more than 16 bit addresses for that number of sectors.
    : : :
    : : : Ralf Brown's Interrupt List put me in the write dirrection,
    : : : HelpPC 2.1, I found very criptic,
    : : : but the second edition of 'Advanced Programming MS-DOS' by Ray Duncan made everything so easy. Ironically I have a copy of the first edition but it makes no metion of the 32 Meg restriction, the library holding a copy of the 2nd edition has been closed for three weeks while they rearrange the shelves.
    : : :
    : : : Thank you for your assistance
    : : : Happy thoughts from Western Australia
    : : : Simon
    : : :
    : :
    : : ===============================================================
    : :
    : :
    : : Simon:
    : : I am also trying to get INT 25H read to work for >32MB with little success. I believe my WORD and DWORD formats for the 'disk read packets' may be incorrect.
    : : 1. Did you obtain Duncan 2nd edition?
    : : 2. Have you made >32MB work?
    : : 3. Did you use AL=80H for C:
    : : 4. What does your 'disk read packet' look like in RAM when using the DEBUG d- command? Any spaces between the three sets of packet numbers? Are the DWORD numbers ordered backwards? Least significant first, most significant second?
    : : DWORD (Starting sector number)
    : : WORD (Number of sectors)
    : : DWORD (Buffer transfer address)
    : : 5. What does your working code for C: look like? Thanks, triggerme
    : :
    :
    : triggerme
    : 1 Yes, Duncan 2nd edition shows a second form of Int 25 & 26.
    : HelpPc 2.1 also shows the second form referring to it as for DOS 4 and above.
    : 2 Yes, it dose work and I will send the details after checking my notes. The crux of it all is that any disk >32 Mb requires more than a 16 bit address for that number of sectors, hence Ax is not big enough.
    : 3 I can't remember the exact format off hand, I will check my notes and get back to you, rather than lead you astray.
    : 4 Yes, DWORDs use the little indian convention. No spaces.
    : 5 I didn't use C, only debug.
    : Simon
    :
    Simon: 10/08/03
    Thanks for any help. I am trying to read the root directory of drives that are larger than 32MB in size. I am working on an x86 application where I want to be able to read the file directory contents of the HDD and this wants to cover HDD of any size available. I have made INT25 work for floppies, now I need HDDs. Do you have the starting number sector for the root directory? Sorry, when I asked '5. What does your working code for C: look like? ', I meant for the C: HDD.
    triggerme
  • : : : : : I tryed your code in my pc .. but the INT25 return 0207h in AX
    : : : : :
    : : : : : If you have a C compiler for msdos, please try with absread and abswrite ...
    : : : : :
    : : : : : cod
    : : : : :
    : : : : :
    : : : : I HAVE THE ANSWER !!!
    : : : :
    : : : : There is a second format for the Int 25 & 26,
    : : : : for use with a disk that has a capacity greater than 32 Mb,
    : : : : ie, requiring more than 16 bit addresses for that number of sectors.
    : : : :
    : : : : Ralf Brown's Interrupt List put me in the write dirrection,
    : : : : HelpPC 2.1, I found very criptic,
    : : : : but the second edition of 'Advanced Programming MS-DOS' by Ray Duncan made everything so easy. Ironically I have a copy of the first edition but it makes no metion of the 32 Meg restriction, the library holding a copy of the 2nd edition has been closed for three weeks while they rearrange the shelves.
    : : : :
    : : : : Thank you for your assistance
    : : : : Happy thoughts from Western Australia
    : : : : Simon
    : : : :
    : : :
    : : : ===============================================================
    : : :
    : : :
    : : : Simon:
    : : : I am also trying to get INT 25H read to work for >32MB with little success. I believe my WORD and DWORD formats for the 'disk read packets' may be incorrect.
    : : : 1. Did you obtain Duncan 2nd edition?
    : : : 2. Have you made >32MB work?
    : : : 3. Did you use AL=80H for C:
    : : : 4. What does your 'disk read packet' look like in RAM when using the DEBUG d- command? Any spaces between the three sets of packet numbers? Are the DWORD numbers ordered backwards? Least significant first, most significant second?
    : : : DWORD (Starting sector number)
    : : : WORD (Number of sectors)
    : : : DWORD (Buffer transfer address)
    : : : 5. What does your working code for C: look like? Thanks, triggerme
    : : :
    : :
    : : triggerme
    : : 1 Yes, Duncan 2nd edition shows a second form of Int 25 & 26.
    : : HelpPc 2.1 also shows the second form referring to it as for DOS 4 and above.
    : : 2 Yes, it dose work and I will send the details after checking my notes. The crux of it all is that any disk >32 Mb requires more than a 16 bit address for that number of sectors, hence Ax is not big enough.
    : : 3 I can't remember the exact format off hand, I will check my notes and get back to you, rather than lead you astray.
    : : 4 Yes, DWORDs use the little indian convention. No spaces.
    : : 5 I didn't use C, only debug.
    : : Simon
    : :
    : Simon: 10/08/03
    : Thanks for any help. I am trying to read the root directory of drives that are larger than 32MB in size. I am working on an x86 application where I want to be able to read the file directory contents of the HDD and this wants to cover HDD of any size available. I have made INT25 work for floppies, now I need HDDs. Do you have the starting number sector for the root directory? Sorry, when I asked '5. What does your working code for C: look like? ', I meant for the C: HDD.
    : triggerme
    :

    triggerme mate

    the following may help

    INT 25
    Parameter Block Format for disk drives with a capacity > 32 Mb

    Offset Size Description

    00 dword 32 bit starting sector
    04 word number of sectors to read
    06 word pointer to offset of buffer
    08 word pointer to segment of buffer

    AL = logical drive number (0=A:, 1=B:, 2=C:, ...)
    CX = -1 (FFFF)
    DX = starting logical sector number (see below for DOS 4.x+)
    DS:BX = pointer to control block (Parameter Block)


    The following text, (in a script file & run via debug) will read sector 15D hex
    from the hard drive into memory location CS:1000.

    The first sector of the root directory on your hard drive can be
    calculated from the information held in the Boot Sector of that
    drive. HelpPc 2.1 or Duncan will give the formula and location
    of each term in the formula.



    a 100
    push bp ;save old pointer
    mov bp, 0140 ; new Parameter Block pointer
    mov ax, ds
    mov [bp + 8], ax ; put DS into parameter block
    mov ax, 2 ;put drive number into AL
    xor ah,ah
    mov bx, bp ;pointer to transfer address
    mov cx, ffff
    int 25h ;BIOS call
    jc 150 ; on error jump to error handler
    Popf ;remove flags int 0x25 left on stack
    pop bp ;restore original frame pointer
    int 3


    a 0140
    db 5D 01 00 00 ; 32 bit sector number
    db 20 00 ; number of sectors to read Parameter
    db 00 10 ; offset of DTA (Buffer) / Block

    r cx

    60

    n sect-rd.com

    w 100

    q


    Simon 204---------------------End of File--------------------------

  • : : : : : : I tryed your code in my pc .. but the INT25 return 0207h in AX
    : : : : : :
    : : : : : : If you have a C compiler for msdos, please try with absread and abswrite ...
    : : : : : :
    : : : : : : cod
    : : : : : :
    : : : : : :
    : : : : : I HAVE THE ANSWER !!!
    : : : : :
    : : : : : There is a second format for the Int 25 & 26,
    : : : : : for use with a disk that has a capacity greater than 32 Mb,
    : : : : : ie, requiring more than 16 bit addresses for that number of sectors.
    : : : : :
    : : : : : Ralf Brown's Interrupt List put me in the write dirrection,
    : : : : : HelpPC 2.1, I found very criptic,
    : : : : : but the second edition of 'Advanced Programming MS-DOS' by Ray Duncan made everything so easy. Ironically I have a copy of the first edition but it makes no metion of the 32 Meg restriction, the library holding a copy of the 2nd edition has been closed for three weeks while they rearrange the shelves.
    : : : : :
    : : : : : Thank you for your assistance
    : : : : : Happy thoughts from Western Australia
    : : : : : Simon
    : : : : :
    : : : :
    : : : : ===============================================================
    : : : :
    : : : :
    : : : : Simon:
    : : : : I am also trying to get INT 25H read to work for >32MB with little success. I believe my WORD and DWORD formats for the 'disk read packets' may be incorrect.
    : : : : 1. Did you obtain Duncan 2nd edition?
    : : : : 2. Have you made >32MB work?
    : : : : 3. Did you use AL=80H for C:
    : : : : 4. What does your 'disk read packet' look like in RAM when using the DEBUG d- command? Any spaces between the three sets of packet numbers? Are the DWORD numbers ordered backwards? Least significant first, most significant second?
    : : : : DWORD (Starting sector number)
    : : : : WORD (Number of sectors)
    : : : : DWORD (Buffer transfer address)
    : : : : 5. What does your working code for C: look like? Thanks, triggerme
    : : : :
    : : :
    : : : triggerme
    : : : 1 Yes, Duncan 2nd edition shows a second form of Int 25 & 26.
    : : : HelpPc 2.1 also shows the second form referring to it as for DOS 4 and above.
    : : : 2 Yes, it dose work and I will send the details after checking my notes. The crux of it all is that any disk >32 Mb requires more than a 16 bit address for that number of sectors, hence Ax is not big enough.
    : : : 3 I can't remember the exact format off hand, I will check my notes and get back to you, rather than lead you astray.
    : : : 4 Yes, DWORDs use the little indian convention. No spaces.
    : : : 5 I didn't use C, only debug.
    : : : Simon
    : : :
    : : Simon: 10/08/03
    : : Thanks for any help. I am trying to read the root directory of drives that are larger than 32MB in size. I am working on an x86 application where I want to be able to read the file directory contents of the HDD and this wants to cover HDD of any size available. I have made INT25 work for floppies, now I need HDDs. Do you have the starting number sector for the root directory? Sorry, when I asked '5. What does your working code for C: look like? ', I meant for the C: HDD.
    : : triggerme
    : :
    :
    : triggerme mate
    :
    : the following may help
    :
    : INT 25
    : Parameter Block Format for disk drives with a capacity > 32 Mb
    :
    : Offset Size Description
    :
    : 00 dword 32 bit starting sector
    : 04 word number of sectors to read
    : 06 word pointer to offset of buffer
    : 08 word pointer to segment of buffer
    :
    : AL = logical drive number (0=A:, 1=B:, 2=C:, ...)
    : CX = -1 (FFFF)
    : DX = starting logical sector number (see below for DOS 4.x+)
    : DS:BX = pointer to control block (Parameter Block)
    :
    :
    : The following text, (in a script file & run via debug) will read sector 15D hex
    : from the hard drive into memory location CS:1000.
    :
    : The first sector of the root directory on your hard drive can be
    : calculated from the information held in the Boot Sector of that
    : drive. HelpPc 2.1 or Duncan will give the formula and location
    : of each term in the formula.
    :
    :
    :
    : a 100
    : push bp ;save old pointer
    : mov bp, 0140 ; new Parameter Block pointer
    : mov ax, ds
    : mov [bp + 8], ax ; put DS into parameter block
    : mov ax, 2 ;put drive number into AL
    : xor ah,ah
    : mov bx, bp ;pointer to transfer address
    : mov cx, ffff
    : int 25h ;BIOS call
    : jc 150 ; on error jump to error handler
    : Popf ;remove flags int 0x25 left on stack
    : pop bp ;restore original frame pointer
    : int 3
    :
    :
    : a 0140
    : db 5D 01 00 00 ; 32 bit sector number
    : db 20 00 ; number of sectors to read Parameter
    : db 00 10 ; offset of DTA (Buffer) / Block
    :
    : r cx
    :
    : 60
    :
    : n sect-rd.com
    :
    : w 100
    :
    : q
    :
    :
    : Simon 204

    ===================================================================

    Simon: 10/13/03
    Thanks for your reply. I will try it out. I have tried to get access to Duncan but no luck (too old). I will check with HelpPc 2.1.
    triggerme mate!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories