Compile/Run BII/SS on Linux: Issues and Where to start?

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

Stephen Coates
Expert User
Posts: 868
Joined: Sat Aug 30, 2003 4:15 pm
Location: UK
Contact:

Compile/Run BII/SS on Linux: Issues and Where to start?

Post by Stephen Coates »

I have loads of BasiliskII setups for Windows, Amiga and BeOS from several years ago, but I now have a new PC with one of those new fangled dual core 64 bit processor things.

The machine does not run Windows as I don't currently have access to a suitable version of Windows to install.

Hence I am running Vector Linux 6 (a distribution based on Slackware). I really could do with running BasilsikII and maybe SheepShaver.

Could someone point me in the direction of a suitable version of BasiliskII which will run on Linux? I am happy to have a go at compiling it if that would be better 8O .

Thanks
Stephen Coates
User avatar
24bit
Forum All-Star
Posts: 1424
Joined: Wed Nov 11, 2009 5:47 pm
Location: Germany

Emulators

Post by 24bit »

Hello,
Sheepshaver I found here:
http://linux.softpedia.com/progDownload ... -7691.html
And Basilisk here:
http://basilisk.cebix.net/
Both are pretty fast with my 64bit Linux host system.
For compatibility reasons I do prefer Mac OS7.6.

Sheepshaver has the known cursor placement error common with all 2.3 releases.
If you are going to compile something new, please let me know!
Gretings!
User avatar
Cat_7
Expert User
Posts: 6169
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Hi, I took the liberty to hijack this thread and adjust it's name :oops:

The older builds do suffer from the cursor placement bug. But that has been resolved some time ago.
However, currently other problems arise in the SheepShaver/Basilisk linux code :cry:

-Running SheepShaver as normal user leads to a problem in mapping memory. (ERROR: Cannot map Low Memory Globals: Permission denied.). For now, this can be solved by setting as root: "sysctl -w vm.mmap_min_addr=0"
and running SheepShaver as root.

-More importantly, on current Linux distros (Like Mandriva 2010, Suse 11.2) the current CVS code reports some errors. When executing ./autogen.sh from the /src/Unix folder, the configure report is:
SDL support ...................... : none
FBDev DGA support ................ : yes
XFree86 DGA support .............. : yes
XFree86 VidMode support .......... : yes
Using PowerPC emulator ........... : yes
Enable JIT compiler .............. : yes
Enable video on SEGV signals ..... : yes
ESD sound support ................ : yes
GTK user interface ............... : gtk2
mon debugger support ............. : no
Addressing mode .................. : real
Bad memory access recovery type .. : siginfo

then "make" gives:
error 1:
main_unix.cpp:139:37: error: X11/extensions/Xxf86dga.h: No such file or directory
main_unix.cpp: In function ‘int main(int, char**)’:
main_unix.cpp:530: error: ‘XF86DGAForkApp’ was not declared in this scope

This is easily fixed by changing src/Unix/main_unix.cpp
#include <X11/extensions/Xxf86dga.h> to
#include <X11/extensions/xf86dga.h>

error 2:
video_x.cpp:50:38: error: X11/extensions/Xxf86dga.h: No such file or directory

This is also easily fixed by changing src/Unix/video_x.cpp to:
#ifdef ENABLE_XF86_DGA
# include <X11/extensions/xf86dga.h>
#endif

error 3:
usr/local/share/SheepShaver\" -g -O2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -c ../kpx_cpu/sheepshaver_glue.cpp -o obj/sheepshaver_glue.o
../kpx_cpu/sheepshaver_glue.cpp:789:2: error: #error "FIXME: You don't have the capability to skip instruction within signal handlers"
make: *** [obj/sheepshaver_glue.o] Error 1

Perhaps also easiliy fixed, but not by me :lol:


