Subject: Re: memtest86 in bochs
To: Ben Collver <collver1@comcast.net>
From: David Laight <david@l8s.co.uk>
List: port-i386
Date: 01/05/2004 22:19:09
On Mon, Jan 05, 2004 at 10:20:42AM -0800, Ben Collver wrote:
> On Mon, Jan 05, 2004 at 05:41:34PM +0100, Christian Biere wrote:
> > > 0000265d: sti                       ; fb
> > 
> > Here you allow interrupts (unless the PIC is programmed to disable them)
> > and a few instructions later something goes haywire. Suspicious.

Especially since %sp gets decremented by 6....

> > > 0000265e: xor EAX, EAX              ; 6631c0
> > > 00002661: mov [DS:0000], EAX        ; 66a30000
> > > 00002665: mov [DS:0004], EAX        ; 66a30400
> > > 00002669: mov [DS:0008], EAX        ; 66a30800
> > > 0000266d: xor EBX, EBX              ; 6631db
> 
> If I make a breakpoint at the first instruction after 'cli' ni
> query_pcbios(), bochs never gets there.  It gets stuck in a loop of:
> 
> 00006130453i[CPU  ] BxError: instruction with op1=0xfe
> 00006130453i[CPU  ] nnn was 7
> 00006130453i[CPU  ] WARNING: Encountered an unknown instruction (signalling illegal instruction):
> 
> When I break out of it, I find CS:IP is at 0:0.  Something's going on in
> there that shouldn't be, I'll see if I can narrow it down a bit.

What is in the vector table you are setting for real mode?
And is it following the correct procedure for the mode switch?
I think the code in sys/arch/i386/stand/lib/realtoprot.S (or threabouts) is ok.

	David

-- 
David Laight: david@l8s.co.uk