Date: Sun, 26 Jan 1997 18:31:24 +0200 (IST) From: Eli Zaretskii To: John Eccleston cc: djgpp AT delorie DOT com Subject: Re: Help: Keyboard interrupt In-Reply-To: <854022514.613673@red.parallax.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 23 Jan 1997, John Eccleston wrote: > Currently if you hit a key whilst the program is running it completes > but does not re assign the old keyboard handler, and also if you press > several keys it only counts to 1 and misses the others. That's because you don't send the EOI (End Of Interrupt) command to the Interrupt Controller, so it blocks any further interrupts from reaching the CPU. You should write the value 20h to the port number 20h. > Is it OK to write an interrupt handler in C if you lock the code and > data? I know the FAQ says to write it in assembler but it mentions nothing > about _go32_dpmi_lock_ functions. The problem with C handlers is that you cannot lock them, since the size of a function cannot be computed in C. The trick that you use will work most of the time, but some minor changes in your code or some compiler switches (such as -O3) could break it, and some future version of gcc can change the way it generates the code for the functions in a way that will totally break this. That is the primary reason for what the FAQ says.