Date: Wed, 12 Jan 2000 07:42:09 +0500 (MVT) From: Prashant TR To: Groman cc: djgpp AT delorie DOT com Subject: Re: Having troubles with IDT/IRQ0 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk On Tue, 11 Jan 2000, Groman wrote: > Could somebody please tell me if the following bits and pieces are correct > and do what I want(99% chance the problem is elseware, but I want to make > sure > these pieces are which work) > struct IDTDesc > { > unsigned short OffSet1 _pack; // Offset > unsigned short Selector1 _pack; // Segment selector > unsigned short Flags _pack; // Flags > unsigned short OffSet2 _pack; // Rest of the offset > } _pack; This seems fine. > IDTDesc IDT[256]; Yes, this is perfectly fine. > _IRQ0Handler: > push eax > push edx > > > mov dx,0x20 > mov al,0x20 > out dx,al > > inc word [0xb8000] > > pop edx > pop eax > iret ^ Here's the problem. Since you aren't using DPMI functions to write the handler, you can't terminate that with an iret. iret, in protected mode, is used to switch to the previous task. You must use iretd for it to work. And in the line inc word [0xb8000], how do you assume that your DS is a large selector? You must save DS and load another value. Of course, don't forget to load back the old DS after you finish. Prashant