forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PPC Mac Emulation on Linux PPC

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS3 Linux Development
View previous topic :: View next topic  
Author Message
billb



Joined: 12 Dec 2007
Posts: 32

PostPosted: Sat Jan 19, 2008 6:02 am    Post subject: PPC Mac Emulation on Linux PPC Reply with quote

Hi, this is OT, I suppose, but I'm looking for help anyway ... :D

I've had great results using BasiliskII to emulate a 68K Mac running Mac OS 7.5.3 on my PS3, but haven't had much success emulating a PPC Mac using SheepShaver. I posted about my results so far over on the emaculation site here and here. So far I'm just getting a "deer in headlights look" over there. ;)

In summary, it runs up to the "Welcome to Macintosh." screen and then crashes. I realize that the Cell's PPC core is different than say, a G4 PPC, but I don't know in what ways, exactly, or how that would affect it's ability to run SheepShaver.

I would appreciate some insight / suggestions / etc.

Thanks
Back to top
View user's profile Send private message
warrennn



Joined: 24 Oct 2007
Posts: 12
Location: Seattle

PostPosted: Sat Jan 19, 2008 1:54 pm    Post subject: Reply with quote

Hi Bill,

I am also very interested in PPC Mac OS (not necessarily OSX) emulation on the PS3. The first thing that came to mind was to run MOL (MacOnLinux). I have been in email communication with Joseph Jezak (the current author/proprietor of MOL) and he said that 64 bit kernels are not supported yet. He is working on it.

There was someone on the PureBasic list who claimed that MOL worked on the PS3 - this was received with some skepticism (By Joseph). Here is the link:

http://www.purebasic.fr/english/viewtopic.php?p=202700&sid=8fff4f48139b4d42566d1668dd44fa37

Good luck.

Warren N
Back to top
View user's profile Send private message
billb



Joined: 12 Dec 2007
Posts: 32

PostPosted: Sun Jan 20, 2008 3:54 am    Post subject: Reply with quote

warrennn wrote:
I am also very interested in PPC Mac OS (not necessarily OSX) emulation on the PS3. The first thing that came to mind was to run MOL (MacOnLinux). I have been in email communication with Joseph Jezak (the current author/proprietor of MOL) and he said that 64 bit kernels are not supported yet. He is working on it.


Ah ... I hadn't looked at that one -- thanks! It looks like Terrasoft used to run lists for it. And there are RPMs for YDL4.1 (ppc) over here.

Installs with no problems on YDL 5.0.1, but it looks like kernel modules need to be re-compiled. Reading more about it, now...
Back to top
View user's profile Send private message
Frek



Joined: 06 Dec 2007
Posts: 18

PostPosted: Wed Jan 23, 2008 12:27 pm    Post subject: Reply with quote

No MOL doesn't work on PS3, it's not trivial to port it either because the current kernel module don't support 64 bit processors (such as the 970 and the Cell).
I haven't been developing MOL since 2001 so I'm not really up to date when it comes to the linux interface, However I know that 2.6.x broke the way MOL hooked onto the memory management in linux, but it might or might not been fixed now.

I shouldn't be that hard to get sheepshaver up and running however, I might look into that someday when I'm bored.
Back to top
View user's profile Send private message
billb



Joined: 12 Dec 2007
Posts: 32

PostPosted: Wed Jan 23, 2008 1:37 pm    Post subject: Reply with quote

Frek wrote:
I shouldn't be that hard to get sheepshaver up and running however, I might look into that someday when I'm bored.


I hope you get bored soon! ;-)

It seems that I get close to having SheepShaver running on the PS3, but it hangs during startup -- see screenshot. There are so many different ROMs and OS versions it is hard to say whether I have that wrong or it's something else. I need to try the same set with the Windows version to see if it does anything different.

The install discs I have are not supported (OS 9.2 and OSX) so I've had to use what's available for download from Apple. A universal install of 7.5.3 should be working, from what I'm told, but I haven't gotten past the 'Starting Up..." screen with any combination I have tried so far.
Back to top
View user's profile Send private message
mc



Joined: 12 Jan 2005
Posts: 212
Location: Linköping

PostPosted: Wed Jan 23, 2008 9:14 pm    Post subject: Reply with quote

Frek wrote:
I haven't been developing MOL since 2001 so I'm not really up to date when it comes to the linux interface, However I know that 2.6.x broke the way MOL hooked onto the memory management in linux, but it might or might not been fixed now.

MOL runs fine on my MacMini under 2.6.22.14, so that part seems to be taken care of at least.
_________________
Flying at a high speed
Having the courage
Getting over crisis
I rescue the people
Back to top
View user's profile Send private message
Frek



Joined: 06 Dec 2007
Posts: 18

PostPosted: Thu Jan 24, 2008 6:50 am    Post subject: Reply with quote

