Crash on PPC

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Post Reply
Jose64141
Inquisitive Elf
Posts: 31
Joined: Mon Feb 22, 2016 10:34 pm

Crash on PPC

Post by Jose64141 »

Hi
I'm trying to run the latest version of SheepShaver on a PPC Linux computer.
It always crashes, saying illegal instruction.
I enabled debugging output, and I get this at the last part before crashing:

Code: Select all

Jumping to ROM
Jumping to ROM
EmulOp 0001 at 4080a402
XPRAMReadWrite d3: 00200000, a3: 0x24d8
EmulOp 0001 at 4080a402
XPRAMReadWrite d3: 000100af, a3: 0x17ff02
EmulOp 0001 at 4080a402
XPRAMReadWrite d3: 0001008a, a3: 0x17ff02
EmulOp 0007 at 4080016c
Fix MemTop
EmulOp 0027 at 4080136a
*** RESET ***
EmulOp 0002 at 4080a686
EmulOp 0002 at 4080a686
EmulOp 0001 at 4080a402
XPRAMReadWrite d3: 0001008a, a3: 0x1efc
EmulOp 0001 at 4080a402
XPRAMReadWrite d3: 0001008a, a3: 0x1efc
EmulOp 0008 at 40800748
Fix MemSize
EmulOp 0008 at 40800748
EmulOp 0008 at 40800748
ERROR: Your Mac program did something terribly stupid.
(pc 0x1003a0, 68k pc 0x17fbf0, sp 0x780fb090, opcode 00000000)
Returned from ROM
I'm using a New World ROM, and I tried a G3 Old World ROM, and same crash.
Btw, I'm running this on a 750CL, so I added its info to get_system_info() on main_unix.cpp so SheepShaver could recognize it. Should I do another change in the code?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7254
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Crash on PPC

Post by Ronald P. Regensburg »

Jose64141 wrote: Mon Jan 03, 2022 8:25 am I'm trying to run the latest version of SheepShaver on a PPC Linux computer.
Which is that "latest version"? Is it supposed to run on PPC?
Did you compile it yourself? From which source?
Or did you download it? From where?
Jose64141
Inquisitive Elf
Posts: 31
Joined: Mon Feb 22, 2016 10:34 pm

Re: Crash on PPC

Post by Jose64141 »

I compiled it myself on the target system from the cebix/macemu repo, with the aforementioned change
PS: I executed the same executable I compiled on a G4 iMac with the same version of Debian, and got the same result.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7254
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Crash on PPC

Post by Ronald P. Regensburg »

Was a prefs file created? Can you show its content here?
Jose64141
Inquisitive Elf
Posts: 31
Joined: Mon Feb 22, 2016 10:34 pm

Re: Crash on PPC

Post by Jose64141 »

This is the prefs file.

Code: Select all

disk /boot/SheepShaver/iMac.HFV
extfs /
screen dga/640/432
seriala /dev/ttyS0
serialb /dev/ttyS1
bootdrive 0
bootdriver 0
ramsize 50331648
rom /home/SheepShaver/oldworld.rom
frameskip 1
gfxaccel true
nocdrom true
nonet false
nosound true
nogui false
noclipconversion false
ignoresegv true
ignoreillegal true
jit false
jit68k false
keyboardtype 5
keycodes false
mousewheelmode 1
mousewheellines 3
idlewait true
I also tried disabling ignoreillegal but to no avail.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7254
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Crash on PPC

Post by Ronald P. Regensburg »

Ram memory size is small and an unusual value.

Try
256 MB

Code: Select all

ramsize 268435456
or
512 MB

Code: Select all

ramsize 536870912
Jose64141
Inquisitive Elf
Posts: 31
Joined: Mon Feb 22, 2016 10:34 pm

Re: Crash on PPC

Post by Jose64141 »

Changed the RAM size to 256MB and got basically the same error.

Code: Select all

(pc 0x1003a0, 68k pc 0xb7916008, sp 0x780fb0a0, opcode 00000000)
For the record, I'm using a PowerMac 8600 ROM. I also tried a Gossamer G3 and a New World ROM and the same stuff happened.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7254
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Crash on PPC

Post by Ronald P. Regensburg »

Best use either the new world rom or the old world rom that can be downloaded from the Redundant Robot site.
Jose64141
Inquisitive Elf
Posts: 31
Joined: Mon Feb 22, 2016 10:34 pm

Re: Crash on PPC

Post by Jose64141 »

I tried the New World ROM from that site, and same error:

Code: Select all

