Running on Fedora
Page 1 of 1

Author:  coderforlife [ Sun Aug 20, 2017 7:17 pm ]
Post subject:  Running on Fedora

I am trying to get Basilisk II to compile and run on my Fedora 25 machine. I have been using an old version of Basilisk II on various Windows machine since I got rid of my Mac LC II some time ago and it works. However using my build of Basilisk II I get many problems and am never able to boot, either from my hard drives and ROM that were transferred from the working Windows machine or when trying to create a new copy.

First off, to get it to even compile I had to make some changes to the configure.ac and Makefile.in files (those pull requests have already been accepted in the Git repo). These simply made it possible for certain options to compile correctly (JIT using precompiled source and bincue support). Additionally a minor change was needed in the sheep_net driver to support Linux kernels v4.11 and newer (also a PR that has been accepted).

So those changes get it to build with all options enabled except for mon debugging, JIT debugging, and Mac OS X support - none of which I tried to enable.

When running with a Mac LCII ROM, 10 MB of RAM, Mac Model IIci, and 68030 CPU (with or without FPU) it will open up a window that is all black and just wait there forever. The window cannot be closed out of. The only way to deal with it is to CTRL+C the process or kill it.

When running with a Mac Quadra 650 Performa 630 ROM, 32 MB of RAM, Mac Model Quadra 900, and 68040 CPU it will open a window for a brief second and then crash with the message `Illegal instruction: 0e05 at 0000feb6` repeated 36 times followed by:

Caught SIGSEGV at address 0x10ffffffc [IP=0x780a54f7]
D0: 0000773f D1: 00000800 D2: dc000e05 D3: 205f4e75
D4: 00000000 D5: 00000000 D6: 00000000 D7: 00000000
A0: 02003378 A1: 02003760 A2: 0201c68a A3: fffffffc
A4: 00000000 A5: 0000b190 A6: 020000f6 A7: 0000feb0
USP=00000000 ISP=0000feb0 MSP=00000000 VBR=00000000
T=00 S=1 M=0 X=0 N=0 Z=0 V=0 C=0 IMASK=7
FP0: nan FP1: nan FP2: nan FP3: nan
FP4: nan FP5: nan FP6: nan FP7: nan
N=0 Z=0 I=0 NAN=0
0000feb0: 2700 0000 feb6 0010 2700 MOVE.L D0,-(A3)
next PC: 0000feb2

The only values that change in between runs are the IP, A0, and A1 values.

I have tried several other combinations of settings (fullscreen/windowed, no JIT compiled in, JIT turned off, JIT turned on [which produces a few extra errors], no sound, ...) to no avail.

Do you have any tips for how to proceed?


Author:  rickyzhang [ Mon Aug 21, 2017 1:57 am ]
Post subject:  Re: Running on Fedora

I used 1MB PEFORMA ROM with md5 MD5 (PERFORMA.ROM) = af343f3f1362bf29cefd630687efaa25, 512MB and 68040 CPU disable JIT.

I have never seen segfault without JIT. I'd wonder what addressing mode you are compiling into. I just finished deep diving into BII addressing and wrote a wiki about it.

If you can list address mode https://github.com/cebix/macemu/wiki/Basilisk-II-Core-Emulation-Analysis#addressing, we can look deeper into the issues.

Or you can just follow my suggested configuration and give a try again.

Author:  coderforlife [ Mon Aug 21, 2017 5:43 pm ]
Post subject:  Re: Running on Fedora

That is the MD5 of the Performa ROM I have tried as well.

The end of configure looks like:

Floating-Point emulation core .......... : IEEE fpu core
Assembly optimizations ................. : x86-64
Addressing mode ........................ : direct
Bad memory access recovery type ........ : siginfo

Fedora does support 0-addresses for memmapping I believe and I have enabled low-address mapping it in sysctl and in SELinux (without it being enabled in both of those it would complain about zero-mapping and just close, not segfault). However it seems to have selected 'direct' and not 'real'.

What is your suggested configuration?

Author:  rickyzhang [ Mon Aug 21, 2017 7:18 pm ]
Post subject:  Re: Running on Fedora

RTFM https://github.com/cebix/macemu/wiki/Basilisk-II-Core-Emulation-Analysis#mapping-in-real-addressing

Author:  coderforlife [ Mon Aug 21, 2017 7:21 pm ]
Post subject:  Re: Running on Fedora

