Mail Archives: djgpp/1996/10/22/02:56:00
On Sun, 20 Oct 1996, Jon Slaughter wrote:
> void read_sector(byte *buf)
> {
> __dpmi_regs r;
> byte *buffer;
> dosmemget(__tb, 512, &buffer);
> r.x.ax = 0x0201;
> r.x.cx = (track << 8) + sector;
> r.x.dx = (head << 8) + drive;
> r.x.es = __tb / 16;
> r.x.bx = __tb && 0x0f;
> __dpmi_int(0x13, &r);
>
> }
`dosmemget' is a function which fetches the data from the transfer buffer
to your buffer. Why in the world do you call it *before* issuing Int 13h
which brings the data into the transfer buffer? You should call it
*after* the interrupt.
And just FIY, the DJGPP C library already includes a function called
`biosdisk' that does all that for you. Look it up in the library docs.
- Raw text -