C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28629
Number of posts: 94611

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
using Interrupt 13h extensions Posted by masroor on 17 May 2006 at 4:24 AM
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??
Report
Re: using Interrupt 13h extensions Posted by stober on 17 May 2006 at 5:20 AM
: 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.
Report
Re: using Interrupt 13h extensions Posted by masroor on 17 May 2006 at 8:02 AM
: : 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
Report
Re: using Interrupt 13h extensions Posted by shaolin007 on 17 May 2006 at 10:35 AM
: : : 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
:


How are you trying to implement it in C. Post your code.


Report
Re: using Interrupt 13h extensions Posted by stober on 17 May 2006 at 12:43 PM
: 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.
Report
Re: using Interrupt 13h extensions Posted by masroor on 18 May 2006 at 7:19 AM
: : 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 <stdio.h>
#include <dos.h>

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("\n%u",ret);
printf("\n dx = %u",o.x.dx);// prints the number of clusters
printf("\n al = %u",o.h.al);// sectors per cluster
printf("\n cx = %u",o.x.cx);// bytes per sector
// printf("\n bx = %x",o.x.bx); // DS:BX segment offset of media descriptor
getch();
}

Report
Re: using Interrupt 13h extensions Posted by shaolin007 on 18 May 2006 at 8:53 AM

I found this example code in assembler for you to go by.

; 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





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.