ravynsoft / ravynos

A BSD-based OS project that aims to provide source and binary compatibility with macOS® and a similar user experience.
https://www.ravynos.com
Other
5.68k stars 192 forks source link

Compatibility with PPC in general and MacOS PPC in particular? #392

Open barracuda156 opened 1 year ago

barracuda156 commented 1 year ago

From README is seems to follow that all archs supported by FreeBSD are supposed to be supported by ravynos; has it been tried out on PowerPC (Big-endian)?

Another question, there is the following note:

Eventual compatibility with x86-64/arm64 macOS binaries (Mach-O) and libraries

It would be awesome to have a compatibility with ppc/ppc64 macOS binaries too :)

mszoek commented 1 year ago

That's not entirely true. Currently the only supported arch is amd64 (x86_64) machines, and we are working on arm64 (i.e. Mac M1/M2, Pinebook Pro) support as well. Most of the code would build on ppc but not all - there are some tricky bits of assembly language that make critical things work in Mach and objc. Those don't exist yet for ppc.

TLDR: we can probably get there but not today.

barracuda156 commented 1 year ago

Please add a note that this is desirable to have supported, even if low-priority.

P. S. If things reach a stage where generic support is there but MacOS ppc assembler is a stopper, I would take a look if I can contribute to that or ask someone more experienced.

mszoek commented 1 year ago

Sure, let's leave this open to keep track of the idea. I'd be grateful if you wanted to try getting the ppc asm working. It's been a long time since I wrote any and it wasn't 64 bit. I also don't have any ppc hardware these days so that's a big obstacle as well.

barracuda156 commented 1 year ago

@mszoek By the way, while the following is not related to ravynos, but to FreeBSD on PowerPC, maybe you could offer some insight how this may be fixed? https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271826 Just in case. I tried to install 13.2, and though it succeeded after quite a number of failures, the OS is unusable for any practical purposes, freezing at every text command or menu. There is an opinion that support for multiprocessor systems is broken (I have some G4 machines, but they are natively too slow; we really need FreeBSD running on DC and Quad PowerMac for any development efforts to be meaningful).

mszoek commented 1 year ago

I'm not familiar enough with PPC multiprocessing to offer much. Typically a kernel will use spinlocks and disable interrupts during critical sections to support SMP. Maybe some of that got broken over the years for PPC?

DKnoto commented 1 year ago

@barracuda156 Last year I agonized quite intensively with FreeBSD 13.x and 14 on PPC64. On my G5 it didn't want to run well but on POWER9 (Talos II) it ran without much problems.

barracuda156 commented 1 year ago

@barracuda156 Last year I agonized quite intensively with FreeBSD 13.x and 14 on PPC64. On my G5 it didn't want to run well but on POWER9 (Talos II) it ran without much problems.

@DKnoto Thank you for a confirmation.

Need to somehow get attention of developers to fix this issue.

P. S. If you have an extra minute, could you drop a line there on FreeBSD Bugzilla, so that developers see the issue affects some real users and occurs consistently?

AssassinK786 commented 1 year ago

@barracuda156 you can have look for DingusPPC It is PPC emulator for mac We can try to use it

markusbkk commented 10 months ago

