Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

z970

macrumors 68040
Original poster
Jun 2, 2017
3,580
4,502
One of my beta testers recently asked me if there was a way to incorporate the Classic environment into Sorbet Leopard. Given that most information on this subject available online is vague and unhelpful, I did some hands-on experimentation (being very familiar with the underpinnings of older OS X, I found this to be relatively straightforward), and I found some things that will hopefully provide clarity to those who have always had the same question. My reply is as follows:

-

First, I'm pleased to report that the Classic preference pane seems to be fully functional in 10.5.8, as does the Classic Startup application from Tiger's CoreServices directory. When an OS 9 System Folder is installed and visible to the Classic preference pane, it will detect and target it for booting, and will even allow you to rebuild the desktop.

However, when the environment is set and ready to go, and it's started, System Preferences will hang and then crash. Digging into the system log during this event shows that Classic Startup (the application called by System Preferences to bootstrap a VM of OS 9) wants a specific version of the ApplicationServices framework in order to run. More specifically, it's looking for several special symbols in the ApplicationServices binary that it can't find, because the one that shipped with Leopard doesn't contain them.

So the natural reaction would be to just swap in the ApplicationServices framework from Tiger and call it a day, right? Unfortunately, this wouldn't be the case. Unsurprisingly, every application that runs on Leopard depends on that version of ApplicationServices in order to even launch, including System Preferences, as well as the Classic Startup application itself (as long as it's being opened from the Leopard environment), and this repeats in more or less the same behavior even if the ApplicationServices binary hidden within the framework bundle was the only thing replaced.

So in summary, Classic being unable to run on Leopard is not a kernel problem at all, but an incompatible framework problem. In order to get Classic running on Leopard, you would need to somehow preserve ApplicationServices' ability to launch applications, while at the same time containing those symbols required to start Classic. That said, given that both ApplicationServices binaries are closed-source, and that said missing symbols are not pieces of text you can just move around the binaries, this would probably depend on getting the open-source versions of both binaries, and then recompiling one to include the symbols as per required by Classic Startup.

I hope that was helpful.
 
Last edited:

Tratkazir_the_1st

macrumors 6502a
Feb 11, 2020
966
512
Russia, Moscow region
@z970mp
Thanks for explanation. As Linux user, want to know. May be there is some kind of possibility to create separate environment for ClassicStartup with all required resources? Like chroot or something else or whatever... Just the first idea I've got :).
 

vddrnnr

macrumors 6502
Jan 23, 2017
493
750
Hi @z970mp,

Can you like it's done in leopard webkit relink the binary with the framework copied to
the frameworks folder using another name like ApplicationServicesClassic?

Best regards,
voidRunner
 

z970

macrumors 68040
Original poster
Jun 2, 2017
3,580
4,502
@Tratkazir_the_1st In OS X, not to my knowledge.

@Amethyst1 No idea. I do wonder if ApplicationServices.framework from 10.5.0 might exhibit any different behavior? Or indeed perhaps the version from a beta? Maybe Apple only removed the required symbols further along in development and didn't tell anyone. - At this point, that would probably be the most doable course of action.

@vddrnnr Possibly, but Classic Startup is programmed to only look for 'ApplicationServices.framework'. Anything else it will ignore. And because everything is closed-source, as I understand it, there is no way to change that unfortunately.
 

Amethyst1

macrumors G3
Oct 28, 2015
9,382
11,530
@Amethyst1 No idea. I do wonder if ApplicationServices.framework from 10.5.0 might exhibit any different behavior? Or indeed perhaps the version from a beta? Maybe Apple only removed the required symbols further along in development and didn't tell anyone. - At this point, that would probably be the most doable course of action.
Sounds like a fun project for a rainy weekend - exploring all those Leopard betas. It's a shame they're so big.

@vddrnnr Possibly, but Classic Startup is programmed to only look for 'ApplicationServices.framework'. Anything else it will ignore. And because everything is closed-source, as I understand it, there is no way to change that unfortunately.
What about hex-editing that name in the Classic Startup binary to, say, ApplicationClassic1.framework (same length) and copying the new framework under that name to not interfere with ApplicationServices.framework? I might be talking utter nonsense, this is just an idea.
 

z970

macrumors 68040
Original poster
Jun 2, 2017
3,580
4,502
@Amethyst1 That might work. I don't know how to hex-edit things though, so I wouldn't know for certain. Otherwise, I'd be making custom OF-compatible GPU BIOSes!
 

Doq

macrumors 6502
Dec 8, 2019
469
714
The Lab DX
I went and did this.

As it turns out, the references to ApplicationServices.framework exist in both Classic Startup and Classic.prefpane. After hex editing the executables in the two items to reference ApplicationClassics.framework and rebooting for good measure..... Classic Startup died with a segfault and Classic.prefpane still looks for ApplicationServices.framework.