There is nothing in there that says that is the recommended option... will try with real addressing.

Author:  coderforlife [ Mon Aug 21, 2017 7:26 pm ]
Post subject:  Re: Running on Fedora

The same problem still occurs with real and banks addressing modes.

Author:  rickyzhang [ Mon Aug 21, 2017 7:58 pm ]
Post subject:  Re: Running on Fedora

1. Address mode is your choice. Linux host can support all three as I have tested.

2. Real address mode is the easiest and fastest address mode. You need to RTFM and disable GCC optimization.

3. You don't list segfault under different modes nor you told me what you have done in guest OS. I can't help you further.

4. From your first segfault text. You were under direct address mode. One of M68k address register A3 is fffffffc. And you are only assign 32MB RAM for guest OS. The segfault happens in 0x10ffffffc. I believe the App you run in guest Macintosh OS may have bug. Since A3 is way out of bound of 32MB guest RAM address. Since it access host RAM didn't initialize by mmap, it is segfault for sure.

Author:  DLudwig255 [ Mon Aug 21, 2017 8:31 pm ]
Post subject:  Re: Running on Fedora

This looks like a bit like a JIT-related bug that I saw recently, whereby a 1 MB Performa ROM was leading to a crash, but only when JIT was enabled.

Are you sure that JIT is turned off? To double check, try adding "jit false" to your Basilisk II prefs file (probably in ~/.basilisk_ii_prefs).

Author:  Cat_7 [ Mon Aug 21, 2017 8:45 pm ]
Post subject:  Re: Running on Fedora

I just compiled both cebix/macemu and davidludwig/macemu on Fedora 26.

Both SDL and X builds from cebix/macemu build and run.
Only X version of davidludwig/macemu runs, SDL version shows empty prefs editor window.

rom: Quadro650, disk from running Mac OS 8. Machine: Quadra 900, CPU 68040

Command lines for both:
NO_CONFIGURE=1 ./autogen.sh
./configure (for X version)
./configure --enable-sdl-video --enable-sdl-audio (for SDL builds)

jit is off by default on Basilisk builds.


Author:  rickyzhang [ Mon Aug 21, 2017 9:22 pm ]
Post subject:  Re: Running on Fedora


To better help you trace the issue, I fixed mon option in PR https://github.com/cebix/macemu/pull/124

option in your configure and see if you can dig deepr.

Author:  coderforlife [ Tue Aug 22, 2017 2:05 am ]
Post subject:  Re: Running on Fedora

To answer several of the questions above:
  • This is not a "bad app" as BasiliskII only runs for 330 ms (61ms user time, 12ms sys time). Also it happens with a disk that works with a Windows BasiliskII, the Mac OS 8 Boot Image, just a blank hard drive, or no hard drives at all.
  • The MD5 of the PERFORMA image I am trying matches the successful one above so it doesn't seem like it would be a ROM issue.
  • I get the same errors with and without JIT (and now I am just testing it without JIT even being built at all so clearly not able to JIT).
  • Any of the settings (during configure or at runtime, as long is a 1MB ROM) I try all produce the symptoms: dumping of tons of the same illegal instruction followed by a segfault. This means that with real, direct, or banks addressing I get the segfault. The values in the error messages are fairly consistent, but change slightly between runs (understandably). The 512K ROMs just lock up without segfaulting.

A list of the configurations and outputs from 4 different runs (X and SDL, direct and real) can be seen at: https://pastebin.com/h8D48BzU

I will be trying `mon` tomorrow.

One other thing to note that I just tried now is telling it to ignore illegal memory accesses which causes it to not segfault but just hangs on a pure black window. After a little while additional "Illegal instructions" pour out with a few different values in them.

Author:  rickyzhang [ Tue Aug 22, 2017 2:27 am ]
Post subject:  Re: Running on Fedora

In real address mode, the guest OS memory map to the same address in the host:

Caught SIGSEGV at address 0xfffffffc [IP=0x780b35f6]
D0: 0000773f D1: 00000800 D2: dc000e05 D3: 205f4e75
D4: 00000000 D5: 00000000 D6: 00000000 D7: 00000000
A0: 02003378 A1: 02003760 A2: 0201c68a A3: fffffffc

Address register A3 (fffffffc) happens to be the same at the segfault location 0xfffffffc. If you indeed allocate 32MB, using A3 for addressing must cause segfault in host.

Have you clear pram file?

If yes, please post your preference file and try mon option.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group