Mac OS 7.1 - MacsBug 6.2

About BasiliskII, a 68k Mac emulator for Windows, MacOSX, and Linux that can run System 7.x through MacOS 8.1.

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
tcat
Inquisitive Elf
Posts: 35
Joined: Tue Aug 04, 2020 4:04 pm

Mac OS 7.1 - MacsBug 6.2

Post by tcat »

Hi,

Installed MacsBug, set up 'FKEY' in the System as resource ID of 5. The version 6.2 is matching the OS 7.1, I should think.
But after pressing Command-Shift-5, instead of dropping into the debugger I am getting Illegal instruction in BII.

Anything I may be doing wrong?
Many thanks.

Tom
tcat
Inquisitive Elf
Posts: 35
Joined: Tue Aug 04, 2020 4:04 pm

Re: Mac OS 7.1 - MacsBug 6.2

Post by tcat »

Hi,

A new observation. With `MacsBug' installed [resides in System folder / Mac greets on boot, and says Debugger installed underneath].

Generating exception in a programme.

Code: Select all

zero := zero DIV 0;
Should drop into the debugger, but drops out of BII and says

Code: Select all

Illegal instruction: 4e7a at 007e789c
Caught SIGSEGV at address 0x75958000 [IP=0x7bba8]
Not sure what happens, is there a way to tell BII, not catch exceptions when MacsBug is installed?

Many thanks.
Tomas
tcat
Inquisitive Elf
Posts: 35
Joined: Tue Aug 04, 2020 4:04 pm

Re: Mac OS 7.1 - MacsBug 6.2

Post by tcat »

Hi,

Changing Processor ID to 4, which does not match LCIII machine and ROM, I use normally CPU 3 and FPU.
I can drop into MacsBug, see the screen, cursor flashing, but cannot type any chars.

Tomas
User avatar
adespoton
Forum All-Star
Posts: 3063
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Mac OS 7.1 - MacsBug 6.2

Post by adespoton »

tcat wrote: Fri Sep 11, 2020 8:40 am Hi,

Changing Processor ID to 4, which does not match LCIII machine and ROM, I use normally CPU 3 and FPU.
I can drop into MacsBug, see the screen, cursor flashing, but cannot type any chars.

Tomas
See https://docs.google.com/spreadsheets/d/ ... Dk7QDyKPY/ - you may want to ensure FPU is enabled, whether using CPU 3 or 4. Your ROM is probably the best one to use for 7.1, but you may need to change the machine ID. Remember that BII machine ID does not line up with the gestalt ID, but is off by 6 IIRC due to it not supporting the first 6 gestalt IDs used in Macs.

Also, BII has its own built-in debugging, so you'll be fighting against that when attempting to trigger MACSBug.
tcat
Inquisitive Elf
Posts: 35
Joined: Tue Aug 04, 2020 4:04 pm

Re: Mac OS 7.1 - MacsBug 6.2

Post by tcat »

Code: Select all

gestaltMacLCIII  =  27
27 - 6 = 21 that is for model-ID
But reports bad start-up disk.

No luck. Out of many model ID combinations for 7.1,
I can boot model-ID 18, which is gestalt 24 => PowerBook100,
and gestaltMacClassic = 17.

MacsBug, always needs processor ID = 4.

But still cannot type any keys in MacsBug.

BII is probably taking over control of the machine, therefore nothing can be typed.

Not sure there is a solution path possible.
Tomas
tcat
Inquisitive Elf
Posts: 35
Joined: Tue Aug 04, 2020 4:04 pm

Re: Mac OS 7.1 - MacsBug 6.2

Post by tcat »

27 - 6 = 21 that is for model-ID
But reports bad start-up disk.
Enabler 003 added for LCIII, then does not report bad start up disk,
all lined up to my best knowledge.
But getting exception in BII during boot.

Same goes for LC/Peforma 630
gestalt = 98 - 6 => Model id 92
enabler 405
fpu true
630.rom
hd installed with LC630-CD.toast

Exception during boot.

Interesting some exceptions are caught in BII and MacsBug at the same time.
The above combinations are caught in BII only.

Tomas
tcat
Inquisitive Elf
Posts: 35
Joined: Tue Aug 04, 2020 4:04 pm

Re: Mac OS 7.1 - MacsBug 6.2

Post by tcat »

Hi,

Cannot type any chars in MacsBug.
cpu=4, LCIII.rom, OS-7.1, modelid=5

These seem combinations that brings MacsBug screen on user break, cursor flashing, but does not accept any input from the keyboard. Tried aligning various model ids' with roms, but till now did not find a working combination.

Please see picture here,
https://github.com/tcat-qldom/MacOS-7/b ... ??raw=true
https://github.com/tcat-qldom/MacOS-7

The beauty about this low level debugger [lean & mean tool], it can catch most if not all exceptions, allows user debug output messages, debug low mem conditions, help finding dangling pointers, sensible app segment strategy, and much more.

It is the official debug tool that was always present, each Mac equipped with 'Programmers' key', that could invoke debugger, reset app, reset machine, etc.

It seems latest BII does not support MacsBug, which is a pity. Looking around the BII code, with `ZERO' understanding.

