Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Status
The first post of this thread is a WikiPost and can be edited by anyone with the appropiate permissions. Your edits will be public.

internetzel

macrumors 6502a
Apr 29, 2015
612
784
Am I correct when i say that the G5 will run G4 binaries but without altivec instructions? I believe I read that in the Apple documentation somewhere some time ago.
The Altivec instructions are fully supported by the G5, but the implementation differs. So for full performance the G4 and G5 would need slightly differently optimized code.

About the missing instructions, you can find the details here: https://github.com/epipping/xnu-kernel-sources-ppc/blob/macOS-10.5.x/osfmk/ppc/Emulate64.s
 

internetzel

macrumors 6502a
Apr 29, 2015
612
784
The 10A222 kernel (10.0.0d3) does support G5 since it did load and loaded kexts. I'm almost sure kernel is not the problem since it already started launchd but I can't help much without having a G5 machine.
The 10.6 kernel I had hacked to boot on my PowerBook G4 was some release version - and that one did miss something needed for the G5.
What I remember is that the ppc64 architecture in xnu is quite special, and "incompatible" with the x86_64 architecture, since the same ppc(32) kernel can run both ppc(32) and ppc64 binaries. I think it was that special design which has been removed for 10.6 in order to better support a real x86_64 kernel.
 

educovas

macrumors regular
Jul 30, 2019
128
413
Curitiba, Brasil
I’ve tried several times now to restore @educovas modified 10A222 disk image to one of my PowerBooks to no avail. Disk utility throws an error and corrupts the drive, and trying to restore using CCC succeeds but isn’t bootable. What method was used to create the .dmg and has it been tested? May be an issue with the .dmg and not a G4 vs G5 problem after all
I've created the image using Disk Utility and I've tested it many times to restore my 10A222 install after some tests. @barracuda156 also got it booting on a PowerBook G4 so I don't think it's the DMG. Maybe your download got corrupted or something?
 
  • Like
Reactions: ChrisCharman

ChrisCharman

macrumors 6502
May 10, 2020
433
608
Bournemouth, UK
I've created the image using Disk Utility and I've tested it many times to restore my 10A222 install after some tests. @barracuda156 also got it booting on a PowerBook G4 so I don't think it's the DMG. Maybe your download got corrupted or something?
I literally just said to my partner that it may be a corrupted download. Will try again. Thanks @educovas
IMG_1004.jpeg
 
Last edited:

barracuda156

macrumors 68000
Sep 3, 2021
1,785
1,306
I've created the image using Disk Utility and I've tested it many times to restore my 10A222 install after some tests. @barracuda156 also got it booting on a PowerBook G4 so I don't think it's the DMG. Maybe your download got corrupted or something?

I did experience a bit weird behavior with this DMG, but no idea if it is reproducible. I assumed it is an issue on my side, and rather random and unrelated.
On 10a190 initially I could not clone the DMG, getting an error at erasure stage.
Rebooted into 10.5.8, there it went normally but the OS did not see the disk as bootable. I ejected it and mounted again, then it got recognized.
Then I cloned it from 10a190 with no apparent issues upon rebooting.
Whatever it was, the same clone which boots on G4 fails to boot on G5.
 

barracuda156

macrumors 68000
Sep 3, 2021
1,785
1,306
The 10.6 kernel I had hacked to boot on my PowerBook G4 was some release version - and that one did miss something needed for the G5.
What I remember is that the ppc64 architecture in xnu is quite special, and "incompatible" with the x86_64 architecture, since the same ppc(32) kernel can run both ppc(32) and ppc64 binaries. I think it was that special design which has been removed for 10.6 in order to better support a real x86_64 kernel.

AFAIK, ppc64 was never supported in the kernel, it is always 32-bit, whether on G5 or not. (The mentions of ppc64 may be there, we can easily diff the xnu code in fact.)

