delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/06/15:38:26

From: Martin Str|mberg <ams AT ludd DOT luth DOT se>
Message-Id: <200001061424.PAA05714@father.ludd.luth.se>
Subject: Re: The endless int31 hooking debugging continued
To: eliz AT is DOT elta DOT co DOT il (Eli Zaretskii)
Date: Thu, 6 Jan 100 15:24:58 +0100 (MET)
Cc: djgpp AT delorie DOT com (DJGPP)
In-Reply-To: <Pine.SUN.3.91.1000106120145.20220H-100000@is> from Eli Zaretskii at "Jan 6, 0 12:02:18 pm"
X-Mailer: ELM [version 2.4ME+ PL15 (25)]
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

According to Eli Zaretskii:
> On Wed, 5 Jan 100, Martin Str|mberg wrote:
> > I've
> > tried pushing things to be able to restore them, but then I've got
> > some _really_ strange crashes (Invalid opcode, Stack fault, EIP
> > pointing into the middle of an instruction)!
> 
> I don't think it's because of the pushing, but please show the code
> which did that.

I don't know because I tried everything I could so it hard to remember
what it was I was trying when that happened.

> Once again, I suggest to look at the function _i31_hook in dbgcom.c,
> it shows several examples of code that hooks Int 31h and *works*.

I've looked (although not extremely closely) and I thought I had tried
similar things (perhaps it was the following that messed it up).

> > /* Restore segments to valid DJGPP state. */
> >         movw %cs:_my_ds, %ds
> >         movw _my_ds, %es
> >         movw _my_ds, %ss
> 
> I don' think you can move values into segment registers directly, I
> think you need to use AX as intermediary.

Ah that might explain things. But how come gas gladly assemble it? And
objdump gladly disassembles it? Shouldn't I get an illegal intruction
fault if it's an illegal instruction (this is run on my 386SX)? 


All About Eve,

							MartinS

- Raw text -


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