www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/04/19/05:34:17

Message-Id: <199604190924.FAA02932@delorie.com>
Date: Fri, 19 Apr 96 12:21:35 LIT
From: Martynas Kunigelis <martynas DOT kunigelis AT VM DOT KTU DOT LT>
Subject: re: keyboard read
To: DJGPP mailing list <djgpp AT delorie DOT com>

Jan-Pierre Cuvelli wrote:
<stuff skipped>

Your problem is: DS does not necessary point to your data segment when
the keyboard interrup occurs. You need to add the following code to your
handler:


....
pushw %ds
movw %cs:___djgpp_ds_alias, %ds
.....
stuff...

popw %ds
....


___djgpp_ds_alias is a locked system variable, so it can be accessed at
inetrrupt-time. there's also a variable ___djgpp_app_DS, but it is not locked,
plus DJGPP exception handler sometimes invalidates app's DS to raise another
exception, while ds_alias remains valid.

If you have further problems, you may have a look at the file
mkkbd?.zip at v2/tk subdirectory of DJGPP 2 location. It contains my example
of keyboard handler for DJGPP2. Kinda out-dated, as well. I prepared a new
version a while ago, but forgot to send it to DJ. This reminds me.

Hope this helps.

Martynas


P.S. you can also put the handler data to the .text section next to the
handler code and lock one region, including code and data as well. I think
the less regions you lock, the better DPMI memory performance you get.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019