Date: Tue, 22 Oct 1996 08:24:48 +0200 (IST) From: Eli Zaretskii To: Jon Slaughter Cc: djgpp AT delorie DOT com Subject: Re: protected mode -> real mode help. In-Reply-To: <326AB9FD.6CDF@iamerica.net> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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.