Mail Archives: djgpp/1999/10/24/09:51:32
On Fri, 22 Oct 1999, Francisco Pastor wrote:
> I use a handler interrupt with gcc in djgpp for control a serial port
> comuncation and when I write a large buffer of data to the disk in a
> file it apear overun erros in the receiver of the serial port. It seems
> that when a program call a dos service switching to real mode the
> interrupts are disabled.
Interrupts are NOT disabled when you call a real-mode service, but:
- DOS itself (and sometimes BIOS) disable interrupts when they wait
for I/O to complete in some tight loops;
- When a hardware interrupt happens in the middle of a DOS call, it
needs to be ``reflected'' to the protected-mode handler. This
reflection requires a costly mode switch to protected mode and
back, which incurs an overhead, and thus you could lose interrupts
if they come in at a hight rate.
> Somebody know if is posible to avoid this problem.
The usual way to avoid this is to drop the CS bit while you call DOS,
or use some other mechanism, like software flow-control, to tell the
other side of the link not to send data while you are in a DOS call.
You can also try to avoid calling DOS to write large chunks of data,
write it in smaller chunks, and make sure your system is set up for
efficient disk operations. But this isn't 100% safe.
- Raw text -