Wack0 / maciNTosh

PowerPC Windows NT ported to Power Macintosh systems
GNU General Public License v2.0
546 stars 19 forks source link

Uni-North port #32

Open Wack0 opened 3 months ago

Wack0 commented 3 months ago
leandrofriedrich commented 3 months ago

👀 once uninorth is somewhat ready on g3, how much work is needed for g4 support? how different are they going to be?

Wack0 commented 3 months ago

people already have nt working on yikes systems and G4-upgraded yosemite systems

Wack0 commented 3 months ago

slight usb driver progress in arc firmware:

first two usb control messages are being transferred correctly, the third one causes the ohci controller to clobber the endpoint descriptor memory. i had this problem on lombard where it was related to memory alignment. not sure what the issue here is.

Wack0 commented 3 months ago

I added preliminary support (ARC firmware driver + grab base address from open firmware device tree in loader) for the kawai(etc) ATA/100 controller, but i have no way to test due to having no systems with it.

I'll need to add support to atapimio.sys for these controllers (they're basically same as mac i/o IDE, just on their own PCI device with their own DBDMA register space too), but after that, assuming everything works, it would be enough for a preliminary release that should support all uninorth laptops.

JannGold commented 3 months ago

Will this work on Sawtooth G4 models once it is ported? I think those are Uni-North.

jlj945 commented 3 months ago

Will this work on Sawtooth G4 models once it is ported? I think those are Uni-North.

It should work on just about every uni-north machine. The problem with desktops is USB would need to be solved since none of them use ADB.

Wack0 commented 1 month ago

Update: got the ARC firmware working on the PowerBook5,2 I acquired recently. 20241015_185604

There's still some issues there, seems NT is currently freezing quite early in boot, seems to be a HAL issue with this updated chipset.

Wack0 commented 1 month ago

2024-10-20 20-01-38 1 2024-10-20 20-36-00 1

Initial release for Uni-North laptops is now available.

The systems I'm most unsure about compatibility with are PowerBook G3 Pismo (may crash loading the ARC firmware, although I tried to ensure correct behaviour there) and DLSD PowerBook G4 (ATA-6 controller might be incompatible). Also anything using nvidia as that code is untested.

I'm told PowerBook5,6 and newer uses USB keyboard and mouse, so consider those unsupported by this initial release.

JannGold commented 1 month ago

@Wack0 I got it to work on my 500 MHz Powerbook FW Pismo. It worked first try.

Wack0 commented 4 weeks ago

add HAL functionality to hook various driver/etc exports so existing PCI PPC drivers can work

Upon further research, this would only work for scsi miniport and video miniport drivers, all others just use the DDK macros for readwrite MMIO directly, which are indeed macros on PPC due to inheriting from MIPS.

Probably still possible but harder, and given there aren't that many drivers for PCI hardware on PPC NT, this probably isn't worth the effort. I'm aware that some network drivers are broken on PPC NT even on supported hardware (like AMD PCNET) too.

For SCSI miniports, I guess there are a few supported PCI SCSI drivers under NT4 at least.. The PCI IDE driver (atapi.sys) doesn't work for other reasons anyway.

Video miniports wouldn't work anyway due to ~all of them basically relying on PC VGA BIOS anyway (for mode switching), and the MCS-86 emulation in the HAL for that is unimplemented.

I think the only interesting casualty would be pcmcia.sys, but I'm not entirely sure if that would even work on uninorth systems anyway.

donotsdubba commented 3 weeks ago

This is awesome!!!!!! Epic work @Wack0 !

Incidentally, I happen to be one of those owners of the USB-based PowerBooks (only the final PowerBook model was like this, both 15" and 17"), and of a Mac mini G4, so no PPC WinNT fun for me just yet... Is there a chance we will see a PPC NT USB driver someday?

I'm not sure if it is relevant, but those USB-based PowerBooks are also the only non-G5 PPC Macs to use DDR2 RAM instead of DDR1 or earlier.

Wack0 commented 3 weeks ago

Is there a chance we will see a PPC NT USB driver someday?

Soon(tm).

