Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INT25 Disk Read, Struct Problem

Status
Not open for further replies.

kben

Technical User
Oct 7, 2001
1
US
Hi, I am trying to use INT25 to read a sector from the hard
drive. I need to pass this packet to the int25 function

Format of disk read packet:
Offset Size Description
00h DWORD sector number
04h WORD number of sectors to read
06h DWORD transfer address

I created this struct
struct parm_block {
unsigned long start_sector;
unsigned num_of_sectors;
char far *buffer;
};
struct parm_block p_block;

/* construct parameter block */

p_block.start_sector = 0;
p_block.num_of_sectors = 1;
p_block.buffer = (char *) farmalloc(bufsize) ; /* buffer for 1 sector */

/* call function */
inregs.h.al = 0x02;
inregs.x.cx = 0xffff;
inregs.x.bx = FP_OFF(p_block);
segregs.ds = FP_SEG(p_block);

int86x(0x25, &inregs, &outregs, &segregs);

The FP_OFF does not return the proper address, the original code was for MS C 5.1 I am using TurboC 2.0, is their a way
to get the proper offset for the struct p_block.
 
in my opinion (if you're using borlandC++) see in bios.h are some functions what read sectors, format them... Ion Filipski
1c.bmp


filipski@excite.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top