Date: Tue, 6 Jan 1998 13:11:04 +0200 (IST) From: Eli Zaretskii To: Anthony DOT Appleyard AT umist DOT ac DOT uk cc: DJGPP AT delorie DOT com Subject: Re: Funny with hooking interrupt 9 in a laptop In-Reply-To: <1B072592FBF@fs2.mt.umist.ac.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk On Tue, 6 Jan 1998, Anthony.Appleyard wrote: > C:\DIV\SPATRL>Invalid TSS in RMCB at eip=107f; flags=3002 > eax=01830000 ebx=000020d4 ecx=00000000 edx=00021800 esi=0009fb0c edi=0001c050 > ebp=00000000 esp=0000310c cs=2b ds=3b es=b7 fs=33 gs=0 ss=33 error=00b4 > > What made that error display? This is a telltale sign that you don't unhook the keyboard interrupt properly, which leaves Int 9 vector pointing into the void. > What is a TSS? TSS = Task State Segment. It's a special structure that holds the information about the DJGPP program such as the registers, the segment selectors, etc. > What is RMCB? RMCB = Real-Mode CallBack. Used by CWSDPMI to reflect hardware interrupts which happen in real mode to the protected-mode handler in your DJGPP program. > Does it happen > from the (extra matter in the laptop which translated Fn key combinations into > imitations of presses and releases of the missing keys) messing about with > interrupt 9 while my program is running and assuming that interrupt 9 still > points to its default BIOS value? It can be, I don't know. If you can throw together the shortest program that hooks the keyboard and exhibits this problem, post the code here. It is very difficult to guess the correct reason otherwise. Please note that the keyboard interrupt is special in DJGPP, because the DJGPP startup code itself hooks it (to generate SIGINT when Ctrl-C is pressed). The DJGPP handler is uninstalled inside the `_exit' function, which is called by `exit'. So if you uninstall your handler in some place which is after `_exit', you get burned. Also, please tell whether you use DJGPP v2.0 or v2.01 (the way keyboard interrupt is unhooked on exit is different in these versions).