-The older build (as kindly linked to by 24bit) and a newer build from code of 2009-08-20 (which doesn't exhibit the above-mentioned FIXME error!) have an issue with SheepShaver related to the X server. I provide two bug reports below:

1.
The program 'SheepShaver' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadCursor (invalid Cursor parameter)'.
(Details: serial 1294 error_code 6 request_code 95 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
Killed

2.
The program 'SheepShaver' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadIDChoice (invalid resource ID chosen for this connection)'.
(Details: serial 665 error_code 14 request_code 53 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
SheepShaver: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.0.

Best,
Cat_7
Amade
Tinkerer
Posts: 63
Joined: Thu Feb 18, 2010 10:09 pm

Post by Amade »

Cat_7 wrote:error 3:
usr/local/share/SheepShaver" -g -O2 -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -c ../kpx_cpu/sheepshaver_glue.cpp -o obj/sheepshaver_glue.o
../kpx_cpu/sheepshaver_glue.cpp:789:2: error: #error "FIXME: You don't have the capability to skip instruction within signal handlers"
make: *** [obj/sheepshaver_glue.o] Error 1
Hm... recently send patch to mailing-list which fixed it for me, is this using the latest source?

The later errors I have only experienced when building with sdl, from what I have tried it seems that this are som problems with cursor code in sdlcursor
After commenting out lines 2242-2265 in video_sdl.cpp haven't triggered this error however cursor is invisible ;)
User avatar
Cat_7
Expert User
Posts: 6169
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Hi,

Yes, that error occurred with the latest source code. I reverted to the 20-08-2009 code to get binaries build. That is an arbitrary date, however.

EDIT: I've got these stable builds for Linux now:
http://www.open.ou.nl/hsp/downloads/BasiliskII.tar.gz (from current code, and without SDL)
http://www.open.ou.nl/hsp/downloads/SheepShaver.tar.gz (from current code and without SDL)

(I fixed the references to Xxf86dga as described above and removed the "volatile" from the "volatile int" from sigsegv.cpp as described below)

Best,
cat_7
Last edited by Cat_7 on Mon Mar 22, 2010 6:55 am, edited 1 time in total.
Stephen Coates
Expert User
Posts: 868
Joined: Sat Aug 30, 2003 4:15 pm
Location: UK
Contact:

Post by Stephen Coates »

*confused* :lol:

I had an attempt at compiling this from Christian's website (http://basilisk.cebix.net/downloads/Bas ... 001.tar.gz) but without success. That would appear to be a very old version though. And I have never been very successful in compiling Linux software for some reason.

I downloaded the file provided by Cat and it worked :).

http://img511.imageshack.us/img511/4669/basilsik.jpg
Amade
Tinkerer
Posts: 63
Joined: Thu Feb 18, 2010 10:09 pm

Post by Amade »

http://www.open.ou.nl/hsp/downloads/SheepShaver.tar.gz (from 20-08-2009 code and without SDL)
Seems like on 32bit linux 'volatile' must be removed from label_hack definition in sigsegv.cpp
From what I looked at what was written about volatile I think removing it shouldn't produce any problems.
And I have never been very successful in compiling Linux software for some reason.
If you want to give it a try you can do

Code: Select all

$ cvs -d :pserver:anoncvs@cvs.cebix.net:/home/cvs/cebix login
(password is "anoncvs")
$ cvs -d :pserver:anoncvs@cvs.cebix.net:/home/cvs/cebix checkout BasiliskII
$ cd BasiliskII/src/Unix
$ ./autogen.sh
$ make
$ ./BasiliskII
User avatar
Cat_7
Expert User
Posts: 6169
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Hi,

I now have two stable builds, both are linked in the earlier post.
BasiliskII now is compiled with JIT-compiler enabled :oops:
For SheepShaver, I edited the source as described above to fix the Xxfdga errors and to remove the "volatile".

Best,
Cat_7
User avatar
24bit
Forum All-Star
Posts: 1424
Joined: Wed Nov 11, 2009 5:47 pm
Location: Germany

BasiliskII.tar.gz and SheepShaver.tar.gz

Post by 24bit »

Hello Cat7,
thank you very much for the two new versions!
Both are doing perfectly well with my SuseLinux 11.0 host system.

Could you probably tell me, in simple words, what I should put in the
BII "SCSI" GUI to assign e.g. a hfs formatted SCSI harddisk with ID4?
I have a SCSI host adapter installed of course, and I can mount devices
via the host system, but there still is the fuzzing around with the
resource forks.
User avatar
Cat_7
Expert User
Posts: 6169
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Hi,

I run SheepShaver of a real partition on my disk. The disk is known sda (so, SCSI disk a, even though it is SATA connected). The seventh partition is sda7, a 2Gb partition, which I reserved for SheepShaver when partitioning the disk. I then formatted it from within SheepShaver after starting from CD.
In the GUI, at the volume entries, I entered /dev/sda7 (so not choosing a hard disk file, but entering that string manually)
The same should work for BasiliskII.

Your disks must have a similar designation, so just try to enter the name/partition number and see if you can format it.

EDIT: I will check the partition type I gave the partition for you as soon as I quit OSX, in which I am now.
My Yast partition tool says the partition type of sda7 is Linux native (type 0x83)

Best,
Cat_7
Last edited by Cat_7 on Tue Mar 23, 2010 11:39 pm, edited 1 time in total.
User avatar
Cat_7
Expert User
Posts: 6169
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Updates for the Basilisk Linux sheep_net networking module

Post by Cat_7 »

Hi, I just sent this messege to the Basilisk developer list. It seems the messege is pending approval...

I would like to commit two updates to files to compile on modern Linux systems for the Linux NetDriver (sheep_net networking module).
Can someone review the changes and perhaps commit the changes?

The files are in /BasiliskII/src/Unix/Linux/NetDriver

In makefile, due to new locations of misc drivers, lines 47-48 need to be changed into:
install -d $(KERNEL_DIR)/kernel/drivers/misc
install -m 644 sheep_net.$(MP) $(KERNEL_DIR)/kernel/drivers/misc

In the sheep_net.c file, lines 23-33 need to be commented out:
/*
#include <linux/config.h>
#include "config.h"
#include <linux/autoconf.h>

#if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
#define MODVERSIONS
#endif

#if defined(MODVERSIONS)
#include <linux/modversions.h>
#endif
*/

Compile instructions for the Sheep_net module:
-Install kernel sources
-cd to BasiliskII/src/Unix/Linux/NetDriver source folder
-make
-su make install

Load the driver with modprobe sheep_net
Start Basilisk/SheepShaverGUI and choose your network card as networking interface, e.g. eth0

Best,
Cat_7
Amade
Tinkerer
Posts: 63
Joined: Thu Feb 18, 2010 10:09 pm

Post by Amade »

Works on 64bit, however need to sudo SheepShaver for it to have access to /dev/sheep_net
User avatar
Cat_7
Expert User
Posts: 6169
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Hi,

Do you mean the fixes I provided work, or the original code?
Yes, to use modprobe you need root permission. However, you can add the module in some module loading script at startup. I don't know the name of the script :x

Best,
Cat_7
Amade
Tinkerer
Posts: 63
Joined: Thu Feb 18, 2010 10:09 pm

Post by Amade »

Patched version. (Original doesn't build)

I meant that I need to run
sudo SheepShaver
otherwise it gives me this:

Code: Select all

SheepShaver warning:
Cannot open /dev/sheep_net (Permission denied). Ethernet will not be available.
ovoskeuiks
Space Cadet
Posts: 1
Joined: Fri Apr 09, 2010 4:47 am

Post by ovoskeuiks »

What user and group has /dev/sheep_net been created with?
ls -l /dev
should show you
then either add yourself to the group
or use sudo chgroup *yourgroup* /dev/sheep_net to change it to a group you can access
Vanfanel
Student Driver
Posts: 15
Joined: Thu Nov 27, 2008 10:01 pm
Location: Spain

Post by Vanfanel »

@Cat_7: Could you build a version with SDL graphics, please?
Current builds you've published work great, but they tear as hell as they're using simply X11 wich doesn't support vsync at all, while SDL on DirectFB does.
SDL graphics would also allow X-free mac emulation with the propper SDL backend selected :)

If you don't want to build it yourself, I would love to have access to your corrected sources so I can compile an SDL-enabled version myself (it's actually preferred).

regards
uhhu
Inquisitive Elf
Posts: 35
Joined: Wed Nov 19, 2008 4:58 pm

Post by uhhu »

Cat_7 wrote: Yes, that error occurred with the latest source code. I reverted to the 20-08-2009 code to get binaries build. That is an arbitrary date, however.

EDIT: I've got these stable builds for Linux now:
http://www.open.ou.nl/hsp/downloads/BasiliskII.tar.gz (from current code, and without SDL)
http://www.open.ou.nl/hsp/downloads/SheepShaver.tar.gz (from current code and without SDL)
Where can I get the source code of these builds?
User avatar
Cat_7
Expert User
Posts: 6169
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

I´m not able to get to my machine right now, due to some unexpected side effects of some vulcano erupting.. But as soon as I get home, I´ll see what I can do.

Best,
Cat_7
Vanfanel
Student Driver
Posts: 15
Joined: Thu Nov 27, 2008 10:01 pm
Location: Spain

Post by Vanfanel »

Wow, that vulcano erupting is causing havoc here in spain with the cloud not allowing many airports to operate!
Good luck getting back home, Cat_7!
User avatar
Cat_7
Expert User
Posts: 6169
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Maybe I can help you directly? I´m in Madrid! :lol:

Cat_7
Vanfanel
Student Driver
Posts: 15
Joined: Thu Nov 27, 2008 10:01 pm
Location: Spain

Post by Vanfanel »

In Madrid?? Cat_7, maybe you need a place to stay after your flight was cancelled!
Count on me, man, for whatever you may need. I'm sorry I didn't read it earlier!
I'm giving you my phone by pm.
User avatar
Cat_7
Expert User
Posts: 6169
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Vanfanel
Student Driver
Posts: 15
Joined: Thu Nov 27, 2008 10:01 pm
Location: Spain

Post by Vanfanel »

Thanks, Cat_7!
Will test them as I get home
Do the compiled versions have JIT enabled?
User avatar
Cat_7
Expert User
Posts: 6169
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

The SheepShaver version has JIT enabled by default. Of the BasiliskII version, I don't remember :cry:
The source code (you need both the source for BasiliskII and SheepShaver and SDL installed) should compile, so you might give it a try yourself.

Best,
Cat_7
Vanfanel
Student Driver
Posts: 15
Joined: Thu Nov 27, 2008 10:01 pm
Location: Spain

Post by Vanfanel »

I tried BasiliskII precompiled version, but it seems to be linked against "esound" (wich I don't like or use, I only use ALSA without Dmix since I never run two sound apps / games at the same time).
I compiled my own version with SDL sound, from the sources you just published, and I get a memory error on start:

Code: Select all

Basilisk II V1.0 by Christian Bauer et al.
Reading ROM file...
*** glibc detected *** ./BasiliskII: free(): invalid pointer: 0x782e0760 ***
======= Backtrace: =========
/lib/libc.so.6[0xb6d17734]
/lib/libc.so.6[0xb6d18e13]
/lib/libc.so.6(cfree+0x6d)[0xb6d1be5d]
./BasiliskII[0x7804fbe2]
======= Memory map: ========
10000000-11110000 rw-p 00000000 00:00 0 
78048000-781ad000 r-xp 00000000 08:03 640915     /root/mac68k/BasiliskII/src/Uni
x/BasiliskII
782ac000-782e0000 rwxp 00164000 08:03 640915     /root/mac68k/BasiliskII/src/Uni
x/BasiliskII
782e0000-784c7000 rw-p 00000000 00:00 0 
78d8a000-78f3c000 rw-p 00000000 00:00 0          [heap]
b6600000-b6621000 rw-p 00000000 00:00 0 
b6621000-b6700000 ---p 00000000 00:00 0 
b6769000-b6801000 r--p 00000000 08:03 1517172    /usr/share/fonts/dejavu/DejaVuS
ans.ttf
b6801000-b6803000 r-xp 00000000 08:03 1491628    /usr/lib/pango/1.6.0/modules/pa
ngo-basic-fc.so
b6803000-b6804000 r--p 00001000 08:03 1491628    /usr/lib/pango/1.6.0/modules/pa
ngo-basic-fc.so
b6804000-b6805000 rw-p 00002000 08:03 1491628    /usr/lib/pango/1.6.0/modules/pa
ngo-basic-fc.so
b6805000-b680b000 r--s 00000000 08:03 1475486    /var/cache/fontconfig/87f5e0511
80a7a75f16eb6fe7dbd3749-x86.cache-2
b680b000-b681b000 r--s 00000000 08:03 1475438    /var/cache/fontconfig/8d4af6639
93b81a124ee82e610bb31f9-x86.cache-2
b681b000-b6822000 r--s 00000000 08:03 1476687    /var/cache/fontconfig/12b26b760
a24f8b4feb03ad48a333a72-x86.cache-2
b6822000-b6835000 r--s 00000000 08:03 1476156    /var/cache/fontconfig/4b5cf4386
f1cde02a336ba961b4ac82d-x86.cache-2
b6835000-b683a000 r--s 00000000 08:03 1476155    /var/cache/fontconfig/d62e99ef5
47d1d24cdb1bd22ec1a2976-x86.cache-2
b683a000-b683d000 r--s 00000000 08:03 1475452    /var/cache/fontconfig/f6b893a72
24233d96cb72fd88691c0b4-x86.cache-2
b683d000-b6842000 r--s 00000000 08:03 1476138    /var/cache/fontconfig/f349e9996
a5320f6dd491cedd2b1f964-x86.cache-2
b6842000-b6882000 r--s 00000000 08:03 1476121    /var/cache/fontconfig/17090aa38
d5c6f09fb8c5c354938f1d7-x86.cache-2
b6882000-b68c2000 r--s 00000000 08:03 1476112    /var/cache/fontconfig/df311e82a
1a24c41a75c2c930223552e-x86.cache-2
b68c2000-b6976000 r-xp 00000000 08:03 1920974    /usr/lib/libasound.so.2.0.0
b6976000-b6979000 r--p 000b4000 08:03 1920974    /usr/lib/libasound.so.2.0.0
b6979000-b697a000 rw-p 000b7000 08:03 1920974    /usr/lib/libasound.so.2.0.0
b697a000-b6984000 r-xp 00000000 08:03 1518536    /lib/libnss_files-2.10.1.so
b6984000-b6985000 r--p 00009000 08:03 1518536    /lib/libnss_files-2.10.1.so
b6985000-b6986000 rw-p 0000a000 08:03 1518536    /lib/libnss_files-2.10.1.so
b6986000-b698f000 r-xp 00000000 08:03 1518523    /lib/libnss_nis-2.10.1.so
b698f000-b6990000 r--p 00008000 08:03 1518523    /lib/libnss_nis-2.10.1.so
and the configuration report is as follows:

Code: Select all

./configure  --enable-jit-compiler  --disable-nls  --without-esd  --enable-sdl-video  --enable-sdl-audio --disable-xf86-vidmode  --disable-xf86-dga



SDL support ............................ : video audio
XFree86 DGA support .................... : no
XFree86 VidMode support ................ : no
fbdev DGA support ...................... : no
Enable video on SEGV signals ........... : yes
ESD sound support ...................... : no
GTK user interface ..................... : gtk2
mon debugger support ................... : no
Running m68k code natively ............. : no
Use JIT compiler ....................... : yes
JIT debug mode ......................... : no
Floating-Point emulation core .......... : IEEE fpu core
Assembly optimizations ................. : i386
Addressing mode ........................ : direct
Bad memory access recovery type ........ : siginfo



So I tried to compile a version with this configuration (the default one)

Code: Select all

Basilisk II configuration summary:

SDL support ............................ : none
XFree86 DGA support .................... : yes
XFree86 VidMode support ................ : yes
fbdev DGA support ...................... : no
Enable video on SEGV signals ........... : yes
ESD sound support ...................... : no
GTK user interface ..................... : gtk2
mon debugger support ................... : no
Running m68k code natively ............. : no
Use JIT compiler ....................... : no
JIT debug mode ......................... : no
Floating-Point emulation core .......... : IEEE fpu core
Assembly optimizations ................. : i386
Addressing mode ........................ : direct
Bad memory access recovery type ........ : siginfo



...but all I get is the same errors.
I'm on gentoo linux and my kernel is 2.632-zen.


Any ideas?
Post Reply