billb wrote:
Frek wrote:
I shouldn't be that hard to get sheepshaver up and running however, I might look into that someday when I'm bored.


I hope you get bored soon! ;-)

It seems that I get close to having SheepShaver running on the PS3, but it hangs during startup -- see screenshot. There are so many different ROMs and OS versions it is hard to say whether I have that wrong or it's something else. I need to try the same set with the Windows version to see if it does anything different.

The install discs I have are not supported (OS 9.2 and OSX) so I've had to use what's available for download from Apple. A universal install of 7.5.3 should be working, from what I'm told, but I haven't gotten past the 'Starting Up..." screen with any combination I have tried so far.


I will look into it someday, but by judging from your screenshot it seems you got sheepshaver running already- I'm 99% certain it hangs when it tries to initialize appletalk, try disable any serial ports that may be exported by sheepshaver (in the configuration file) and see if that helps.
Back to top
View user's profile Send private message
billb



Joined: 12 Dec 2007
Posts: 32

PostPosted: Thu Jan 24, 2008 11:17 am    Post subject: Reply with quote

Frek wrote:
I will look into it someday, but by judging from your screenshot it seems you got sheepshaver running already- I'm 99% certain it hangs when it tries to initialize appletalk, try disable any serial ports that may be exported by sheepshaver (in the configuration file) and see if that helps.


Thank you for the suggestion. I tried disabling the serial ports (seriala & serialb) in the prefs file but it still hangs in the same place. I don't have the sheep_net driver installed -- BasiliskII warns about this at startup, but SheepShaver doesn't. I might try installing that... tried leaving ethernet interface blank also.

It would be nice if the Mac startup process were a bit more verbose so we'd know exactly what it's trying to do. Will keep messing with it ... :)
Back to top
View user's profile Send private message
Frek



Joined: 06 Dec 2007
Posts: 18

PostPosted: Thu Jan 24, 2008 12:08 pm    Post subject: Reply with quote

billb wrote:
Frek wrote:
I will look into it someday, but by judging from your screenshot it seems you got sheepshaver running already- I'm 99% certain it hangs when it tries to initialize appletalk, try disable any serial ports that may be exported by sheepshaver (in the configuration file) and see if that helps.


Thank you for the suggestion. I tried disabling the serial ports (seriala & serialb) in the prefs file but it still hangs in the same place. I don't have the sheep_net driver installed -- BasiliskII warns about this at startup, but SheepShaver doesn't. I might try installing that... tried leaving ethernet interface blank also.

It would be nice if the Mac startup process were a bit more verbose so we'd know exactly what it's trying to do. Will keep messing with it ... :)


Okay, I've done some initial work- I don't prioritise this however so I can't promise anything in the near time.
Although I haven't gotten as far as you have either- the entire sheepthreads.c is totally out of synch with the glibc that ubuntu uses, so I'll have to look into that next.
Also had to make sure DGA etc wasn't used or it would crash early on me, however for now I just removed sheepthreads.c from the Makefile- it compiles and links but crashes right when the emulation is started so I suppose I'll have to fix sheepthreads to make it work.

I were pretty much certain it was an appletalk problem that caused the stall (I had the exact same problem when I ported basillisk to another platform) - as a last resort, try hold down the shift key as soon as you started the emulator- it will make sure macos boots in a "safemode", with no extensions turned on- if that works go to the apple menu -> pick chooser and disable appletalk (I'm still convinced that's the problem :P)
But anyway we'll see I'll look into this over the next few weeks (perhaps earlier.)
Back to top
View user's profile Send private message
billb



Joined: 12 Dec 2007
Posts: 32

PostPosted: Thu Jan 24, 2008 5:12 pm    Post subject: Reply with quote

Frek wrote:
Although I haven't gotten as far as you have either- the entire sheepthreads.c is totally out of synch with the glibc that ubuntu uses, so I'll have to look into that next. Also had to make sure DGA etc wasn't used or it would crash early on me, however for now I just removed sheepthreads.c from the Makefile- it compiles and links but crashes right when the emulation is started so I suppose I'll have to fix sheepthreads to make it work.


I also had problems compiling sheepthreads.c and removed it from the Makefile to get around it. With "new world" roms I get an immediate black screen when trying to start the emulation. Only with older roms like PPC7600.ROM or PPC8500.ROM it will start at all.

I'm using the source from cvs as described here.

Quick summary of what I'm doing to build (might make it easier if someone else wants to try it):

Code:
(move to directory where you want source downloaded)

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
cvs -d :pserver:anoncvs@cvs.cebix.net:/home/cvs/cebix checkout SheepShaver
cd SheepShaver
make links
cd ../BasiliskII/src/Unix
./autogen.sh
make
cd ../../../SheepShaver/src/Unix
./autogen.sh
./configure --disable-vosf