10a190 works on G5 reliably, aside of broken support for PCIe SSD cards. That sends OS into KP on boot. Solution is either to nuke two kexts or to make PCIe device invisible via OF.
 

barracuda156

macrumors 68000
Sep 3, 2021
1,785
1,306
I've created the image using Disk Utility and I've tested it many times to restore my 10A222 install after some tests. @barracuda156 also got it booting on a PowerBook G4 so I don't think it's the DMG. Maybe your download got corrupted or something?

BTW could you upload it either to an FTP or, if that is not possible easily, then to Mega but gzipped?
I wanna avoid having to download it on a non-ppc machine, or at least extract an archive on ppc.
 

barracuda156

macrumors 68000
Sep 3, 2021
1,785
1,306
Strictly, the G5 does not fully support 32 bit PowerPC code (e.g. ppc7400) - a few instructions or variations of them are missing and the xnu kernel used to emulate those, IIRC. (After all the G5 is a POWER4 cpu and not a PowerPC one.)

Well, could you point to IBM documentation stating that? If it was indeed the case, then every BSD and Linux would need to emulate those instructions. I doubt it is the case.

UPD. Just noticed you reply above pointing at GH repo. Will look into that.
 
Last edited:

barracuda156

macrumors 68000
Sep 3, 2021
1,785
1,306
I feel like you have macports running pretty well on 10A190 now so there may not be any benefits to starting again on 10A222 for you, particularly if G5 compatibility remains an issue.

Further, one reason you might want to use 10A222, should we manage to get it running on G5s is that this seed laid the foundation for the libdispatch api - which if you’re seriously considering replacing may offer better results than 10A190.

I am not planning to rebuild 17000 ports I have at the moment from scratch, of course, and pretty much everything should remain compatible, but it makes sense to move to 10A222, as long as it works, since the closer we are to 10.6.x release, the fewer compatibility problems are there.
 

internetzel

macrumors 6502a
Apr 29, 2015
612
784
AFAIK, ppc64 was never supported in the kernel, it is always 32-bit, whether on G5 or not. (The mentions of ppc64 may be there, we can easily diff the xnu code in fact.)
ppc64 is/was supported by the xnu kernel (at least the one from 10.5) - but no ppc64 kernel was needed for this because the ppc(32) kernel supported ppc64 binaries.

Very different from the x86_64 support which needs a different kernel as well. This is because x86_64 greatly differs from x86, while ppc64 is (almost fully) the same as ppc32, just with 64 bit long addresses.

Do you know whether the 10a190 kernel can actually execute ppc64 binaries?
 

ChrisCharman

macrumors 6502
May 10, 2020
433
608
Bournemouth, UK
I am not planning to rebuild 17000 ports I have at the moment from scratch, of course, and pretty much everything should remain compatible, but it makes sense to move to 10A222, as long as it works, since the closer we are to 10.6.x release, the fewer compatibility problems are there.
Possibly. Lots of API changes until the final release so 10A222 may be different but not necessarily any closer the GM. I will be redownloading after i finish work later and attempting to install again. I would very much like to tinker with and investigate this new build.
 
  • Like
Reactions: barracuda156

barracuda156

macrumors 68000
Sep 3, 2021
1,785
1,306
ppc64 is/was supported by the xnu kernel (at least the one from 10.5) - but no ppc64 kernel was needed for this because the ppc(32) kernel supported ppc64 binaries.

Very different from the x86_64 support which needs a different kernel as well. This is because x86_64 greatly differs from x86, while ppc64 is (almost fully) the same as ppc32, just with 64 bit long addresses.

Do you know whether the 10a190 kernel can actually execute ppc64 binaries?

1. The kernel itself never ran as 64-bit, including 10.5.8 on G5. AFAIK.

2. Again, AFAIK, ppc64 ABI is substantially different from ppc ABI (and I mean Darwin, of course). No, it is not just longer addresses. For example, you will not get a properly functioning binaries from assembler files simply replacing lwz with ld and alike and multiplying offsets. It may works sometimes, it will not work some other times. ABI is not the same.
(And obviously ppc64 has instructions which do not exist on ppc, and while the kernel may not use those, userland apps do.)

