PearPC for OSX available

[ARCHIVED] About PearPC, a mostly obsolete PPC Mac emulator for Windows and Linux to run MacOS X 10.1 up to 10.4. Using QEMU is now recommended.

Moderators: Cat_7, Ronald P. Regensburg

User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

PearPC for OSX available

Post by Cat_7 »

Hi,

I have compiled a version of PearPC for OSX from the latest source. For now, it uses the generic emulation which makes this build slow as a slug.

To run you need:
-the program (included in the download)
-the video.x file (included in the download)
-a config file (create one yourself from the original documentation or copy from e.g. a windows installation and adapt the path to the hard disk image file)
-a hard disk image file (best to copy one from an existing windows installation)

It's a X application, to be started from a Terminal window. Go to the folder you downloaded the application in and execute the command:
./ppc "name_of_your_config_file"

Get it here https://surfdrive.surf.nl/files/index.p ... v/download

I haven't played around with networking or CD/DVD support, so you are on your own with that.

Cat_7
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

When trying to compile a JIT-version, I get these errors:

gcc -DHAVE_CONFIG_H -I. -I../../.. -I ../.. -DPREFIX=_ -MT jitc_mmu.o -MD -MP -MF .deps/jitc_mmu.Tpo -c -o jitc_mmu.o jitc_mmu.S
jitc_mmu.S:43:Unknown pseudo-op: .struct
jitc_mmu.S:43:Rest of line ignored. 1st junk character valued 48 (0).
jitc_mmu.S:44:Unknown pseudo-op: .struct

It seems the declaration of such structs isn't supported? I don't know, maybe someone can help me understand what is going on?

Best wishes
Cat_7
User avatar
ClockWise
Site Admin
Posts: 4397
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang

Post by ClockWise »

I that the guy from over here - http://www.emaculation.com/forum/viewtopic.php?t=5573 - take a look at your work
j5
Space Cadet
Posts: 7
Joined: Wed Sep 23, 2009 6:34 pm

Thanks

Post by j5 »

Thanks for the build. CD access seems to be working fine I'm doing a fresh install of 10.2 right now.

I had to comment out networking, adjust the speed to 500 and I also disabled USB. Once I get it installed, I will try networking... I think that the networking issue I was having was because the cfg I based off of was on redscorp version of source.

For the JITC build issues, I don't know anything about this kind of programming but my gut feeling is that there is logic which sees the environment as OSX and automatically assumes that we're running a PPC processor. There are some old threads around about modding PearPC to build on PPC OS X without JITC that make me think that this build is actually running through Rosetta.

And as I write this post, my installer has crashed LOL. Oh well.
j5
Space Cadet
Posts: 7
Joined: Wed Sep 23, 2009 6:34 pm

Post by j5 »

It seems that maybe this build won't support networking at all, please correct me if I'm wrong.

Tried to compile also (redscorp source to get networking) and got the same error. Did a little digging around and the .struct pseudo-op is defined in the GNU assembler (as) in binutils 2.17 docs that I found so it should not be too difficult to get it working.

Tried to compile/install latest gcc suite from mac open source (can provide URL if you want) but it complained about stdargs.h being missing in Leopard SDK which was leading me down a rabbit hole to installing Tiger 10.4u SDK and then who knows if I would even get the GCC compiling under that or if that would help the build of PearPC.

What commands did you run to make this build? Do you know the versions of what programs and libraries and such are in your tool chain and how they compare to the windows and linux toolchains that the original devs were using?
j5
Space Cadet
Posts: 7
Joined: Wed Sep 23, 2009 6:34 pm

Post by j5 »

Oh, also, when I tried to compile redscorp sources with --enable-cpu=generic I got errors about unknown pseudo-op .balign if you're curious about that.

Again I'm going to blame the toolchain.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

The networking solutions in PearPC have all been developed for Linux and Windows. But as they support using a tap device, have you tried installing a tap driver in OSX and use that. Furthermore, OSX 10.2 can only be networked in earlier versions of PearPC. Please search the forum for my post about that.