I actually still have a PowerMac G5 I bought in 2022 with the stated goal of running MorphOS on it one day (still lacking a decent AMD GPU for that, alas. Been a while but I think it's a PCIe slot model) and I thought about how awesome it would be to have ravynOS on it one day.

Even if we can overcome the tricky ASM bits though, the real question is: Will it even run Wayland? As in, will the average PowerMac user have a GPU new enough to support DRM/KMS?

mszoek commented 10 months ago

Even if we can overcome the tricky ASM bits though, the real question is: Will it even run Wayland? As in, will the average PowerMac user have a GPU new enough to support DRM/KMS?

Probably not. What chip is in that G5?

barracuda156 commented 10 months ago

Probably not. What chip is in that G5?

If you mean GPU, it will be OS-dependent. I cannot say which are the latest that Linux and OpenBSD can support, but there were video reports on YouTube with someone installing newer GPUs into PowerMacs. On macOS the best ones to have been supported were Quadro FX 4500 and ATI 1900 XT.

DKnoto commented 10 months ago

@markusbkk @barracuda156 I've been testing FreeBSD 15 CURRENT in a Qemu VM on Fedora 39 on Talos II for several weeks. QEMU emulator version 8.1.3 (qemu-8.1.3-1.fc39) Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers In graphic mode without DRM it works quite tolerably even a large resolution of 2880x1248. I am now working on a tutorial on how to install FreeBSD ppc64le well in a virtual machine and how to change UFS to ZFS for ROOTFS.

As for GPU-free DRM running on virtio-gpu-pci, there has been a corresponding patch in the FreeBSD/DRM project for more than a year but for licensing reasons it has not yet been enabled. The author doesn't seem to have the time to rewrite it properly.

On another note, if RavynOS is to be a reflection of macOS then Wayland is completely unnecessary to it, pure DRM is enough.

barracuda156 commented 10 months ago

@DKnoto Could you say if FreeBSD is still broken on G5 multicore? (I expect it is, will try to ping upstream to do something about that.)

P. S. On a side note, Power9 is Bi-endian (as all Power cpus), you could just use ppc64 without suffering with LE.

DKnoto commented 10 months ago

@barracuda156

I have not yet tried FreeBSD 15 CURRENT on my G5. I will try to check it out.

PS. LE it's a necessity for me at the moment ;-)

markusbkk commented 10 months ago

Probably not. What chip is in that G5?

NVIDIA 6600.

Stock ones are NVIDIA FX 5200, AFAIK.

I think the highest end cards people (mainly MorphOS users) use with those PowerMac G5s are ATI Radeon X800 and maybe ATI Radeon X1950 Pro. The Radeon 9800 is still popular with those machines, too.

markusbkk commented 10 months ago

On another note, if RavynOS is to be a reflection of macOS then Wayland is completely unnecessary to it, pure DRM is enough.

Wayland is simply an abstraction and ravynOS' WindowServer already seems to hook into Mach IPC somewhat. Getting rid of Wayland wouldn't gain anything. It would just make things more complicated and less compatible with existing software like Foot (the basis of ravynOS' terminal).

barracuda156 commented 10 months ago

Probably not. What chip is in that G5?

NVIDIA 6600.

This was the stock one for PowerMac 2.3 DC and 2.5 Quad.

Stock ones are NVIDIA FX 5200, AFAIK.

Maybe for the earlier generation.

I think the highest end cards people (mainly MorphOS users) use with those PowerMac G5s are ATI Radeon X800 and maybe ATI Radeon X1950 Pro. The Radeon 9800 is still popular with those machines, too.

X800 and 9800, AFAIK, are for older PowerMacs and not even compatible with late 2005 models. There is no point in flashing PCI-E versions even if they exist, since better cards are available.

Assuming you refer to the last generation of PowerMacs, the best GPUs supported by macOS are Quadro FX 4500, 7800 GT and ATI X1950 XT. There is some controversy on which of these three is superior.

DKnoto commented 10 months ago

Wayland is simply an abstraction and ravynOS' WindowServer already seems to hook into Mach IPC somewhat. Getting rid of Wayland wouldn't gain anything. It would just make things more complicated and less compatible with existing software like Foot (the basis of ravynOS' terminal).

Possibly, but Wayland is the first thing I remove from Fedora Linux after instalation, for example ;-)

markusbkk commented 10 months ago

X800 and 9800, AFAIK, are for older PowerMacs and not even compatible with late 2005 models. There is no point in flashing PCI-E versions even if they exist, since better cards are available.

There is a point if you wanna run MorphOS with full Warp3D support, which I'd argue is the largest niche amongst the niche that are PowerMac users in the year 2024.

Assuming you refer to the last generation of PowerMacs, the best GPUs supported by macOS are Quadro FX 4500, 7800 GT and ATI X1950 XT. There is some controversy on which of these three is superior.

Depends on what you wanna do, really. But for modern Amiga computing as well as Wayland, the ATI is the only sane option in that list.

The more I think about it, the more I wanna work on this. It would actually be nice to undust my PowerMac G5 Quad (and getting it to run there could be a nice stepping stone towards making it run on a Power9 workstation. For all the five people out there who can drop this much money on a desktop).

I don't suppose anybody would like to bribe me with an ATI Radeon X1950 XT? 😛

markusbkk commented 10 months ago

Wayland is simply an abstraction and ravynOS' WindowServer already seems to hook into Mach IPC somewhat. Getting rid of Wayland wouldn't gain anything. It would just make things more complicated and less compatible with existing software like Foot (the basis of ravynOS' terminal).

Possibly, but Wayland is the first thing I remove from Fedora Linux after instalation, for example ;-)

WDYM by "remove"? As in the Gnome Wayland session? Wayland is a protocol not a server (unlike Xorg).

mszoek commented 10 months ago

On another note, if RavynOS is to be a reflection of macOS then Wayland is completely unnecessary to it, pure DRM is enough.

Wayland is simply an abstraction and ravynOS' WindowServer already seems to hook into Mach IPC somewhat. Getting rid of Wayland wouldn't gain anything. It would just make things more complicated and less compatible with existing software like Foot (the basis of ravynOS' terminal).

Both are true.. WindowServer doesn't actually need Wayland and it gets in the way to some extent. I used an existing minimal compositor to get things running quickly and for some *nix compatibility, but we may convert all that lower level stuff to pure DRM and drop Wayland at some point. It (and X) could be reimplemented on top of WindowServer later.

Foot is also just a way to quickly get a terminal going. Eventually I would like to get iTerm2 or something like that working instead. Foot is a great terminal but it's a Wayland app - there's no integration at all with the Mac desktop.

markusbkk commented 10 months ago

On another note, if RavynOS is to be a reflection of macOS then Wayland is completely unnecessary to it, pure DRM is enough.

Wayland is simply an abstraction and ravynOS' WindowServer already seems to hook into Mach IPC somewhat. Getting rid of Wayland wouldn't gain anything. It would just make things more complicated and less compatible with existing software like Foot (the basis of ravynOS' terminal).

Both are true.. WindowServer doesn't actually need Wayland and it gets in the way to some extent. I used an existing minimal compositor to get things running quickly and for some *nix compatibility, but we may convert all that lower level stuff to pure DRM and drop Wayland at some point. It (and X) could be reimplemented on top of WindowServer later.

Foot is also just a way to quickly get a terminal going. Eventually I would like to get iTerm2 or something like that working instead. Foot is a great terminal but it's a Wayland app - there's no integration at all with the Mac desktop.

Fair enough. Any plans for a Wayland-independent WindowServer protocol then? Will you go the Serenity route and implement a custom code generator or choose something like Protobuf? The other day I saw an implementation of Protobuf over UDS that could probably serve as a "tutorial" on how to use Protobuf with custom transports.

EDIT: Oh wait. I forgot that there's MIG. That'll probably work to generate and compile the IDL.

Randrianasulu commented 2 weeks ago

comments under that video says that r600 driver work(ed?) on Linux on ppc bigendian machines.

https://m.youtube.com/watch?v=t8mNV_VvkMk (video itself showing nouveau issues) 6850 or 6570 amd radeon ...

Randrianasulu commented 2 weeks ago

https://lists.nongnu.org/archive/html/discuss-gnustep/2018-12/msg00021.html

hopefully names those ppc asm functions still missing from objc (may be in last 6 years they were added?)