delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/17/17:14:40

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Hooking interrupt 9 clashing with new types of BIOS?
Date: Mon, 16 Feb 1998 18:52:25 +0000
Organization: None
Distribution: world
Message-ID: <7Ntd3AAprI60Ewey@talula.demon.co.uk>
References: <C5E3A253E3 AT fs2 DOT mt DOT umist DOT ac DOT uk>
NNTP-Posting-Host: talula.demon.co.uk
MIME-Version: 1.0
Lines: 39
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Anthony.Appleyard writes:
>I asked about this at a PC suppliers and he said that `interrupt 9 is
>referred internally to interrupt 2' and suchlike.
[...]
>What is happening? Is it some new misfeature that has been put into 
>BIOSes?

The plug&play architecture does allow quite a lot of flexibility for
interrupts to be remapped or a single IRQ shared between several
devices, but I would be amazed if this is ever done with the keyboard:
if so, the machine could hardly be considered to be PC compatible!

I think a more sensible starting assumption would be that you are doing
something wrong in your code. This can easily be checked by trying some
other djgpp programs that trap the keyboard interrupt, for example
mkkbd3.zip or Allegro, to see if these work correctly on your machine.

I've never tried chaining to the BIOS keyboard handler, so I don't know
if this could have some adverse effects. Since the libc interrupt
wrappers are not reentrant, and you have no way of knowing what the BIOS
handler is going to do, it is possible that this could be the cause of
your problems, in which case you should either avoid chaining or write
your own reentrant handler (such as the __djgpp_kbd_hdlr routine in
djgpp\src\libc\go32\exceptn.s).

Also, you don't seem to be locking any of your memory: it is absolutely
essential to do this if you want a stable interrupt handler.

btw. I must say that I find your coding style very hard to read! (I had
to run it through indent before I could even begin to follow what you
were doing). I know that code layout is a very personal thing, but most
C programmers format their routines within a fairly limited range of
styles. Don't you find it a bit limiting to have the rest of the world
unable to understand your programs? :-)


--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
"Pigs use it for a tambourine" - Frank Zappa

- Raw text -


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