3. Kernel is irrelevant, but no existing 10.6 versions will run ppc64 binaries, since system libraries do not have ppc64 slices (libSystem, for example).
 
Possibly. Lots of API changes until the final release so 10A222 may be different but not necessarily any closer the GM. I will be redownloading after i finish work later and attempting to install again. I would very much like to tinker with and investigate this new build.

I think this was at the root of my request to educovas to provide us with a log of everything they swapped in/from in the making of this bootable build of 10A222.

This is not only for the community to check the work, but also to afford others, like you both, to reproduce exactly what they did to create the installed image they made available, and to identify why the image seems to work optimally on their 1.5GHz G4 setup (but runs into trouble on, say, a G5 or some other G4 configuration).

While I appreciate how that would be a lot of work for them to go back and to aggregate, so too has all the work going into this project by everyone invested to make these builds run smoothly across our varying G4 and G5 setups.

This is still a marathon: this still requires us to be slow and steady as we go. And atop it being a marathon, the knowledge sharing being open and transparent is vital for keeping our forward pace.
 

educovas

macrumors regular
Jul 30, 2019
128
413
Curitiba, Brasil
I think this was at the root of my request to educovas to provide us with a log of everything they swapped in/from in the making of this bootable build of 10A222.

This is not only for the community to check the work, but also to afford others, like you both, to reproduce exactly what they did to create the installed image they made available, and to identify why the image seems to work optimally on their 1.5GHz G4 setup (but runs into trouble on, say, a G5 or some other G4 configuration).

While I appreciate how that would be a lot of work for them to go back and to aggregate, so too has all the work going into this project by everyone invested to make these builds run smoothly across our varying G4 and G5 setups.

This is still a marathon: this still requires us to be slow and steady as we go. And atop it being a marathon, the knowledge sharing being open and transparent is vital for keeping our forward pace.
All files that I've replaced are in the post #2,273 so anyone could get that zipped folder and create their own installation. I've installed the OS on an Intel Mac, imaged the installation, then restored to the PPC Mac.
 
All files that I've replaced are in the post #2,273 so anyone could get that zipped folder and create their own installation. I've installed the OS on an Intel Mac, imaged the installation, then restored to the PPC Mac.

I appreciate the quick reply.

What you provided with that post was a general overview of the areas you replaced in your imaged build. This was not an individual-level breakdown I asked to be provided then, nor asked in what I posted to this discussion about an hour or so ago.

The way the wikipost’s Table 4 delivers on the mandate of individual-level breakdown is what I was — and am — requesting. We need that to repeat the conditions to make possible your uploaded image of build 10A222.

Although it may not seem obvious, I came to learn, through two years of testing this project, how this granular-level approach helps to spot conditions wherein a single component, library, or kext from one area of functionality — say, wifi; model-specific hardware sensors; and so on — might pose as a solitary barrier to prevent another areas of the system/hardware from functioning properly. Scalpel, not scissors.

That we are seeing problems with the 10A222 image you uploaded not booting properly, successfully, and/or completely, on systems which should be able to do so, points to some individual-level components which may require an item-by-item swap.

We get to figuring out what those choke points are once we all have access to the same, granular-level changes you made to make your build run properly on in your A1106 1.5GHz PowerBook. Yes, this is slow and exhaustive. It may feel tedious. It’s also how thorough, repeatable QA testing slogs ahead.

Cheers.
 

educovas

macrumors regular
Jul 30, 2019
128
413
Curitiba, Brasil
It's impossible for me to write about every single file I've replaced since there are thousands and I don't even remember exactly why and from which build I got them. I'm not going to waste days doing everything again just for that. All files are there in case someone wants to look at them one by one.
 
