• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

Thunderbolt on Mac OS 9

ArmorAlley

Well-known member
This is in the category: I don't think it is possible but maybe someone has found a way to make it work and can prove me wrong.

I have no hands-on experience at all of Thunderbolt but I have seen Thunderbolt to FW800 adapters on sale.

My limited knowledge of Thunderbolt is that it is unidirectional, that is one can plug a device (by means of adapters) with a FW400/800 port into a computer with a Thunderbolt port but not a device with a Thunderbolt port into a computer with a FW400/800 port.

This would mean, for example, that I could stick an old external HD from 2002 with a FW400 port into a modern computer with a Thunderbolt port but not a 2016 RAID array with Thunderbolt 2 into a Mac Mini G4.

This means that running connecting a Thunderbolt device to a Mac running Mac OS 9 cannot be done via the Thunderbolt port.
Am I wrong?
Is there more to it than that?
 

robin-fo

Well-known member
Connecting ancient FireWire devices to modern Macs is certainly possible:

The other direction is most certainly impossible (you would probably need to implement stuff like PCI express (which Thunderbolt uses) on your vintage machine)

What would be the use case (except for „just for fun“, which is obviously more than enough reason to start a any silly project 🤓😇)?
 

CircuitBored

Well-known member
Connecting ancient FireWire devices to modern Macs is certainly possible:

Just to add a touch more useful info to this: FireWire (via Thunderbolt -> FireWire adapters) on Ventura is extremely sketchy and unreliable - a lot of devices will simply not work at all. I am pleased to say, however, that Sonoma has fixed all the trouble I was having with it.
 

NJRoadfan

Well-known member
Quite a few folks use the Apple Firewire adapter on Windows machines too. Just stinks that its only TB2 and requires yet another expensive TB2 to TB3 adapter to use. Firewire is not host based, so you could connect an old Mac to a more modern machine this way. Firewire also had built-in networking in this manner as well.
 

joevt

Well-known member
The Apple Fire Wire adapter actually uses Thunderbolt 1, same as the Apple Gigabit to Thunderbolt adapter.
The Fire Wire and Ethernet controllers are PCIe controllers. Thunderbolt tunnels PCIe from the host over the Thunderbolt cable to the adapter which converts the tunnelled PCIe to normal PCIe which connects to the FireWire or Ethernet controller.

From attachment netstorlotsofdevices.txt at https://forums.macrumors.com/threads/testing-tb3-aic-with-mp-5-1.2143042/post-27612591
Code:
│ │       │└┬3b:00.0-[3c-3d]      # g1x4           │ │       │└┬ Apple Thunderbolt to FireWire Adapter upstream             [8086:1549] [0604] PCI bridge: Intel Corporation DSL2210 Thunderbolt Controller [Port Ridge 1C 2011]
│ │       │ └┬3c:00.0-[3d]        # g2x4 > g1x1    │ │       │ └┬ Port Ridge downstream for PCIe x4                         [8086:1549] [0604] PCI bridge: Intel Corporation DSL2210 Thunderbolt Controller [Port Ridge 1C 2011]
│ │       │  └─3d:00.0            # g1x1           │ │       │  └─ LSI FireWire                                             [11c1:5901] [0c00] (rev 08) FireWire (IEEE 1394): LSI Corporation FW643 [TrueFire] PCIe 1394b Controller


│ │ │          └┬18:00.0-[19-1a]  # g1x4           │ │ │          └┬ Apple Thunderbolt to Gigabit Ethernet Adapter upstream [8086:1549] [0604] PCI bridge: Intel Corporation DSL2210 Thunderbolt Controller [Port Ridge 1C 2011]
│ │ │           └┬19:00.0-[1a]    # g2x4 > g1x1    │ │ │           └┬ Port Ridge downstream for PCIe x4                     [8086:1549] [0604] PCI bridge: Intel Corporation DSL2210 Thunderbolt Controller [Port Ridge 1C 2011]
│ │ │            └─1a:00.0        # g1x1           │ │ │            └─ Broadcom Ethernet                                    [14e4:1682] [0200] Ethernet controller: Broadcom Inc. and subsidiaries NetXtreme BCM57762 Gigabit Ethernet PCIe

I don't think it would be difficult to get Thunderbolt in Mac OS 9. You need:
1) PCI to PCIe bridge such as https://www.startech.com/en-ca/cards-adapters/pci1pex1
2) Thunderbolt add-in card such as https://www.gigabyte.com/Motherboard/GC-TITAN-RIDGE-rev-20#kf
3) Some software to enable PCIe tunnelling if it's not automatically enabled. Look in torvalds/linux and edk2/edk2-platforms. Also, some data sheets listing all registers were uploaded to macrumors.com.

