delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/11/22:14:16

Date: Wed, 12 Jan 2000 07:42:09 +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: Having troubles with IDT/IRQ0
In-Reply-To: <CXMe4.467$YK4.12132@nnrp3-w.snfc21.pbi.net>
Message-ID: <Pine.LNX.4.10.10001120720050.523-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 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

- Raw text -


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