Initializing Low Memory...
Low Memory initialized
Initialization complete
Tick thread installed (1652)
NVRAM thread installed (1653)
MacOS thread is 1649
Jumping to ROM
EmulOp 0001 at 4080be62
XPRAMReadWrite d3: 00200000, a3: 0x24d8
EmulOp 0001 at 4080be62
XPRAMReadWrite d3: 000100af, a3: 0x17ff02
EmulOp 0007 at 40800176
Fix MemTop
EmulOp 0027 at 40801220
EmulOp 0027 at 40801220
ERROR: Your Mac program did something terribly stupid.
(pc 0x1003a0, 68k pc 0x17fbf0, sp 0x780fb0a0, opcode 00000000)
Returned from ROM
It's always pc 0x1003a0 and opcode 0. I think that has something to do.
Maybe this recent version has problems running natively? Should I try using an older commit?
User avatar
Ronald P. Regensburg
Expert User
Posts: 7254
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Crash on PPC

Post by Ronald P. Regensburg »

You could try. The last time I compiled a PPC version (for MacOSX host) was 1 February 2014.
Jose64141
Inquisitive Elf
Posts: 31
Joined: Mon Feb 22, 2016 10:34 pm

Re: Crash on PPC

Post by Jose64141 »

Tried with commit 70ac4e94e36819151c88a8286ff4640a5c363691 from March 6th 2014. Got the same error. (I selected this one because it had this commit: "update sheepthreads.c to work with newer PPC Linux distros", which I figured I should keep, as I remember seeing somewhere something about an issue with sheepthread not working properly because of a change on pthread iirc)

I think it's a good time to clarify some stuff.
So, I'm running Debian 8 with kernel version 3.15.0.

To the source code, I enabled the DEBUG macro on the files of the src and Unix folders, I added the 750CL PVR to the cpu_specs list, and I included <linux/sched.h> because after a quick search it apparently fixed this issue:

Code: Select all

gcc -DBINCUE  -I../include -I. -I../slirp -DHAVE_CONFIG_H -D_REENTRANT -DDATADIR=\"/usr/local/share/SheepShaver\" -g -O2  -c Linux/sheepthreads.c -o obj/sheepthreads.o
Linux/sheepthreads.c: In function 'pthread_create':
Linux/sheepthreads.c:131:63: error: 'CLONE_VM' undeclared (first use in this function)
  pid = __clone(start_thread, (char *)stack + STACK_SIZE - 16, CLONE_VM | CLONE_FS | CLONE_FILES, nt);
                                                               ^
Linux/sheepthreads.c:131:63: note: each undeclared identifier is reported only once for each function it appears in
Linux/sheepthreads.c:131:74: error: 'CLONE_FS' undeclared (first use in this function)
  pid = __clone(start_thread, (char *)stack + STACK_SIZE - 16, CLONE_VM | CLONE_FS | CLONE_FILES, nt);
                                                                          ^
Linux/sheepthreads.c:131:85: error: 'CLONE_FILES' undeclared (first use in this function)
  pid = __clone(start_thread, (char *)stack + STACK_SIZE - 16, CLONE_VM | CLONE_FS | CLONE_FILES, nt);
                                                                                     ^
Makefile:189: recipe for target 'obj/sheepthreads.o' failed
make: *** [obj/sheepthreads.o] Error 1
I compiled SS with:

Code: Select all

SheepShaver configuration summary:

SDL support ...................... : none
BINCUE support ................... : yes
LIBVHD support ................... : no
FBDev DGA support ................ : yes
XFree86 DGA support .............. : yes
XFree86 VidMode support .......... : yes
Using PowerPC emulator ........... : no
Enable JIT compiler .............. : no
Enable video on SEGV signals ..... : no
ESD sound support ................ : no
GTK user interface ............... : no
mon debugger support ............. : no
Addressing mode .................. : real
Bad memory access recovery type .. : siginfo
(I disabled VOSF because, with it the app would crash on

Code: Select all

 the_buffer = 0xb76c9008, the_buffer_copy = 0xb77f7008
after finding a videomode)

I must say, I hadn't tried installing SDL because I'm afraid it could not work properly in the platform I'm running (it's pretty limited, same reason why I had 48MB of RAM before)

Just so you can have a better view, I'll put the whole output:

Code: Select all

