delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/08/09:09:12

Date: Sat, 8 Jan 2000 18:48:24 +0500 (MVT)
From: Prashant TR <prashant_tr AT yahoo DOT com>
To: Groman <groman AT thehelm DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: ISR with DJGPP in a kernel.
In-Reply-To: <s7dr49t5oj886@corp.supernews.com>
Message-ID: <Pine.LNX.4.10.10001081836110.596-100000@yahoo.com>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sat, 8 Jan 2000, Groman wrote:

> Ok...here are my steps.
> 
> 1) I create the IDT and load the register.
> 2) I reprogram the PIC to shift the IRQs so they do not overlap with the
> exceptions.

Doing this can cause disasters! 99% of the library functions will become
unusable to your program.

> 3) I disable all IRQs beside 2 and 0.

Have you taken enough steps to handle the interrupts from IRQ0?

> Now I want to create a handler for 0(the timer) in C...
> now, how exactly do I do that... I mean it jumps out of the code right in
> the middle of the function...and starts another one?

Since, you've changed the IDT and reprogrammed the PICs, you cannot use
any of the DPMI functions to do this. What you need to do is create
another selector in the GDT/LDT to point to the ISR, then add the
appropriate entry to the IDT. Phew!!!

The reason why I guess your ISR is jumping out is probably because you are
overwriting some of the ISR code.

> shoud I do the handler in assembly that calls C functions then? or is there
> a way to turn an ordinary DJGPP function
> into a handler...

In short, uou can use a C handler, but if you know what you are doing. Why
do you need to do all this? Isn't the existing IDT and PIC offset ok for
your kernel?

Prashant

- Raw text -


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