From: sandmann AT clio DOT rice DOT edu (Charles Sandmann) Message-Id: <9801131503.AA14262@clio.rice.edu> Subject: Re: [MCLSSAA2 AT fs2 DOT mt DOT umist DOT ac DOT uk: Hooking interrupt 9 : a DIFF] To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii) Date: Tue, 13 Jan 1998 09:03:46 -0600 (CST) Cc: dj AT delorie DOT com, Anthony DOT Appleyard AT umist DOT ac DOT uk, djgpp-workers AT delorie DOT com In-Reply-To: from "Eli Zaretskii" at Jan 13, 98 10:49:08 am Content-Type: text Precedence: bulk > Also, the name of this user-defined callback should begin with an > underscore, since it (the name) gets linked into every application and > will pollute the ANSI/POSIX name space. I suggest something like > `__djgpp_kbd_callback'. Agreed. > > + sti /* disable interrupts */ > > Charles, isn't this dangerous/slow/unnecessary in the keyboard > handler? Agreed. And usually STI doesn't disable... > The current keyboard handler already sets its DS to point to > conventional memory, with this line: > > movw %cs:___djgpp_dos_sel, %ds > > Isn't it better to just move this line a couple of lines up, so it > takes effect before _calluserskeyboardhandler is called, instead of > doing it twice and bloating the code? I didn't have much time to review, but it's not clear to me what the limitations on this handler are. The stack does not seem to be set up properly, which GCC assumes, so there are lots of things to consider.