macsbug

mol-devel@lists.maconlinux.org mol-devel@lists.maconlinux.org
Fri, 31 May 2002 11:59:29 +0200


On Fri, May 31, 2002 at 03:45:54PM +1000, Ben Stanley wrote:
> However, my software often has problems which cause it to drop into 
> macsbug. This puts the screen into 2 or 4 colour mode (2 bits per 
> pixel). mol cannot display this in either x11 mode or console mode. It 
> gives you a black screen. I can't get out of this state so I am forced 
> to kill the emulator and re-start mol if I ever get dropped into macsbug 
> by mistake.

I don't thing it is the color depth that is the problem here; if I
remember correctly, recent versions of MacsBug even have a few
colored lines.

> I poked around a while ago wondering where I would add support for the 
> 2bpp video mode. I presume it would go in the x11 video driver file. 

Yes, and into the video.c file.

> How complicated would it be to add it? I realise the bit depth would have to 
> be converted. It seems that I would have to add a new set of conversion 
> routines and register the new mode in the video module initialisation 
> code. But would I have to add support to the console driver as well?

No, but you probably would have to add the depth to
the MacOS part of the driver too.

> Are there other more fundamental problems than this which prevent the 
> use of macsbug? 

Well, technically speaking it should be working. It doesn't though.
I think this is due to some error in the implementation of the
MSR_SE bit (single-stepping). I'm fairly certain that
single stepping a privileged instruction doesn't work, but there
might very well be other problems to.

The way to debug this, I think, is writing a small program
to be run inside mol (see for instance src/molelf/performance.S)
which tests the implementation of the MSR_SE bit.

The MSR_BE (break after branch) doesn't work properly either 
(I think). But I don't think MacOS uses it anyway.

Cheers,

/Samuel