Subject: memtest86 in bochs
To: None <port-i386@netbsd.org>
From: Ben Collver <collver1@comcast.net>
List: port-i386
Date: 12/30/2003 14:14:36
Hi,

I am trying to run memtest86 v3.0 in bochs, with the goal of debugging
low-level code.  However I don't understand some of this code to begin
with, and am seeking help explaining something.

I built bochs from pkgsrc, and uncommented the configure argument to enable
the built-in debugger.  I made a 1.44mb floppy image of memtest86 v3.0 and
booted bochs off this.  A detailed transcript of my debugger steps is at:
http://backyard.homeunix.net:8080/~ben/pkgsrc/memtest86-v30-in-bochs.txt

The confusing part is in query_pcbios(), at line 730 of head.S
        xorl    %eax, %eax

At this point in the function, bochs is in real mode.  I expected the xorl
to cause eax to be zeroed out, but instead it zeroes cs and sets eip to 2.
Can someone advise me if this is a quirk of the 80386 in real mode, or if
it looks like a bug in bochs?

Thank you,

Ben
-- 
A hacker does for love what others would not do for money.