SheepShaver V2.4 by Christian Bauer and Mar"c" Hellwig
Signal stack at 0x780ea6f0
Extra stack at 0x780fa6f8
Found a PowerPC 750CL processor
PVR: 00087200 (assumed)
Paranoia checks...
[emul_thread] waiting for tick thread to initialize
[tick_thread] waiting for emul thread to initialize
[tick_thread] waiting for emul thread to initialize
[emul_thread] filling in registers and waiting for interrupt
[tick_thread] trigger interrupt
SIGUSR2 caught
...passed
Kernel Data at 0x68ffe000 (68ffe000)
Emulator Data at 0x68fff000 (68fff000)
DR Cache at 0x69000000
Could allocate RAM from 0x0000
RAM area at (nil) (00000000)
ROM area at 0x40800000 (40800000)
Reading ROM file...
Offset of compressed data: 00010db0
Size of compressed data: 001ca2e2
Sys_open(/dev/fd0, read/write)
Sys_open(/dev/fd1, read/write)
Sys_open(/boot/SheepShaver/iMac.HFV, read/write)
SCSIReset
Checksum: c7cb0323
Version: 077d
Sub Version: 44b5
Nanokernel ID: NewWorld v1.0▒p
Resource Map at 000c63f0
Trap Tables at 000c4ff0

sr_init 00310200
pvr_read 00310438
ofs 00000bec
loc 00310d54
sprg3/mq 00310d74
msr 00310d94
loc 00313eac
sprg3 00313ed8
pvr_read2 00313ff4
pvr_read2 0031401c
pvr_read3 003131f4
pvr_read4 00314600
sdr1_read 00314048
pgtb_clear 00314070
tblie 00314078
desc_create 00314228
sr_load 00312568, called from 003142b0
sr_load2 003121b4
pm_check 00313218
  SPR952 00313218
  SPR953 00313228
  SPR954 0031323c
  SPR955 00313250
  SPR956 00313288
  SPR957 00313298
  SPR958 003132ac
  SPR959 0031326c
jump68k 00314300, called from 003142e4
twi 0036e740
dr_ret 00377844
virt2phys 00313d94
ppc_excp_tbl 00313d3c
save_fpu 00312f48
save_fpu_caller 00312c1c
mdec 00312c24
restore_fpu_caller 00312c7c
m68k_excp 00312b48
restore_fpu_caller2 00312a74
restore_fpu 00312e94
suspend 00315444
trap_return 00312d30
fe0a_0a 003149cc
fe0a_11 00314cec
fe0a_pgtb_lookup 00315174
fe0a_krnl_write 00314e04
reset 0000010a
powermac_id 000109b0
universal_info 00014c88
via_init 00010408
via_init2 0000e9c4
via_init3 0000ea70
run_diags 00000120
nvram1 0000be60
nvram2 0000c684
nvram3 0000c70a
nvram4 0000c870
nvram5 0000c4ca
nvram6 0000abbc
mem_top 00000174
scc_init_caller 000001e4
scc_init 0000121e
ext_cache 0000022a
timek 000004ca
jump_tab 00005df0
 00005e00
 00005f30
 00005f70
 000060c0
 00006120
 00006230
 00006250
 00006340
 00006660
 000069f0
 00006a30
 00006b90
 00006c30
 00006c50
 00006cf0
 000070c0
 00007170
 00007370
 00007390
 000073d0
 00007500
 00007700
 00007850
 00007910
 00007940
 00007b30
sys_zone 00000810
boot_stack 0000074a
page_size 00010210
page_size2 00059710
cuda_init 0000efe2
cpu_speed 00008e78
cpu_speed2 00008f0a
time_via 0003262c
open_firmware 0004c642
ext_cache2 00015396
tm_task 00000308
macpgm 00168744
name_reg 0000035e
scsi_mgr 0001f1c0
scsi_var 0001f5b4
scsi_var2 0001f7b0
adb_init 00031b62
init_res 00078eca
check_load 0007a148
sony_offset 0020e960
drvr_install 00000b0c
egret 0000ecf0
shutdown 00032f18
via_int 00015d94
via_int2 00011808
via_int3 00015bf0
SynchIdleTime at 00011904
Searching for sound components with type sdev in ROM
Patching sifters in ROM
Initializing Low Memory...
Low Memory initialized
Initialization complete
Tick thread installed (24443)
NVRAM thread installed (24444)
MacOS thread is 24439
Jumping to ROM
EmulOp 0001 at 4080be62
EmulOp 0001 at 4080be62
ERROR: Your Mac program did something terribly stupid.
(pc 0x1003a0, 68k pc 0x20b0, sp 0x780fa0a0, opcode 00000000)
Returned from ROM
Hope this info can be useful.

PS: Seeing what I posted, I realized this:

Code: Select all

RAM area at (nil) (00000000)
Should that be indicative of something?
Also, I'd like to note that while 48MB is a ridiculously small amount, I tested running on Windows with 32MB of RAM and it booted, which is my ultimate goal here so for now I don't think it should be much of an issue.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7254
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Crash on PPC

Post by Ronald P. Regensburg »

This is all beyond my expertise. I will leave it to others to try and find answers.
Jose64141
Inquisitive Elf
Posts: 31
Joined: Mon Feb 22, 2016 10:34 pm