The tool chain does indeed throw those errors (also with the original sources), and I think it is proof of the need to rewrite assembly statements for OSX. No one ever took up that task.

Cat_7
j5
Space Cadet
Posts: 7
Joined: Wed Sep 23, 2009 6:34 pm

Post by j5 »

I'm going to start a new thread on building PearPC on OS X so that this thread isn't bogged down with all these details that someone who just wants to USE the thing isn't interested in.

From a "use the thing" standpoint right now I have the PearPC install on OS X and a copy of the same HD img running in XP under VirtualBox. The VirtualBox/XP/PearPC/Panther stack is impossible to use for me because the mouse is "crazy" in there.

I would prefer not to have to use the VirtualBox/XP deal so either I can get a satisfactory VM going with PearPC/OSX or I perhaps under Darwine.

I have installed TunTap for OS X and edited my cfg files so that the 3COM card is enabled. I am not sure how to configure it as a couple of the parameters from my redscorp config file are not recognized (_type and _interface).

I will look over the old threads / docs on configuring it in other POSIX environments and see if I can figure it out. Pointers are welcome.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

As with SheepShaver, the tap device needs to be enabled manually. Maybe the source should be adapted to start the OSX tap device as root?

Cat_7
alestanga
Space Cadet
Posts: 3
Joined: Sun Oct 04, 2009 8:06 am

Post by alestanga »

i'm in trouble with the keyboard.
i can't press 1 or 2 in the boot selection menu, and even i can't press enter or backspace.
the keyboard is messed up in pearpc, if i press d it shows 1, if i press f it shows 2 and so on.
cmd releases the mouse but i have selected F5 in the config file.
the keyboard doesn't work in the booted system as well. (mac os 10.3)
my host system is 10.6.1 on an iMac C2D.
what should i do? upgrade X11 using xquartz? i don't think that xquartz is available for mac os 10.6
i'm the only one with such strange keyboard behavior?
thanks,
Ale.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Hi,

Do you have english set as language in OSX and are you using the US/US-International keyboard setting? If not, then the translation of keys to PearPC might be troubled.

Cat_7
alestanga
Space Cadet
Posts: 3
Joined: Sun Oct 04, 2009 8:06 am

Post by alestanga »

i'm using english language in OSX and i've tried italian pro keyboard and also US keyboard, in the OSX input menu.
maybe there's a way to set english keyboard for X11?
i've tried "Follow system keyboard layout" in X11 preferences but it doesn't work :(
thank's for you support and also for your OSX pearpc build!!
alestanga
Space Cadet
Posts: 3
Joined: Sun Oct 04, 2009 8:06 am

Post by alestanga »

i tried on my macbook, it doesn't work :(
mac os 10.6.1, u.s. international keyboard - pc, your pearpc build, same thing.
d=1, f=2, z=5, x=6...
so weird.
i'm the only one experiencing this behaviors with mac os 10.6.1?

p.s. xterm works. 1=1 2=2 d=d f=f :)
how did you compiled pearpc?
i tried with svn version and i have a few errors regarding x11.
x not found.
-lx11 errors.
i have x11 installed, maybe there's an option to install x11 headers?
/usr/X11/include/ exists and is filled in with a lot of .h :)
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Did you try to compile from within an Xterm window and not from Terminal itself. And you need to compile the generic cpu version, not the jit version.

Cat_7
milmacman
Space Cadet
Posts: 6
Joined: Sat Jan 02, 2010 8:17 am
Location: Wisconsin

Post by milmacman »

I've got it running right now under 10.6.2, but it's extremely slow. Grey Apple has been up for about 45 minutes. (using the pearpc_osx_generic build)...

Hexed on the JIT stuff, but even the MacPorts version of PearPC (0.4) with generic won't go (either on terminal or xterm).
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Hi,

Yes, the only version running in OSX is the generic cpu version. No one has taken up the task to adjust the code for the jit cpu version to run in OSX.

