using Interrupt 13h extensions - Programmers Heaven

Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

using Interrupt 13h extensions

masroormasroor Posts: 12Member
Hi all
using the traditional 13h functions we can access only 8GB harddisks but in case we want to access >8GB we need to use 13h extension. assuming that BIOS supports these extensions how exactly do we use these interrupts (running from 41h to 49h and 51h) in C programming and which registers are to used (if any) and how exactly do we pass the LBA values.
Any ideas guys??

Comments

  • stoberstober Posts: 9,765Member ✭✭✭
    : Hi all
    : using the traditional 13h functions we can access only 8GB harddisks but in case we want to access >8GB we need to use 13h extension. assuming that BIOS supports these extensions how exactly do we use these interrupts (running from 41h to 49h and 51h) in C programming and which registers are to used (if any) and how exactly do we pass the LBA values.
    : Any ideas guys??
    :


    http://home.teleport.com/~brainy/diskaccess.htm

    have you read the above? I found it in about 5 seconds with goodle.
  • masroormasroor Posts: 12Member
    : : Hi all
    : : using the traditional 13h functions we can access only 8GB harddisks but in case we want to access >8GB we need to use 13h extension. assuming that BIOS supports these extensions how exactly do we use these interrupts (running from 41h to 49h and 51h) in C programming and which registers are to used (if any) and how exactly do we pass the LBA values.
    : : Any ideas guys??
    : :
    :
    :
    : http://home.teleport.com/~brainy/diskaccess.htm
    :
    : have you read the above? I found it in about 5 seconds with goodle.
    :

    hey stober
    thanks for replying
    as a matter of fact we did find out that link and many others similar to that but none actually show how it is being implemented. thats where our problem lies. we r trying to implement it in C but to no avail. the article that u mentioned does have the relevant information in theoretical sence but does not show which functions or registers to use.
    thanks tho
  • shaolin007shaolin007 Posts: 1,018Member
    : : : Hi all
    : : : using the traditional 13h functions we can access only 8GB harddisks but in case we want to access >8GB we need to use 13h extension. assuming that BIOS supports these extensions how exactly do we use these interrupts (running from 41h to 49h and 51h) in C programming and which registers are to used (if any) and how exactly do we pass the LBA values.
    : : : Any ideas guys??
    : : :
    : :
    : :
    : : http://home.teleport.com/~brainy/diskaccess.htm
    : :
    : : have you read the above? I found it in about 5 seconds with goodle.
    : :
    :
    : hey stober
    : thanks for replying
    : as a matter of fact we did find out that link and many others similar to that but none actually show how it is being implemented. thats where our problem lies. we r trying to implement it in C but to no avail. the article that u mentioned does have the relevant information in theoretical sence but does not show which functions or registers to use.
    : thanks tho
    :

    [green]
    How are you trying to implement it in C. Post your code.
    [/green]

  • stoberstober Posts: 9,765Member ✭✭✭
    : How are you trying to implement it in C. Post your code.
    :

    also, what compiler are you using? you will need a 16-bit compiler such as Turbo C.
  • masroormasroor Posts: 12Member
    : : How are you trying to implement it in C. Post your code.
    : :
    :
    : also, what compiler are you using? you will need a 16-bit compiler such as Turbo C.
    :

    hi stober
    we r using the 16-bit turbo c.
    we are novices in terms of programming using interrupts. we have written a few programs not worth mentioning as we r still having some problems with regard to passing and retriving values from segment registers.
    we have tried both the int86/int86x and the intdos/intdosx functions the former using the interrupt 13h
    we have been able to implement a few programs for floppy drives that read the fat information but none so far for fixed disks.
    what we may be looking for is a working program (example: calculating the capacity of a hard drive >8GB) so that we know how to use the the segment registers. most of programs that we have found over the internet use the indos functions or are in assembly language.
    i'm sending a code for getting FAT info of floppy drive
    //get FAT information for any drive
    // here we r trying to retrive FAT info of floppy drive
    #include
    #include

    void main()
    {
    union REGS i,o;
    unsigned int ret;
    clrscr();
    i.h.ah = 0x1C; // interrupt service #
    i.h.dl = 1; // for accessing a:
    ret = intdos(&i, &o);
    printf("
    %u",ret);
    printf("
    dx = %u",o.x.dx);// prints the number of clusters
    printf("
    al = %u",o.h.al);// sectors per cluster
    printf("
    cx = %u",o.x.cx);// bytes per sector
    // printf("
    bx = %x",o.x.bx); // DS:BX segment offset of media descriptor
    getch();
    }

  • shaolin007shaolin007 Posts: 1,018Member
    [green]
    I found this example code in assembler for you to go by.
    [/green]
    [code]
    ; Check for int 13h extensions
    xor bp, bp ; bp=0 means LBA, bp=1 means CHS
    mov ah, 41h
    mov bx, 55aah
    int 13h
    jc NoExtensions
    cmp bx, 0aa55h
    jnz NoExtensions
    test cl, 1
    jz SkipCHS
    [/code]

Sign In or Register to comment.