I'm not sure if it is relevant, but those USB-based PowerBooks are also the only non-G5 PPC Macs to use DDR2 RAM instead of DDR1 or earlier.

I believe it's not relevant. If I understand correctly, Intrepid2 uses effectively the same super I/O and ATA-6 controllers as Intrepid.

These later systems have no ADB whatsoever and the current ADB drivers will hang on initialisation on such systems. That doesn't need to be fixed until there are working USB drivers under ARC and NT.

Absolucy commented 2 weeks ago

Not really related to the issue itself, but it'd be helpful to pin this issue to the top of this repo's issue tracker, so it'd be easier to notice and find for people curious, as I found this from it being linked from one of the duplicate issues, curious about the slot-loader G3 (funnily enough, the issue tracker here was really the only place where I could actually figure out which memory controller the G3 slot-loader had)

Wack0 commented 2 weeks ago

Not really related to the issue itself, but it'd be helpful to pin this issue to the top of this repo's issue tracker, so it'd be easier to notice and find for people curious, as I found this from it being linked from one of the duplicate issues, curious about the slot-loader G3 (funnily enough, the issue tracker here was really the only place where I could actually figure out which memory controller the G3 slot-loader had)

Regarding the chipset, for the purposes of this project there's really only two types of New World system: Gossamer chipset (Grackle + Paddington): iMac tray-loader, PowerMac G3 blue & white, PowerMac G4 PCI (Yikes), PowerBook G3 Lombard Mac99 chipset (Uni-North or successors + KeyLargo or successors): literally every other G3/G4 new world system.

G5 will never be supported, PPC970 has no MSR_LE so would require reviving a cursed set of kernel patches that allowed NT4 (and only NT4) to boot and barely run (with lots of things broken). And would require even more kernel patches due to instruction set differences etc.

donotsdubba commented 1 week ago

@Wack0 About G5s and little endian, if you are willing to use PPC assembly since compilers apparently didn't care to do better, the G5 (PPC 970 family) at least does provide reverse byte-order load-store instructions, based on what XaPHER from MacRumors PPC was saying here.

It can be used inline in C/C++, or in pure PPC assembly programs, but it should be possible. However, I believe that's a lot of work to deal with, and would require digging up the PowerPC ISA specs and maybe also the 970 specs to find the exact instructions that XaPHER was referring to.

Wack0 commented 1 week ago

@Wack0 About G5s and little endian, if you are willing to use PPC assembly since compilers apparently didn't care to do better, the G5 (PPC 970 family) at least does provide reverse byte-order load-store instructions, based on what XaPHER from MacRumors PPC was saying here.

It can be used inline in C/C++, or in pure PPC assembly programs, but it should be possible. However, I believe that's a lot of work to deal with, and would require digging up the PowerPC ISA specs and maybe also the 970 specs to find the exact instructions that XaPHER was referring to.

that's not enough, due to several reasons, including having to deal with load/store instructions with immediate offsets.

I abandoned the cursed port because I actually figured out what MSR_LE did, and because of hard to debug endianness issues like this:

382d7ac094c12e55

things were VERY unstable, with bugchecks plenty, I never got through GUI setup on real hardware if I remember correctly.

donotsdubba commented 1 week ago

I see, that's a pity, but also interesting to learn about, especially the big endian "cursed port" of Windows NT!

Absolucy commented 1 week ago

unsure if this was an issue or not, but usb keyboard works in arc firmware with latest commit on a slot-loading g3, can't get past driver selection in setup tho

Images ![g3-nt-1](https://github.com/user-attachments/assets/a1693e2e-1051-4fd4-b469-373677b76978) ![g3-nt-2](https://github.com/user-attachments/assets/6b7f6d38-559d-42a0-8368-c3e0a53d37f3)
Wack0 commented 1 week ago

as the bugcheck screen says, you are using the wrong drivers.img / wrong HAL.

you need to use the mac99 drivers.img.

OHCI driver for NT is barely started, so you'll get as far as a "no keyboard found" error from text setup.

Absolucy commented 1 week ago

ah, fair. altho i'm a bit dumb and unsure where to get said drivers.img