It's impossible for me to write about every single file I've replaced since there are thousands and I don't even remember exactly why and from which build I got them. I'm not going to waste days doing everything again just for that. All files are there in case someone wants to look at them one by one.

Lesson learnt. Going forward, this is new praxis worth considering.

It will help you to be able to go back and spot things you unknowingly missed the first time, and it will also help the community to be able to corroborate your findings thoroughly and effectively.

It’s also a reminder how using a scissors or machete (i.e., moving hundreds or thousands of items/components at once), and not a scalpel (piece by piece, or family by family), can yield situations like the one we’re in right now.

Again, we learn. We move forward with those lessons to improve on our work. (and if I haven’t been clear, you’ve been doing good work.)
 

internetzel

macrumors 6502a
Apr 29, 2015
612
784
1. The kernel itself never ran as 64-bit, including 10.5.8 on G5. AFAIK.
Of course - and that's the clou I was aiming at. A ppc64 compiled kernel would not run faster on a G5 than a ppc kernel. To the contrary the ppc64 binary code would be larger (because of the longer memory addresses), needing more precious CPU cache space, potentially executing slower than ppc32 code.
So Apple made a 32 bit ppc kernel which also supports the ppc64 ABI - completely different approach than for their Intel kernel.

Hence I wondered whether they might have removed ppc64 support from the 10.6 ppc kernel.
 
  • Like
Reactions: ChrisCharman

ChrisCharman

macrumors 6502
May 10, 2020
433
608
Bournemouth, UK
So i’ve now re-downloaded @educovas customised 10A222 .dmg and can clearly see that the file size is marginally different, so my first attempt may well have been a failure due to a corruption that occurred via Mega download service. I was unable to verify checksum on either of the disk images within disk utility on 10.5.8 but when looking at the details in the Finder ‘Get Info’ pane, the file size difference is clear.

I experienced the same issue trying to block level restore the .dmg using disk utility however on the newly downloaded disk image, with it reporting failure at the last instance. Much as @barracuda156 experienced.

I am at this moment in time completing a block level clone of the disk image using Carbon Copy Cloner 3.0.1. I will report back once i’m able to verify if it is successful or not.

I have also downloaded the zipped folder with all of the files that were used to create this hybrid build and will dig into those and investigate as time permits.
 

Attachments

  • Screenshot 2024-05-03 at 23.00.24.png
    Screenshot 2024-05-03 at 23.00.24.png
    150.1 KB · Views: 16
Last edited:

MacPro2006VBox

macrumors 6502
Oct 9, 2014
339
231
1. The kernel itself never ran as 64-bit, including 10.5.8 on G5. AFAIK.

2. Again, AFAIK, ppc64 ABI is substantially different from ppc ABI (and I mean Darwin, of course). No, it is not just longer addresses. For example, you will not get a properly functioning binaries from assembler files simply replacing lwz with ld and alike and multiplying offsets. It may works sometimes, it will not work some other times. ABI is not the same.
(And obviously ppc64 has instructions which do not exist on ppc, and while the kernel may not use those, userland apps do.)

3. Kernel is irrelevant, but no existing 10.6 versions will run ppc64 binaries, since system libraries do not have ppc64 slices (libSystem, for example).

Then why the hell does it refuse to boot on my PowerMac G5?
 

barracuda156

macrumors 68000
Sep 3, 2021
1,785
1,306
It's impossible for me to write about every single file I've replaced since there are thousands and I don't even remember exactly why and from which build I got them. I'm not going to waste days doing everything again just for that. All files are there in case someone wants to look at them one by one.

I have done some fix-ups this ad hoc way myself at times, so I perfectly understand (ask me now what should be replaced to make Wifi working or which components are to be picked from Xcode 10a190 if Xcode 10a222 is used, and I have no idea, and only partial record for the latter), but making builds reproducible makes life easier eventually, and not only for others.
 
  • Like
Reactions: ChrisCharman
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.