(remove sheepthreads.c from the SYSSRCS line in the Makefile with your text editor)

make


Quote:
as a last resort, try hold down the shift key as soon as you started the emulator- it will make sure macos boots in a "safemode", with no extensions turned on- if that works go to the apple menu -> pick chooser and disable appletalk (I'm still convinced that's the problem :P)


If I start while holding the shift key I do get the message that it has extensions turned off, but unfortunately it still hangs in the same place.

I have no idea what sheepthreads.c is supposed to do, so I don't know how important it is that it doesn't get built. I also notice some warnings when SheepShaver is compiling:

Code:
../macos_util.cpp: In function ‘uint32 FindLibSymbol(char*, char*)’:
../macos_util.cpp:196: warning: large integer implicitly truncated to unsigned type
../macos_util.cpp:218: warning: large integer implicitly truncated to unsigned type
Back to top
View user's profile Send private message
Frek



Joined: 06 Dec 2007
Posts: 18

PostPosted: Fri Jan 25, 2008 5:39 am    Post subject: Reply with quote

yep bill I've done pretty much the samething, but I it just crashes on me as soon as it jumps off into rom jump_to_rom() (ppc_asm.S) (and unless i remove DGA X11/(and VOSF like you do)) it crash way earlier, I also noticed that the "processor-type transform" don't work for the CellBE so for now I simply assigned PVR as a 7400 cpu (G4, which Sheepshaver do by default on the G5:s; While the Cell isn't a G5 it's a derative so I assume they are atleast somewhat similar on UISA level)

This project turned out way more difficult that I expected it to be- to be honest I haven't been able to figure what causing the crash right now- it's difficult to trace it down too as gdb messup completely once you branch to the macrom. so instead I have to work the opposite way- try eliminate all other options and it's very time consuming and frustrating- and yes I've tried both New World Roms and Oldworld Roms and the behavior is the same, however I haven't installed a proper bootdisk for sheepshaver- but I don't think that should do any difference, the macrom should just flash a question mark incase it can't find a bootable disk.

I'll further into this later on.

And regarding your hung- I can't really explain it right now then, unless it's related to my difficulties to get the emulator going at all, just try assign the PVR to the PVR of the 7400 and recompile sheepshaver to see if it does any difference just to be sure, but really I don't think it will- judging from your screenshots the boot process got past all hardware initialization done by the ROM- infact it will all be done as soon as you see the "happy mac" before it says "Welcome to Macintosh", you get stuck somewhere when it starts loading extensions and controlpanels, but you're right it seems to get stuck on a emulator level if disabling the extensions don't help.

I'll have to read up some on the Cell BE to see if the cache linesize is 32 or 128 like on the G5 (the flush_icache_range function in basillisk assumes 32 at the moment, that could explain my crashes.... but then again I can't figure why it works for you :p)
Back to top
View user's profile Send private message
billb



Joined: 12 Dec 2007
Posts: 32

PostPosted: Fri Jan 25, 2008 9:35 am    Post subject: Reply with quote

Frek wrote:
just try assign the PVR to the PVR of the 7400 and recompile sheepshaver to see if it does any difference just to be sure, but really I don't think it will- judging from your screenshots the boot process got past all hardware initialization done by the ROM- infact it will all be done as soon as you see the "happy mac" before it says "Welcome to Macintosh", you get stuck somewhere when it starts loading extensions and controlpanels, but you're right it seems to get stuck on a emulator level if disabling the extensions don't help.


Maybe it is something to do with my disk image ... I have Mac OS 8.5 coming soon -- found it on eBay pretty cheap (about $21 with shipping, including an external USB CD-RW drive and some other stuff).

I tried setting the PVR (in main_unix.cpp, line 559) to a couple of different codes, and also the 0x000c0000 mentioned below the #if EMULATED_PPC part, but it didn't seem to make any difference.

I have installed the Windows version but it wasn't loading at all for some reason ... need to get that one working so I'll have something to compare results with.
Back to top
View user's profile Send private message
Frek



Joined: 06 Dec 2007
Posts: 18

PostPosted: Fri Jan 25, 2008 9:20 pm    Post subject: Reply with quote

billb wrote:
Frek wrote:
just try assign the PVR to the PVR of the 7400 and recompile sheepshaver to see if it does any difference just to be sure, but really I don't think it will- judging from your screenshots the boot process got past all hardware initialization done by the ROM- infact it will all be done as soon as you see the "happy mac" before it says "Welcome to Macintosh", you get stuck somewhere when it starts loading extensions and controlpanels, but you're right it seems to get stuck on a emulator level if disabling the extensions don't help.