If #3 requires access to PCIe config space registers (PCI config space registers ≥ 0x100), then hopefully #1 has a method for accessing those.

#2 may require tying some pins (force power) to 3.3V. Find posts on using Thunderbolt add-in cards in PCs or Macs that don't support Thunderbolt.

The software for #3 probably has to be done in Open Firmware. It can be loaded from hard-disk by `nvramrc` before `probe-all` is executed.

Hot plug would require lots of work but you don't need that to connect devices before boot.

Maybe a USB4 add-in card might be easier, since the USB4 spec is public? Thunderbolt 4 add-in cards have USB4 PCI class code so maybe they follow the USB4 spec.

Bonus points if you create an XHCI driver to use the USB 3.x capability of the Thunderbolt 3/4 add-in card. GenericUSBXHCI driver exists for Mac OS X. Maybe it can be ported to PowerPC Tiger / Leopard. I don't think documentation for creating USB drivers for Mac OS 9 is publicly available? You can find some documentation of the USB Interface Module (UIM) in USBPriv.h but that doesn't have everything required. Also, no one has made USB 2.0 drivers (EHCI) for Mac OS 9 either. Is the UIM too limited to support USB 2.0 / USB 3.x ? Can it not pretend that the USB 2.0 / 3.x device is USB 1.1? Maybe that can work for some devices but not others.

While looking at Thunderbolt to attach PCIe devices, it would be interesting to add a driver for NVMe. That would be useful with and without Thunderbolt. nvmexpress.org has specs and source code. For Mac OS 9, I suppose you might want to create a SCSI Interface Module (SIM)? Maybe just start with a simple block device driver. An NVMe driver was created for OS X El Capitan but the source code was not released.

I'm not sure what you would connect to Thunderbolt other than USB 3.x or NVMe. I suppose you could connect a PCIe GPU such as the GeForce 7800 GT for the Mac G5. Earlier GPUs would require a PCIe to PCI bridge. Some PCIe USB 1.1/2.0, FireWire, and Ethernet cards might be compatible but chances are your Mac already has those built-in. SATA may be an option but I think that requires an Open Firmware driver? I don't think Mac OS 9 supports AHCI. It would need a driver just like NVMe does.
 

ArmorAlley

Well-known member
It would need a driver just like NVMe does.
Maybe. My logic was that if the Thunderbolt » FireWire cables were bi-directional, then the FireWire extensions would be the drivers.

Would NVMe bring more than simple SATA SSDs? Wouldn't the PCI or SCSI bus simply be flooded?

Thanks for this post. There is food for thought there.
 

joevt

Well-known member
Would NVMe bring more than simple SATA SSDs?
SATA connects to IDE or AHCI which connect to PCI or to a IDE to SCSI bridge which connects to PCI.
The benefit of NVMe is smaller form factor (though there are also small SATA SSD drives).
Maybe improvement to random I/O performance? I don't know if that's significant for old Power Macs. Are there Power Mac benchmarks that measure random I/O performance?
Maybe there's a benefit for having an open source driver? Or it could be full of bugs... but those bugs can be fixed.
NVMe is a PCI device so it doesn't need a IDE or SATA or AHCI or SCSI controller.
The NVMe controller should easily be able to max out any PCI slot it's connected to. Many old drive controllers do not.
For ATA, only Ultra ATA/133 or Ultra ATA/167 could max out a 32-bit 33 MHz PCI slot.
SATA 1 is 150 MB/s so it can also max out the PCI slot.

One problem with connecting PCIe to old PCI bus is that it's very difficult to find a PCIe to PCI bridge that can do better than 32-bit 33MHz PCI (133 MB/s). That's fine for the Old World Power Macs. The bridge might be able to do 66MHz (GPU slot of B&W G3 or PCI Graphics G4) which is 266 MB/s but the PCIe side is usually only PCIe gen 1 x1 which is 250 MB/s. New World Power Macs have 64-bit 33MHz slots. Power Mac G5 with PCI-X have 64-bit 100 or 133MHz slots (800 or 1067 MB/s). Power Mac G5 with PCIe has slots that can do up to 4000 MB/s (although that would require moving the GPU to the x8 slot). Action Retro showed a benchmark in linux of ≈460 MB/s which is half what I would expect for PCIe gen 1 x4. To get x8 you would need a PCIe gen 2 x8 bridge. For x16, you would need a PCIe gen 3 x16 bridge. I'm not sure which PCIe bridges work in a Power Mac G5.