Re: Crash on PPC

Post by Jose64141 »

I have news
I downgraded to Debian 5 and recompiled the source code I had, and basically SheepShaver was able to run the ROM...
BUT
When I tried to use 48MB, it said it couldn't allocate RAM and ROM, so I used 32MB. Honestly idk if that was because the swap partition isn't properly set up, let's hope it's just that.
I tried booting an image with Mac OS 9.0.4 installed, and a while after prompting the Not enough Virtual Memory error (which is expected with 32MB and no VM), SheepShaver crashed with:

Code: Select all

ERROR: Your Mac program made an illegal halfword read access to address 0x61ba61c2.
(pc 0x48210ff4, 68k pc 0x44, sp 0x49ef7d60)
Returned from ROM
Honestly idk what that is, so I enabled ignore illegal instructions. (Thinking about t now, I probably should enable ignore illegal memory access, but with the settings names I got confused)
Tomorrow I'll check the swap file and the sheep prefs, and I'll also try to use a matching ROM and OS pair (I never run into any problem by using a mismatched pair of New World ROM and Mac OS, but as I have seen, there's an specific version of the ROM for a given Mac OS version)
But I think having no problems on the blinking floppy and being capable of showing the boot screen is a major progress.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7254
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Crash on PPC

Post by Ronald P. Regensburg »

Jose64141 wrote: Wed Jan 19, 2022 6:17 amWhen I tried to use 48MB, it said it couldn't allocate RAM and ROM, so I used 32MB.
SheepShaver allocates memory in fixed locations and cannot proceed if these locations are already occupied by other processes. Restarting the host machine may solve such issues by freeing memory.

I tried booting an image with Mac OS 9.0.4 installed
MacOS installations differ on different machines. Best install MacOS in SheepShaver from a general retail install CD (or from a disk image created from such a CD)

Code: Select all

but as I have seen, there's an specific version of the ROM for a given Mac OS version
The old world rom from Redundant Robot is compatible with System 7.5.3 through MacOS 9.0.4.
The new world rom from Redundant Robot is compatible with MacOS 8.5 through 9.0.4 and preferred with MacOS 8.6 through 9.0.4.
Jose64141
Inquisitive Elf
Posts: 31
Joined: Mon Feb 22, 2016 10:34 pm

Re: Crash on PPC

Post by Jose64141 »

Hi
So, indeed the ROM had no issue, the swap partition wasn't properly set up, and the issue I mentioned in my last replay was fixed by ignoresegv.
The OS loaded, and I could go through the Setup Assistant (which was a bit laggy but whatever), but as soon as I had finished it and it started to draw a Finder window the system hanged.
After rebooting, the system could load but it hanged again when loading the same Finder window.
Also, this whole time SheepShaver has been showing the wrong colors, and it feels slower.
Do you think going back to the latest version could help?

I tried the MOL route, and I could compile it and get it to boot. I used a Mac OS 8.6 install CD and it booted, and as soon as I opened the MOL drivers CD in Finder, it hanged too.
I rebooted, loaded the install CD again and it opened the Installer drive just fine! Although, for some reason, some of the texts are just a mess (like drive names).
Also, the mouse sometimes takes a time to initialize, but that's a minor detail.

For the record, I tried running Mac OS X 10.0 and 10.1 on MOL and it gave an error:

Code: Select all

>> /mol-blk@0/disk@1:9,/mach_kernel (4039448 bytes) // with 10.0
>> /mol-blk@0/disk@1:9,/mach_kernel [10.1] (3148008 bytes) // with 10.1
Instruction Pointer not in ROM/RAM (nip FFF00C00, nip_phys FFF00C00)
Overall, I think Mac on Linux is the way to go (Especially if I can make the text always appear correctly)
If anyone knows about some garbage text on Mac OS and random mouse disfunction when running MOL please help me.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7254
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Crash on PPC

Post by Ronald P. Regensburg »

If you want help with MOL, please start a new topic in the "General Macintosh Emulation" forum. (Although I believe that MOL is about virtualisation rather than emulation.)
User avatar
adespoton
Forum All-Star
Posts: 3689
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Crash on PPC

Post by adespoton »

The colour issue makes me think of the known SDL issue with color bit flipping. Is this being compiled to run through X framebuffers, SDL1 or SDL2?
Jose64141
Inquisitive Elf
Posts: 31
Joined: Mon Feb 22, 2016 10:34 pm

Re: Crash on PPC

Post by Jose64141 »

It was compiled for X FB (I didn't install SDL because I'm not sure the hardware I'm running is capable enough and I didn't want to take the risk)
Post Reply