Maybe it is something to do with my disk image ... I have Mac OS 8.5 coming soon -- found it on eBay pretty cheap (about $21 with shipping, including an external USB CD-RW drive and some other stuff).

I tried setting the PVR (in main_unix.cpp, line 559) to a couple of different codes, and also the 0x000c0000 mentioned below the #if EMULATED_PPC part, but it didn't seem to make any difference.

I have installed the Windows version but it wasn't loading at all for some reason ... need to get that one working so I'll have something to compare results with.

Possibly, I've fixed sheepthreads.c on my ps3- it didn't do any difference to my crashes- so I can atleast pull that out of question.
I can't see any other possibility than something has changed the way the signals are handled i ubuntu / gutsy.
I've even borrowed another ppc mac (a g4) that runs ubuntu- and it suffers from the same crashes so I have on the PS3 so it definately seems related to something in the ubuntu environment, I just ponder if all "uptodate" linux distributions has the same problems.
I really don't know what's wrong at the moment, and right now it seems like it's very tricky to figure out. I don't want to install ydl either (because it's pretty old under the hood so the new versions of the cell sdk don't install/work afaik.).
Back to top
View user's profile Send private message
dbarrade



Joined: 31 Mar 2004
Posts: 6

PostPosted: Wed Jan 30, 2008 11:51 am    Post subject: Reply with quote

I would like to help beta test SheepShaver on PS3, I have some experience troubleshooting boot issues on MacOS.

As a thought, you may want to match the ROM to the bootable install, there may be extensions which aren't disabled with shift that need to be in the system folder for certain "Mac's". Also if there is a known SheepSaver disk image that matches up to a specific ROM, I would definately start there to minimise your problems to this new build. Alternatively test a known working build of SheepSaver with your boot image and ROM. There are also some other simple images that may work, for example a PPC Mac 6100 could boot a basic floppy image of MacOS 6.0.7, and I think there may be a Norton Utilities disk which should work across many Mac models. I'll have a look round at home for some old stuff... I also have a OSX beta that worked, all be it slowly on my old PowerMac 6100, although it was useless as it was really NeXTStep running on BSD with a couple of MacOS gui apps running, but the interesting thing about it is the BluBox which ran under "Mac OSX" was a very good Mac OS emulator (built by Apple) that had support for at least 8.1 and cut and paste from BSD to MacOS etc

I'd be happy if my PS3 OtherOS was Mac OS 6.0.7 running native PPC apps, Office and Adobe apps should scream and RAM shouldn't be a huge concern... it would just feel like 1998 again... I can only dream...
_________________
Working on PSP Guitarismo...
Back to top
View user's profile Send private message Visit poster's website
billb



Joined: 12 Dec 2007
Posts: 32

PostPosted: Thu Jan 31, 2008 1:39 am    Post subject: Reply with quote

dbarrade wrote:
I would like to help beta test SheepShaver on PS3, I have some experience troubleshooting boot issues on MacOS.


Hi -- glad to see some interest in this ... so far we haven't been able to get past the point where it hangs during startup (as seen in the screenshot I posted earlier). At this point I still don't have SS running on another platform for comparison purposes. That would definitely be a good starting point ... :)
Back to top
View user's profile Send private message
billb



Joined: 12 Dec 2007
Posts: 32

PostPosted: Wed Feb 25, 2009 12:18 pm    Post subject: Success! Sort of ... Reply with quote

Finally got SheepShaver running on the PS3 under YDL 6.1. The problem remains with compiling sheepthreads.c which apparently is required when trying to run it on native PPC, but it does work using the built-in PPC emulator. As you can imagine, it's rather slow, but it works ...

I've posted my results so far over here:
http://pleasantfiction.ipower.com/bodega/viewtopic.php?p=1560#p1560

I probably would never have got it going if I hadn't seen this in the changelog of the SheepShaver spec file (rpmfusion version):

http://download1.rpmfusion.org/free/fedora/releases/10/Everything/ppc/os/repoview/SheepShaver.html
Quote:
- Use ppc cpu emulator even when running on ppc, as using the native cpu
requires a private implementation of pthreads from:
src/Unix/Linux/sheepthreads.c
which depends on glibc pthread internals which are no longer exposed by
glibc and quite possibly changed


Earlier in this topic I mentioned I had errors when it came to compiling sheepthreads.c ... if someone could patch it so it works with a more recent version of glibc (if that's even possible) then perhaps we could use it without PPC emulation on the PS3. This sort of thing is way beyond me, though.
Back to top
View user's profile Send private message
Frek



Joined: 06 Dec 2007
Posts: 18

PostPosted: Mon Mar 09, 2009 1:43 am    Post subject: Reply with quote

So ie. you successfully got the interpretive version of MOL running (ie. the one that's intended for x86) not the version that executes natively on the PPC, correct?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS3 Linux Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group