Wouldn't the PCI or SCSI bus simply be flooded?
NVMe is connected to PCI so it wouldn't affect SCSI. The PCI only gets used when you're reading or writing data. Hopefully it can read and write up to the max speed of the PCI. While it's reading or writing, there could be a slowdown for other devices. I don't know what kind of problems if any would occur because of that. Of course, PCI is always communicating at a fixed speed. It's the duration of the transactions that would cause a problem.
 

joevt

Well-known member
Here's Open Firmware detecting an NVMe device connected to my Power Mac 8600.
Code:
0 > dev / ls 
FF828F80: /PowerPC,601@0
FF829878: /chosen@0
FF8299A8: /memory@0
FF829AF0: /openprom@0
FF829BB0: /AAPL,ROM@FFC00000
FF829DC8: /options@0
FF82A4F0: /aliases@0
FF82A730: /packages@0
FF82A7B8:   /deblocker@0,0
FF82AFB8:   /disk-label@0,0
FF82B4F8:   /obp-tftp@0,0
FF82D938:   /mac-files@0,0
FF82E130:   /mac-parts@0,0
FF82E890:   /aix-boot@0,0
FF82ED08:   /fat-files@0,0
FF8302D8:   /iso-9660-files@0,0
FF830C20:   /xcoff-loader@0,0
FF8315E0:   /terminal-emulator@0,0
FF831678: /bandit@F2000000
FF832868:   /gc@10
FF832CA0:     /53c94@10000
FF834528:       /sd@0,0
FF835158:       /st@0,0
FF835DD0:     /mace@11000
FF836C48:     /escc@13000
FF836DA0:       /ch-a@13020
FF837450:       /ch-b@13000
FF837B00:     /awacs@14000
FF837BE8:     /swim3@15000
FF838CF0:     /via-cuda@16000
FF839880:       /adb@0,0
FF839970:         /keyboard@0,0
FF83A0C0:         /mouse@1,0
FF83A170:       /pram@0,0
FF83A220:       /rtc@0,0
FF83A6E8:       /power-mgt@0,0
FF83A808:     /mesh@18000
FF83C370:       /sd@0,0
FF83CFA0:       /st@0,0
FF83DCA8:     /sixty6@1C000
FF83DDD0:     /nvram@1D000
FF83F848:   /pci106b,1@B
FF83FA20:   /ATY,RV100Parent@D
FF863258:     /ATY,RV100ad_A@0
FF8639D0:     /ATY,RV100ad_B@1
FF864110:   /pci-bridge@E
FF864D78:     /pci16b8,12@0
FF864FE8:     /pci16b8,12@0,1
FF865258:     /pci16b8,21@0,2
FF8654C8:     /pci16b8,1@1
FF865760:     /Ultra-Tek133P@2
FF88F8E8:       /sd@0,0
FF8A41A0:   /pci-bridge@F
FF8A4E30:     /pci1987,5016@0
FF83DF08: /chaos@F0000000
FF8A5298:   /control@B
FF8A6650:   /planb@D
FF83EE98: /hammerhead@F8000000
 ok
0 > dev pci1/@F/@0  ok
0 > .properties 
vendor-id               00001987 
device-id               00005016 
revision-id             00000001 
class-code              00010802 
interrupts              00000001 
min-grant               00000000 
max-latency             00000000 
subsystem-vendor-id     00001987 
subsystem-id            00005016 
devsel-speed            00000000 
AAPL,slot-name          C1
name                    pci1987,5016
reg                     00020000 00000000 00000000  00000000 00000000 
                        03020010 00000000 00000000  00000000 00004000 
assigned-addresses      83020010 00000000 80900000  00000000 00004000

Of course, I have no driver to access it so I don't know if it can be made to work correctly. I would put an Open Firmware driver for the NVMe on a supported SCSI device, and load it using nvramrc. The driver could add support for GPT, HFS+, USB, FireWire, FireWire Target Disk Mode, multi-boot, etc. by porting parts of the Open Firmware code from a Power Mac G5. I wonder if PowerPC Mac OS X 10.4 Tiger can boot from GPT? I suppose the NVMe partition map could be changed to APM instead since OS 9 can't read GPT.
 
Top