Best,
Cat_7
milmacman
Space Cadet
Posts: 6
Joined: Sat Jan 02, 2010 8:17 am
Location: Wisconsin

Post by milmacman »

Hmmm. I don't have much of an idea, though I've tried again with Xcode on Snow, and get the same JIT issues.

My question is: if the JIT compiles on Linux x86, then is it possible the issue might lie with the compiler/Xcode put out by Apple--in other words, if it were possible to cross-compile PearPC builds for Darwin 9/10 x86 (and Darwin 9 PPC) on a Linux box, might that (at least in theory) compile cleanly?

True, it wouldn't provide a universal binary and PowerPC Mac users would be in the dark without a separate build--but the separate builds in themselves defeat the purpose of a UB.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

You might give it a try!

The issue with compiling in Xcode is that the assembly used in the source code is not in a notation Xcode understands.

A Universal Binary can easily be made by combining two versions of the program into one file using the "lipo" command.

Best,
Cat_7
fernandovalente
Student Driver
Posts: 20
Joined: Tue Nov 11, 2008 1:34 am

Post by fernandovalente »

It doesn't find any bootable partition. Any help is appreciated.
t3rra
Student Driver
Posts: 11
Joined: Mon May 17, 2010 9:44 am

Post by t3rra »

pseudo op error on JIT build compile could be worked around by substituting using with .align or .org instead of .struct in the define lines if I am correct. But it seems pearpc should be compiled as 32 bit code rather than 64 bit which is default on SL. however, i cannot make gcc to compile in 32 bit even I have supplied -arch i386 to CFLAGS on configure.

Currently I get following errors

{standard input}:9323:suffix or operands invalid for `xchg'
{standard input}:9339:suffix or operands invalid for `xchg'
make[4]: *** [ppc_mmu.o] Error 1

which still seems because of gcc trying to compile it as 64 bit code.

I tried many combination on configure and the last one was

CFLAGS="-arch i386" CXXFLAGS="$CFLAGS" ./configure --enable-ui=x11 --enable-release --disable-debug --enable-cpu=jitc_x86 --target=i686-apple-darwin10 --build=i686-apple-darwin10 --host=i686-apple-darwin0

I hope we could get it working on os x otherwise too slow to work with.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Post by Cat_7 »

Hi,

Thanks for looking into this!
Isn't -m32 working to get a 32 bit build?

Best,
Cat_7
t3rra
Student Driver
Posts: 11
Joined: Mon May 17, 2010 9:44 am

Post by t3rra »

I changed slightly to

CFLAGS="-march=i386 -arch i386 -m32" CXXFLAGS="-march=i386 -arch i386 -m32" ./configure --enable-ui=x11 --enable-release --disable-debug --enable-cpu=jitc_x86 --target=i686-apple-darwin10

but it still tries to compile in 64 bit. weird.. there should be another -correct- way to do. I will experiment more and post if theres any progress.
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Post by Ronald P. Regensburg »

Not sure, but wouldn't "-arch x86_32" instead of "-arch=i386" force compiling in 32 bit?
t3rra
Student Driver
Posts: 11
Joined: Mon May 17, 2010 9:44 am

Post by t3rra »

I do not really know but x86_32 seems not working. i386 working as said on many of the sites.

It appears configure produced Makefile does not contain correct option to compile assembly files. It should contain -arch i386 otherwise the assembler works for 64 bit which is default. I have manually edited src/cpu/cpu_jitc_x86/Makefile and it seems it tries to compile 32 bit code.

However, some errors of many errors are by multi line macro function pg_table_lookup. It seems assembler on OS X does not like multi line macro function. It produces errors even after editing so that there are no character between backslash and newline but no go.

Still there are many errors like

Can't relocate expression. Absolute 0 assumed
suffix or operands invalid for `jne'
...

any suggestions?
fernandovalente
Student Driver
Posts: 20
Joined: Tue Nov 11, 2008 1:34 am

Post by fernandovalente »

There X86_64, but X86_32. Intel 32bit is i386.
Locked