Code: Select all

        // Fake CPU speed test (SetupTimeK)
        // *** increased jl : MacsBug uses TimeDBRA for kbd repeat timing
        wp = (uint16 *)(ROMBaseHost + 0x800);
        *wp++ = htons(0x31fc);                  // move.w       #xxx,TimeDBRA
        *wp++ = htons(10000);
        *wp++ = htons(0x0d00);
Historically there was support for it, as it seems.

Any ideas?
Many thanks.

Tomas
tcat
Inquisitive Elf
Posts: 35
Joined: Tue Aug 04, 2020 4:04 pm

Re: Mac OS 7.1 - MacsBug 6.2

Post by tcat »

BII has its own built-in debugging, so you'll be fighting against that when attempting to trigger MACSBug.
Just to be sure, JIT-Debugger is disabled on Linux (RPI), as this platform does not support it.

Tomas
tcat
Inquisitive Elf
Posts: 35
Joined: Tue Aug 04, 2020 4:04 pm

Re: Mac OS 7.1 - MacsBug 6.2

Post by tcat »

Hi,

Tried many combinations, modelid, enablers, and ROMs, some bootable.
Tried to disable cxmon and debugger in the source, making a new build.
Tried many versions of MacsBug.
Still MacsBug wont accept keyboard input.

Not sure, would this be a candidate for an issue to file at git?
Or is it just me not seeing the solution?

Many thanks
Tomas
tcat
Inquisitive Elf
Posts: 35
Joined: Tue Aug 04, 2020 4:04 pm

Re: Mac OS 7.1 - MacsBug 6.2

Post by tcat »

Hi,

I have tried many builds of BII with a lot of debug output, still did not figure out why MacsBug does not read the keyboard. I have tested that keycodes are passed to ADB, when MacsBug screen shows up, but no chars appear on the command line. As keyboard and mouse are physically connected to ADB, do not get why it does not work.

Have two basic BII builds (https://github.com/cebix/macemu), SDL and X11, with direct or mem slot addressing, I suspect X11 sources are outdated around keycodes. Mac Classic rom version $276 requires mem slot.

Code: Select all

# video_x.cpp - Video/graphics emulation, X11 specific stuff
> 	if (strstr(vendor, line) == vendor) # does not seem to work
---
< 	if (strcmp(strstr(line, vendor), vendor) == 0)  # recoded

It looks for vendor string occurrence in keycodes file below

# /usr/share/BasiliskII/keycodes
# ../BasiliskII/src/Unix/keycodes
#The XFree86 Project, Inc
      The X.Org Foundation   <== vendor string changed
9       53      # Esc
67      122     # F1
68      120     # F2
69      99      # F3
70      118     # F4
71      96      # F5
...
Filed an issue at git repo for unssuporting MacsBug.

For X11 build I disabled DebugUtil(), so it can catch in MacsBug instead, ^C in pty then brings up monitor (built --with-mon=yes), h for help, x for quit - nice :-)

Code: Select all

#  ../BasiliskII/src/rom_patches.cpp - ROM patches
//	r.a[0] = ROMBaseMac + debugutil_offset;
//	r.d[0] = 0xa08d;
//	Execute68kTrap(0xa247, &r);		// SetOSTrapAddress()
Meanwhile using mini vMac, where MacsBug works, but only in System 7.5.3 with system update 7.5.
System 7.1 does not boot in vMac.

So I run two emulators BII with 7.1 and 7.5 mounted - w/o MacsBug, and vMac 7.5. - w/ MacsBug.
vMac can reuse the same HD image, but requires that 7.5 image is cleanly unmounted in BII first, otherwise will not boot in vMac.

Tomas
Post Reply