From: J DOT Rouwe AT cpedu DOT RUG DOT NL Date: Wed, 06 Mar 1996 02:11:54 +0100 To: martynas DOT kunigelis AT VM DOT KTU DOT LT, djgpp AT delorie DOT COM Message-id: <199603060111.CAA21602@indy3.cpedu.rug.nl> Content-transfer-encoding: 7BIT Apparently-To: djgpp AT delorie DOT com Apparently-To: martynas DOT kunigelis AT VM DOT KTU DOT LT Martynas Kunigelis wrote: > After my announcement of `mkkbd1.zip', my keyboard interrupt handler, I have > received a bug (actually, a crash) report. I have no idea why it happens. I > feel extremely ashamed and dumb. I have tested it multiple times under > CWSDPMI > OS/2 and Windows and it worked. I am now asking someone from DJGPP team to > remove the buggy(?) zip from SimTel, or maybe C. Sandmann (who is I think a > DPMI expert after all) could have a look at the code (please??!!). I > apologize > possibly] incorrect information. > > Now I have a question: Eli Zaretskii stated, that once I hook the keyboard > interrupt and do not chain, keyboard is mine forever, even if the key is > pressed while CPU is in real mode. However, while testing my above mentioned > handler, I made a loop of fread()s, which implied, I think, switching to > real > mode, and *even with no chaining I was able to break the loop with crtl-c*! > Why on earth? (whoops, I meant PM interrupt at the beginning of this > paragrph.) > > P.S. I think crashes in example.c from mkkbd1.zip could be caused by as's > bug- > well, there is *some* possibility ] > > ashamed] Martynas Kunigelis I just used your code for my own program because I'm porting it to gcc. Before that I had a real mode keyboard handler and there was only one big difference between the two: I've read somewhere that you should also acknoledge the keyboard controller (but I don't remember where because the old code is already 2 years old), so perhaps some keyboards need this acknoledge (mine doesn't seem to care). The code to acknoledge the keyboard is: inb $0x61, %al movb %al, %ah orb $0x80, %al outb %al, $0x61 movb %ah, %al outb %al, $0x61 Maybe this is your problem.... Jorrit Rouwe j DOT rouwe AT cpedu DOT rug DOT nl