I wonder if the symbols are being called not from the prefpane, but from System Preferences itself. If that is the case, far more work would need to be done than just changing the references in the prefpane and Classic Startup.
 
  • Like
Reactions: Amethyst1

Nermal

Moderator
Staff member
Dec 7, 2002
20,691
4,138
New Zealand
Why not just copy the frameworks from Tiger to Leopard ? Has anyone tried that ?
So the natural reaction would be to just swap in the ApplicationServices framework from Tiger and call it a day, right? Unfortunately, this wouldn't be the case. Unsurprisingly, every application that runs on Leopard depends on that version of ApplicationServices in order to even launch, including System Preferences, as well as the Classic Startup application itself (as long as it's being opened from the Leopard environment), and this repeats in more or less the same behavior even if the ApplicationServices binary hidden within the framework bundle was the only thing replaced.
 

Doq

macrumors 6502
Dec 8, 2019
469
714
The Lab DX
Picture-1.png


Not even half an hour later: a breakthrough!
 

z970

macrumors 68040
Original poster
Jun 2, 2017
3,580
4,502
@Doq Yeah, I encountered that during testing. TruBlueEnvironment is an application embedded into the Classic Startup app bundle, in Contents/Resources/.

Here's two of the missing symbols in particular, from Leopard's ApplicationServices.framework:

Exited abnormally: Segmentation fault

dyld: lazy symbol binding failed: Symbol not found: _CPSStartClassicServices
Referenced from: /System/Library/PreferencePanes/Classic.prefPane/Contents/MacOS/Classic
Expected in: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices

dyld: Symbol not found: _CGAccessSessionSkipForward
Referenced from: /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
Expected in: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices

Maybe they're the only ones? If so, I wonder if Leopard's ApplicationServices binary can be hex-edited to include them artificially?
 
Last edited:

Melchieor

macrumors member
Jan 24, 2021
77
98
I was actually the one that posted the question to @z970 and am glad to see it getting some traction! In my own opinion, if Leopard had classic support, I wouldnt need Tiger at all now with the new Sorbet Leopard.
 
  • Like
Reactions: z970

RetroDan

macrumors regular
Dec 17, 2015
112
149
Michigan
I was actually the one that posted the question to @z970 and am glad to see it getting some traction! In my own opinion, if Leopard had classic support, I wouldnt need Tiger at all now with the new Sorbet Leopard.
I like Tiger a lot, but it would be very interesting to see what Leopard can do with Classic apps. I'm wondering furthermore that, if we can ultimately trick Leopard into running Classic, why couldn't we roll up a way to dual-boot OS9? I'm aware that firmware limitations currently prevent this sort of thing, and obviously driver support for G5-era hardware on OS9 would be a problem to be overcome, but I've seen stranger things come to fruition. The Apple Nerds are crazy hardcore when it comes to challenges like that.
 

Amethyst1

macrumors G3
Oct 28, 2015
9,382
11,530
I'm aware that firmware limitations currently prevent this sort of thing,
OS 9 has already found its way to several “OS X-only” G4 Macs, the most notable perhaps being the Mac mini, released years after OS 9 was officially “buried”.
 

Doq

macrumors 6502
Dec 8, 2019
469
714
The Lab DX
From what I know, theoretically all G4 Macs capable of booting Jaguar (officially or otherwise) can be made to boot OS 9 with the modified ROM. It's a matter of making the driver and extension support happen.

It's far, far outside my own scope, but there are a few intrepid tinkerers out there making it happen.
 

RetroDan

macrumors regular
Dec 17, 2015
112
149
Michigan
OS 9 has already found its way to several “OS X-only” G4 Macs, the most notable perhaps being the Mac mini, released years after OS 9 was officially “buried”.
Yes, but that was due to them being able to inject a new firmware ROM image into the installer - I'm running OS9 on a DP 1.42GHz MDD natively thanks to MacOS9Lives, but I imagine G5s are a bit of a different beast.
 

weckart

macrumors 603
Nov 7, 2004
5,839
3,516
Maybe get a hold of this Jonathan Walters chappy. He claims to have got Classic running on a G5 under Leopard already, although what "work" actually means in this context isn't exactly clear. This came from the Action Retro account on Youtube.
Screenshot 2021-12-22 at 23.08.57.png
 

originaldotexe

macrumors 6502
Jun 12, 2020
252
423
Kentucky
can we maybe reverse the applicationservices binary and patch in the needed symbol, while keeping all of the leopard version's code? similar stuff has been done with old windows kernels/libraries in the past so i was thinking maybe its possible with osx too
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.