Building SheepShaver x86 Linux

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

Guest

Compiling SheepShaver

Post by Guest »

145.1

Hello all!
I thought I would give Sheepshaver a try and compile it for my Zaurus 760. I've compiled Basilisk II for it -which is just awesome- and I thought I would just give SS a try.

Now the Z760 is is an Xscale ARM CPU but I thought I read that SS would compile on other CPUs now. I could be wrong here.

Anyway I can do:

make links
/src/Unix/autogen.sh
make

Make runs for a bit but then I get this error:

ENTRANT -DDATADIR=\"/usr/local/share/SheepShaver\" -g -O2 -I/usr/X11R6/include
-I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -c clip_
unix.cpp -o obj/clip_unix.o
clip_unix.cpp: In method `uint8 * ByteArray::data()':
clip_unix.cpp:145: implicit declaration of function `int at(...)'
clip_unix.cpp:145: non-lvalue in unary `&'
clip_unix.cpp: In function `bool handle_selection_TARGETS(XSelectionRequestEvent
*)':
clip_unix.cpp:559: no matching function for call to `vector<long int,allocator<l
ong int> >::at (int)'
make: *** [obj/clip_unix.o] Error 1

Now I thought the make links worked ok but does this look like an error because of a bad link to unix.cpp?

Thanks!
Mark
Mac Emu
Forum All-Star
Posts: 1208
Joined: Mon May 20, 2002 11:50 am
Location: Ouraion

Post by Mac Emu »

I may be wrong, but clip_unix.cpp may be the file giving SheepShaver clipboard support and might be commentable out of the includes and make files?
Guest

Post by Guest »

I tried installing (and also compiling) the 2.2-4 package under a full Cygwin install over a month ago with no success. Here's rpm output for missing dependencies

$ rpm -Uvh SheepShaver-2.2-4.i586.rpm
error: Failed dependencies:
ld-linux.so.2 is needed by SheepShaver-2.2-4
libaudiofile.so.0 is needed by SheepShaver-2.2-4
libc.so.6 is needed by SheepShaver-2.2-4
libdl.so.2 is needed by SheepShaver-2.2-4
libesd.so.0 is needed by SheepShaver-2.2-4..
Using an rpm compiled for linux wont work on cygwin. linux uses shared objects (so) while cygwin uses windows dlls.

I too tried compiling ss on cygwin. make borks with:
../kpx_cpu/sheepshaver_glue.cpp:601:2: #error "FIXME: You don't have the capability to skip instruction within signal handlers"

I had this on linux but the error went away after I fixed up my libraries. The error seems to be some kind of a FIXME/TODO from the author. It relates to SIGSEGV btw (segment violations). So I think that ss is more hardware specific in terms of system calls that are specific to an OS. This makes me think that ss wont work on cygwin at this stage, if at all.

However, I am probably totally wrong but anyone else had any success in compiling ss under cygwin? I know it begs the question why?, I agree ;)
Guest

Post by Guest »

The sheep_net configuration I had to left out, as I know nothing yet about compiling nor cvs downloading. Therefore I wonder if anyone could make a sort of binary installer that does everything at once for the newest 2.2.8 of sheepshaver? (Could also be that i'm mistaken regarding the networkinterface, I've only placed one NIC in my box (eth0), perhaps sheepshaver doesn't emulate another MAC as basilisk in windows does.
If no such binary installer available, would be in debth of the one that will post some guide for totally linux-newbies?
Networking is not implemented yet AFAIK.
Mac Emu
Forum All-Star
Posts: 1208
Joined: Mon May 20, 2002 11:50 am
Location: Ouraion

Post by Mac Emu »

No, but I sort of had success compiling Basilisk II on Cygwin.

(Thanks for the shared objects <=> dll explaination)

http://forums.delphiforums.com/MacEmula ... sg=4393.43

Image
robotintestines
Tinkerer
Posts: 61
Joined: Fri Sep 12, 2003 4:16 am

Post by robotintestines »

After 8 hours, I finally have Mandrake 9.1 installed. I installed it for the sole purpose of running SheepShaver.

When I type "make links" into the terminal, I get the following errors: (There are many, but they all say the same thing)

Code: Select all

ln: When making multiple links, last argument must be a directory

I have never used Linux before. Maybe I don't have enough of the development things installed. There are a LOT of them. Are there any specific ones I need?


EDIT: Using the create.sh scripts worked for some eason. Now I have to dig around under my bed for my service source cd's.
ShadowFox

Post by ShadowFox »

Anyone know what is holding SheepShaver back from running OS 9? I know now it's limited to 8.6, but is it something in the emulation which prevents it from running?

I'd imagine if it can boot 9, it may not be too hard to coax it into running OSX (which I can imagine would open all sorts of controversy all accross the board ;) )
ataxy
Master Emulator
Posts: 374
Joined: Sun Jan 25, 2004 3:49 pm
Location: Canada
Contact:

Post by ataxy »

dont hit me for saying something i am not sure of but i think its about os9 needing a new world rom and sheepshaver using only pci old world rom
Marc
Master Emulator
Posts: 357
Joined: Wed Aug 20, 2003 2:14 pm

Post by Marc »

ShadowFox wrote:I'd imagine if it can boot 9, it may not be too hard to coax it into running OSX (which I can imagine would open all sorts of controversy all accross the board ;) )
OS 9 is a lot more similar to OS 8 than to OS X.
Cat_7

SheepShaver Networking patches

Post by Cat_7 »

Hello All,

With the help of the build description in Jackalo's guide and the installation of some missing packages I finally managed to build SheepShaver. Those nasty little words in the beginning....;-) (....and install all the development and Gnome packages to prevent aclocal errors when building...)

I had these errors, just as some others do posting here.

At the end of the description it says to disable sound and ethernet.

That is were my little story starts:

It is no longer nesseccary to disable at least ethernet, as it is working rather nice after you have applied the patches from gwenole's website.

I downloaded sheep_ethernet.diff and SheepShaver-2.2-hacks.patch.
These patches are applied to the cvs code before doing the routine as described by jackalo.

As the two files are results from a diff command on the whole source there are patches to several files containted in it. These files are not even in the same directory. But you can use the "patch" command to apply them to your source.

There is probably a much nicer way to do al this, but alas, to me this is cutting-edge knowlegde

I put my patch files in a directory "/cvs/patch" beside basiliskII and SheepShaver
Fill in your preferred locations as you go along.


Now, you can find the files that are going to be patched by looking into the code of the .diff and .patch file.

sheep_ethernet.diff starts with patching "ether.cpp"
SheepShaver-2.2-hacks.patch starts with patching "main_unix.cpp"

Assuming you start with the sheep_ethernet.diff file:

-cd to the /cvs/Sheepshaver/src/ directory where ether.cpp lives. There you then just use
-patch </cvs/patch/sheep_ethernet.diff

Patch finds the first file it is supposed to patch. It may tell you it found a reversed or previously applied patch. Just answer the default "n"

-so hit "Enter"

Patch asks you to apply anyway

-hit "y" and "Enter"

Patch then parses the .diff file. After some messages it asks you " File to patch:"

-Look at the filename mentioned just after the last " +++" entry.
-Type the path to the file being patched and hit "Enter"

Continue this until Patch is done.


The other file you downloaded (SheepShaver-2.2-hacks.patch) is also a result of a diff command, so you can use the same procedure for this file.
To help you on the way: the first file it wants to patch is called "main_unix.cpp"

So cd to directory where it lives (/cvs/SheepShaver/src) and type

-patch </cvs/patch/SheepShaver-2.2-hacks.patch

and continue alang the same line as described above.

After this you can use the description of Jackalo again to build SheepShaver, and with the same beady little eyes it will now start to look at the internet for you.....(don't forget to activate the eth0 in the configuration dialog;-)


Happy patching, and happy networking!

Cat_7
rakslice

patch

Post by rakslice »

You can give patch the -p0 option to get it to use the directory names listed in the patch file, starting from the current directory, so you don't have to enter a whole bunch of filenames. For example:

Code: Select all

patch -p0 -i sheep_ethernet.diff
tonei

Where did you download the patch and diff from

Post by tonei »

Where did you download the patch and diff from?
tonei

Post by tonei »

http://gwenole.beauchesne.free.fr/sheepshaver/files/

Ok got it compiled but it can't find dev/sheep_net - no such file or directory. How do I get this piece made?
tonei

Post by tonei »

The sheep_net module is included in the Basilisk II source
distribution in the directory "src/Unix/Linux/NetDriver". You have
to compile and install the module yourself:

$ su
[enter root password]
# make
# make dev
[this will create a /dev/sheep_net device node; you should give
appropriate access rights to the user(s) running Basilisk II]
# insmod sheep_net.o

--------------------

tried to follow these instructions - but it does not compile. Here are the last errors:
sheep_net.c:592: error: conflicting types for `sheep_net_receiver'
sheep_net.c:93: error: previous declaration of `sheep_net_receiver'
sheep_net.c: In function `sheep_net_receiver':
sheep_net.c:617: error: dereferencing pointer to incomplete type
sheep_net.c:617: error: dereferencing pointer to incomplete type
sheep_net.c:617: error: dereferencing pointer to incomplete type
sheep_net.c:636: warning: passing arg 1 of `__wake_up' from incompatible pointer type
make: *** [sheep_net.o] Error 1
Mac Emu
Forum All-Star
Posts: 1208
Joined: Mon May 20, 2002 11:50 am
Location: Ouraion

Post by Mac Emu »

tonei wrote:
[you should give appropriate access rights to the user(s) running Basilisk II]
Would this step involve chmod? Or does it somehow involve the insmod command on the next line? Thanks.
Guest

Post by Guest »

tonei wrote:The sheep_net module is included in the Basilisk II source
distribution in the directory "src/Unix/Linux/NetDriver". You have
to compile and install the module yourself:

$ su
[enter root password]
# make
# make dev
[this will create a /dev/sheep_net device node; you should give
appropriate access rights to the user(s) running Basilisk II]
# insmod sheep_net.o

--------------------

tried to follow these instructions - but it does not compile. Here are the last errors:
sheep_net.c:592: error: conflicting types for `sheep_net_receiver'
sheep_net.c:93: error: previous declaration of `sheep_net_receiver'
sheep_net.c: In function `sheep_net_receiver':
sheep_net.c:617: error: dereferencing pointer to incomplete type
sheep_net.c:617: error: dereferencing pointer to incomplete type
sheep_net.c:617: error: dereferencing pointer to incomplete type
sheep_net.c:636: warning: passing arg 1 of `__wake_up' from incompatible pointer type
make: *** [sheep_net.o] Error 1

i get the same errors :(
ShadowFox
Tinkerer
Posts: 70
Joined: Thu Feb 05, 2004 4:41 am
Location: Connecticut

Post by ShadowFox »

Marc wrote: OS 9 is a lot more similar to OS 8 than to OS X.
Yes, I am aware of this, but once it runs OS9, theoretically wouldn't it be possible to get some XPostFacto or some such to lob it into the world of OSX?

I guess the big question becomes, is it just a matter of extra code to get SheepShaver up to running 9.x, or is the current architecture of the program just not capable of new world emulation?
Mac Emu
Forum All-Star
Posts: 1208
Joined: Mon May 20, 2002 11:50 am
Location: Ouraion

Post by Mac Emu »

This was posted by Gwenole about a month ago here: http://forums.delphiforums.com/MacEmula ... g=4836.104

"Hi,
Concerning MacOS 9.X emulation. I think you first need proper NewWorld ROM support. Unless knowing some internals like how MacOS NanoKernel data structures are setup, you might have to go through some basic system emulation (PowerPC OEA mode -- Operating Environment Architecture) and some kind of OpenFirmware emulation.

Actually, with a NewWorld ROM v1.6, you can boot MacOS 9.0.4 up to the point where it tells you the machine is not supported (error 102). This is with some basic hackery around the DR emulator initialization (otherwise it crashes when writing things to something like 0x69000000, the location of MacOS DR cache).

I am working on ports to other Unix platforms. I have no intend (neither know yet how) to do the Windows port but I have posted on the B2 -devel list things that are first required to do and get to work.

The PowerPC model emulated is something like G3-class processor without MMU and other low-level system emulation. I have plans for AltiVec emulation but I have yet to find out some real world benchmarks under MacOS. i.e. something that can tell me that altivec is actually used and the gain is measurable without (e.g. fps, performance indices). Basically, work on CPU emulation takes place within Kheperix, an alternate project which consists in CPU + OS syscalls emulation so that e.g. regular Linux/ppc statically linked binaries can be run. You can see that as a testbed environment.

Concerning MacOS X emulation. This cannot happen in current SheepShaver infrastructure. SheepShaver actually intimely communicates with MacOS. As any OS, there is an ABI (Application Binary Interface) and runtime that defines how programs are run, how functions are called, etc. MacOS X uses a different ABI than MacOS Classic.

Concerning a MacOS X port. I have started to try a build with the CPU emulator under MacOS X with Apple X11 server. I will only concentrate on Unix/X11 ports, letting other people with the relevant Aqua and friends knowledge to do that. So far, it crashes in two locations. One part was due to MacOS writing something to the ROM area. It's normally write-protected but it seems that under osx 10.2, mapping a page with the execute bit implies it to be writable. Weird. As to the other crash, I don't know, I went to sleep. ;-)

IMHO, the best help to the development would be to get more insights of MacOS internals to offer better & faster emulation. If you were Apple, I would have a list of some things of MacOS Classic I would like to see disclosed. ;-) Back to real world, I don't quite know besides testing things or developing SheepShaver features. I personally would like to concentrate more on the CPU emulation with a new JIT infrastructure to reach a higher performance level. I have many ideas but little time. Basically weekends and some nights, so progress is slow."
MacNostalgia
Student Driver
Posts: 10
Joined: Wed Jan 21, 2004 10:26 pm

Post by MacNostalgia »

Hi,

I downloaded the latest source (Jan 14th) and succesfully applied sheep_ethernet.diff and SheepShaver-2.2-hacks.patch but when I do ./autogen.sh, I receive the following error:

configure.in:182: warning: AC_TRY_RUN called without default to allow cross compiling
configure.in:182: warning: AC_TRY_RUN called without default to allow cross compiling
creating cache ./config.cache
configure: error: can not run ./config.sub

I'm using MDK 9.1 and automake 1.4-21.p6.mdk. Config.sub and config.guess has been istalled to /usr/share/automake-1.4/

I also modified autogen.sh with "aclocal-1.4 $aclocalinclude; \"

Any hint appreciated :)
Last edited by MacNostalgia on Fri Feb 13, 2004 8:56 am, edited 1 time in total.
Guest

Post by Guest »

What is the minimal set of Slackware packages from "n/" which I need for working with VMware tools & KDE base & Sheepshaver ?

My current problem - I can't install vmware tools, it wants 'ifconfig' for
"--compile" option.

( I'm trying :

cd /usr/bin
./vmware-config-tools.pl --compile )
MacNostalgia
Student Driver
Posts: 10
Joined: Wed Jan 21, 2004 10:26 pm

Post by MacNostalgia »

well, I actually resolved above issue by removing AC_CANONICAL_HOST from configure.in. ./autogen.sh now succeeds, however, make now runs into the following problem:

c++ -I../kpx_cpu/include -I../kpx_cpu/src -I../include -I. -DHAVE_CONFIG_H -D_REENTRANT -DDATADIR=\"/usr/local/share/SheepShaver\" -g -O2 -I/usr/X11R6/include -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -c main_unix.cpp -o obj/main_unix.o
main_unix.cpp:88:19: prefs.h: No such file or directory
main_unix.cpp:93:19: xpram.h: No such file or directory
main_unix.cpp:94:19: timer.h: No such file or directory
main_unix.cpp:95:17: adb.h: No such file or directory
main_unix.cpp:96:18: sony.h: No such file or directory
main_unix.cpp:97:18: disk.h: No such file or directory
main_unix.cpp:98:19: cdrom.h: No such file or directory
main_unix.cpp:99:18: scsi.h: No such file or directory
main_unix.cpp:101:19: audio.h: No such file or directory
main_unix.cpp:103:20: serial.h: No such file or directory
main_unix.cpp:104:18: clip.h: No such file or directory
main_unix.cpp:105:19: extfs.h: No such file or directory
main_unix.cpp:106:17: sys.h: No such file or directory
main_unix.cpp:110:22: vm_alloc.h: No such file or directory
main_unix.cpp:111:21: sigsegv.h: No such file or directory
main_unix.cpp:115:19: debug.h: No such file or directory
main_unix.cpp:201: `XPRAM_SIZE' was not declared in this scope
main_unix.cpp: In function `void usage(const char*)':
main_unix.cpp:323: `PrefsPrintUsage' undeclared (first use this function)
main_unix.cpp:323: (Each undeclared identifier is reported only once for each function it appears in.)
main_unix.cpp: In function `int main(int, char**)':
main_unix.cpp:359: `PrefsInit' undeclared (first use this function)
main_unix.cpp:445: `bug' undeclared (first use this function)
main_unix.cpp:445: `D' undeclared (first use this function)
main_unix.cpp:448: `SysInit' undeclared (first use this function)
main_unix.cpp:451: `PrefsFindBool' undeclared (first use this function)
main_unix.cpp:469: `vm_acquire_fixed' undeclared (first use this function)
main_unix.cpp:522: `PrefsFindInt32' undeclared (first use this function)
main_unix.cpp:550: `PrefsFindString' undeclared (first use this function)
main_unix.cpp:579: `XPRAMInit' undeclared (first use this function)
main_unix.cpp:583: `XPRAM' undeclared (first use this function)
main_unix.cpp:603: `SonyInit' undeclared (first use this function)
main_unix.cpp:604: `DiskInit' undeclared (first use this function)
main_unix.cpp:605: `CDROMInit' undeclared (first use this function)
main_unix.cpp:606: `SCSIInit' undeclared (first use this function)
main_unix.cpp:609: `ExtFSInit' undeclared (first use this function)
main_unix.cpp:612: `ADBInit' undeclared (first use this function)
main_unix.cpp:615: `AudioInit' undeclared (first use this function)
main_unix.cpp:621: `SerialInit' undeclared (first use this function)
main_unix.cpp:624: `TimerInit' undeclared (first use this function)
main_unix.cpp:627: `ClipInit' undeclared (first use this function)
main_unix.cpp:643: `VM_PAGE_READ' undeclared (first use this function)
main_unix.cpp:643: `VM_PAGE_EXECUTE' undeclared (first use this function)
main_unix.cpp:643: `vm_protect' undeclared (first use this function)
main_unix.cpp:716: `last_xpram' undeclared (first use this function)
main_unix.cpp:716: `XPRAM_SIZE' undeclared (first use this function)
main_unix.cpp: In function `void Quit()':
main_unix.cpp:840: `XPRAMExit' undeclared (first use this function)
main_unix.cpp:843: `ClipExit' undeclared (first use this function)
main_unix.cpp:846: `TimerExit' undeclared (first use this function)
main_unix.cpp:849: `SerialExit' undeclared (first use this function)
main_unix.cpp:855: `AudioExit' undeclared (first use this function)
main_unix.cpp:858: `ADBExit' undeclared (first use this function)
main_unix.cpp:864: `ExtFSExit' undeclared (first use this function)
main_unix.cpp:867: `SCSIExit' undeclared (first use this function)
main_unix.cpp:868: `CDROMExit' undeclared (first use this function)
main_unix.cpp:869: `DiskExit' undeclared (first use this function)
main_unix.cpp:870: `SonyExit' undeclared (first use this function)
main_unix.cpp:880: `vm_release' undeclared (first use this function)
main_unix.cpp:902: `SysExit' undeclared (first use this function)
main_unix.cpp:905: `PrefsExit' undeclared (first use this function)
main_unix.cpp: In function `void PatchAfterStartup()':
main_unix.cpp:1068: `InstallExtFS' undeclared (first use this function)
main_unix.cpp: In function `void* nvram_func(void*)':
main_unix.cpp:1086: `SaveXPRAM' undeclared (first use this function)
main_unix.cpp: In function `void* tick_func(void*)':
main_unix.cpp:1154: `TimerDateTime' undeclared (first use this function)
make: *** [obj/main_unix.o] Error 1

Especially for a newbie like me, this turns out to become quite frustrating :cry:

Any good soul who succeeded in compiling the Ethernet patched version willing to make a rpm? I know that's quite a cheeky favor to ask for, but the hordes of grateful noobs shall raise their voice and praise the benefactor :D

Or even better: if someone could please explain what seems to go wrong / I do wrong...
Guest

Post by Guest »

orang55 wrote:Well. Not very much.

If a 1.8ghz P4 can only manage 4x as fast as an ancient PPC mac, I wouldn't count on any thrilling performance. An XP 2800 should be able to run any app ancient enough to run in OS 8.6 without too much trouble.

That being said... has anyone tried to compile this under Cygwin yet? I'd be interested to see the results.

Also, is it possible to compile sheepshaver for x86-64? :-) I'm dying to test this thing out...
Gwenole

Post by Gwenole »

SheepShaver will compile and run nicely on AMD64 platforms. With code from current CVS, FPU performance is on par with a G3/300 on an Opteron @ 1.8 GHz. General purpose performance is lower with the current JIT engine.

People willing to contribute patches for Cygwin support are welcome and I had posted the prerequesties for that to work. However, as long as nobody wants to catch in, this will never happen.
Hinsight4
Space Cadet
Posts: 2
Joined: Thu Mar 13, 2003 3:12 pm
Contact:

cvs help

Post by Hinsight4 »

Can anyone add anythign to actually getting the files from cvs? I have tried a bunch of different ways, including what the first post was here, and still haven't even been able to get to the files to begin to compile. Thanks in advance.
ShadowFox
Tinkerer
Posts: 70
Joined: Thu Feb 05, 2004 4:41 am
Location: Connecticut

Post by ShadowFox »

I'm having an issue compiling from CVS. The autogen script seems to run fine, and returns this:

Code: Select all

SheepShaver configuration summary:

XFree86 DGA support .............. : yes
XFree86 VidMode support .......... : yes
Using PowerPC emulator ........... : yes
Enable JIT compiler .............. : yes
Enable video on SEGV signals ..... : no
ESD sound support ................ : yes
GTK user interface ............... : yes
mon debugger support ............. : no
Bad memory access recovery type .. :

Configuration done. Now type "make".
Afterwards, running make, it stops on this:

Code: Select all

g++ -I../kpx_cpu/include -I../kpx_cpu/src -DUSE_JIT -I../include -I. -DHAVE_CONFIG_H -D_REENTRANT -DDATADIR=\"/usr/local/share/SheepShaver\" -g -O2  -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include  -c ../kpx_cpu/sheepshaver_glue.cpp -o obj/sheepshaver_glue.o
../kpx_cpu/sheepshaver_glue.cpp:717:2: #error "FIXME: You don't have the capability to skip instruction within signal handlers"
make: *** [obj/sheepshaver_glue.o] Error 1
I sort of ran through the code quick (I'm new to C/C++, just starting to learn... hope to help out this project some day when I pick up enough to be useful), and it seems to be related to the SEGV functions. I'm running Gentoo 1.4, kernel 2.6.2, and gcc 3.2.3r3. Anything I can do? Thanks!!
Post Reply