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.
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.