• 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.

The Great Gazelle PCI Hack Thread, Part 2

Phipli

Well-known member
Thanks, I seem to have an issue with Maczip I cant seem to just drop the Zip file on the icon or on an alias of Maczip, it just moves the file to the same location. I think this is where my problem lies because I'm having to use the maczip gui to extract it.

If I bring the zip file over to the Stuffit expander Alias the icon goes dark has expected and when I let go it unpack it but not how Maczip would, so I'm trying to see what I'm not doing correctly
Don't use Stuffit to extract zips, it isn't the best at it.

I'd suggest redownloading maczip. Grab a copy here.

The big thing with Mac files is not to move them via non-macs uncompressed, so don't open the file until it is on a Mac, and don't move it via a PC or PC formatted disk (or PC style network) once you expand it.

PCs don't understand the structure of Mac files and strip out important data. Using file formats like hqx protects the contents.
 

Timtheloon

Active member
I wasn't using stuffit to do the extraction I was just giving an example of what the Maczip isn't doing when I drag the zip file over to it to explain the difference I'm seeing. What's frustrating is I'm sure it just worked on my 5400 mobo Maczip that is not this patch.

I'm setting up my network card to get the files over and see how I get on I'll give you all an update later

Thanks @Phipli for you assistance here very much appreciated 👍
 

Timtheloon

Active member
Found out what my issue was I now tried an older version of stuffit expander 4.0.2 and it unpacked Maczip correctly and it would let the drag and drop function work woohoo.

It extracted and it lets me install the patch

However I still get no change and looking through this thread I see @cheesestraws mentions a similar card which he hasn't got to work yet

I've attached some pics of the card I was hoping to get to work
 

Attachments

  • IMG_20230916_105229425.jpg
    IMG_20230916_105229425.jpg
    4.5 MB · Views: 28
  • IMG_20230916_105225624.jpg
    IMG_20230916_105225624.jpg
    5.5 MB · Views: 25
  • IMG_20230916_105254829.jpg
    IMG_20230916_105254829.jpg
    5.1 MB · Views: 28

Phipli

Well-known member
Found out what my issue was I now tried an older version of stuffit expander 4.0.2 and it unpacked Maczip correctly and it would let the drag and drop function work woohoo.

It extracted and it lets me install the patch

However I still get no change and looking through this thread I see @cheesestraws mentions a similar card which he hasn't got to work yet

I've attached some pics of the card I was hoping to get to work
Have you installed drivers for the ethernet portion?

You may also need to install stuff to make USB and FW work.

What does System Info say now?
 

Timtheloon

Active member
Have you installed drivers for the ethernet portion?

You may also need to install stuff to make USB and FW work.

What does System Info say now?
I was hoping the ethernet driver would be the same has the one on the current ethernet card I use because the IC on both cards are the same number

I've not gone any further because I thought I would see more PCI devices when I added the patch

All that seems to have happened is my PCI bridge is now at the top of the list above the Display adapter, added screenshot
 

Attachments

  • 16948602634876005619907654412768.jpg
    16948602634876005619907654412768.jpg
    11 MB · Views: 32

Phipli

Well-known member
The correct USB stuff is only installed by the OS if you have a working card installed, so install this :


Also this just in case :


And... This might work for your ethernet, but that is a big old "it depends".


Note this is a bit off topic for this thread as this is just normal use of a PCI card. If you continue to have issues, please spin up a new thread about sorting the drivers for your card.
 

Timtheloon

Active member
Apologies if I'm on the wrong thread but I thought this thread was about getting unsupported Combo PCI cards to see past the PCI bridge which is stated in Post 1 of this thread?
 

Phipli

Well-known member
Apologies if I'm on the wrong thread but I thought this thread was about getting unsupported Combo PCI cards to see past the PCI bridge which is stated in Post 1 of this thread?
It's about patching open firmware to get the bridge chips working. You've done that now. You're now having driver issues.

I worry that this thread should have been locked with the solution posted at the end to keep it useful. It's less confusing then and if people are having issues implementing it they can spin up a new thread (for example, your issue was actually initially a problem with decompressing the file, and is now driver issues, neither... Are directly applicable to the firmware patch)

The tricky thing is that the solution that this thread is about is now buried on page 12 of 17 on this thread. It is getting harder and harder to find, and I'm the one that posted the applet :ROFLMAO:
 

Timtheloon

Active member
I get what you saying but nothing has changed after applying the patch, should I not see 3 more PCI devices available in my system info I added a screen shot earlier ref this
 

Phipli

Well-known member
I get what you saying but nothing has changed after applying the patch, should I not see 3 more PCI devices available in my system info I added a screen shot earlier ref this
Combo cards are weird, and FW and USB can be weird and don't show properly. I'm surprised I can't see the ethernet.

If your machine is a 5500 board, it is identical to the 6500 board I have personally used the patch on. The patch is known to work based on a number of people installing it. If you have applied the patch. Then the issues are specific to your setup.
 

CC_333

Well-known member
I worry that this thread should have been locked with the solution posted at the end to keep it useful. It's less confusing then and if people are having issues implementing it they can spin up a new thread (for example, your issue was actually initially a problem with decompressing the file, and is now driver issues, neither... Are directly applicable to the firmware patch)

The tricky thing is that the solution that this thread is about is now buried on page 12 of 17 on this thread. It is getting harder and harder to find, and I'm the one that posted the applet :ROFLMAO:
Or, perhaps, start a new thread with your page 12 solution posted on top. Then that thread can be stickied and locked.

Or, better still, create a wiki page for it on the 68kMLA wiki site, if and when it ever gets fixed.

c
 

CircuitBored

Well-known member
Please could the owner of a Gazelle system run .properties on the nvram when they get the opportunity? I'm messing around with the SuperMac S900 and am trying to establish if its nvram is located in the same place in memory.

For reference, this is the S900's nvram.properties:

Code:
name                    nvram
device_type             nvram
reg                     0001D000  00000010
                        0001F000  00000200
existing                00000000 00002000
 

joevt

Well-known member
Please could the owner of a Gazelle system run .properties on the nvram when they get the opportunity? I'm messing around with the SuperMac S900 and am trying to establish if its nvram is located in the same place in memory.

For reference, this is the S900's nvram.properties:

Code:
name                    nvram
device_type             nvram
reg                     0001D000  00000010
                        0001F000  00000200
existing                00000000 00002000
I don't remember where this came from:
Code:
/bandit@F2000000/ohare@10/nvram@60000
PROPERTIES:
name                    nvram
device_type             nvram
reg                     00060000  00020000 
existing                00000000 00002000

Anyway, it shouldn't matter where the NVRAM is at because the NVRAM drivers in Open Firmware and Mac OS 9 know how to access the nvram. You use the methods provided by each environment to read the NVRAM. For Mac OS 9, you use the ExpansionManager.

Code:
{$PRAGMAC MARK -}
CONST
	_ExpansionManager			= $AAF3;

{$DEFINEC SIZE_CODE(size)
	ORD((size) = 4) * kFourByteCode + ORD((size) = 2) * kTwoByteCode + ORD((size) = 1) * kOneByteCode
}

{$DEFINEC RESULT_SIZE(sizeCode)
	BSL(sizeCode, kResultSizePhase)
}

{$DEFINEC STACK_ROUTINE_PARAMETER(whichParam, sizeCode)
	BSL( sizeCode, kStackParameterPhase + ((whichParam) - 1) * kStackParameterWidth )
}


CONST
	uppReadNVRAMProcInfo = kD0DispatchedPascalStackBased
		 + RESULT_SIZE(SIZE_CODE(sizeof(SignedByte)))
		 + STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Integer)))
		 + STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(LongInt)));


	uppWriteNVRAMProcInfo = kD0DispatchedPascalStackBased
		 + STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Integer)))
		 + STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(LongInt)))
		 + STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(SignedByte)));


	kReadNVRAMSelector			=	$022E;
	kWriteNVRAMSelector 		=	$032F;


FUNCTION ReadNVRAMByte(offset: LongInt): SignedByte;
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $303C, $022E, $AAF3;
{$ELSEC}
BEGIN
	ReadNVRAMByte := CallUniversalProc( GetToolboxTrapAddress( _ExpansionManager ), uppReadNVRAMProcInfo, kReadNVRAMSelector, offset);
END;
{$ENDC}

PROCEDURE WriteNVRAMByte(offset: LongInt; value: SignedByte);
{$IFC TARGET_OS_MAC AND TARGET_CPU_68K AND NOT TARGET_RT_MAC_CFM}
INLINE $303C, $032F, $AAF3;
{$ELSEC}
BEGIN
	IF CallUniversalProc( GetToolboxTrapAddress( _ExpansionManager ), uppWriteNVRAMProcInfo, kWriteNVRAMSelector, offset, value ) = 0 THEN;
END;
{$ENDC}
 

KnobsNSwitches

Well-known member
I just wanted to say thanks to @cheesestraws for this hack!

I purchased a tango 2.0 NIB on ebay awhile ago, but never installed it. I assumed it was the original version that worked on the TAM, as it said TAM on the box...but it didn't work with the original sonnet firmware patch.

But with Tango2.0new from this thread, it's working on my TAM.
Now if only my 3rd gen iPod would behave itself in Mac OS 9....
 

Daniël

Well-known member
I suspect, but do not know, that Apple did something in the Gazelle architecture that makes it act like the Gazelle PCI slots are already behind one bridge.

If that last sentence is true, then the PowerSurge and Gazelle problems are all symptoms of the same failure of Apple to properly deal with daisy chained PCI-PCI Bridges. OF will interrogate the first PCI-PCI bridge, but not any bridges behind that one.

It's been a while, but I've recently come across the 6500 schematics, which I have been studying a bit for modification purposes :)
You are right, this appears to be exactly what happens.

PSX, the main 60x/PPC bridge, only outputs a single set of PCI "slot" connections (one #GRNT, one #REQ, one #INT).
This goes to O'Hare, the I/O controller, alongside the other PCI "shared" connections (address lines, data lines, etc.), which in turns handles the PCI connections to the ATi Rage II, COM slot, and two PCI slots.

O'Hare is, as far as I can tell, effectively acting as a PCI-PCI bridge, and that's probably the underlying cause for the funkiness when a secondary PCI-PCI bridge is thrown into the mix.
 

Superdos

Well-known member
Wanted to chime in and say a heartfelt thank you for the geniuses that made this patch possible, it helped with the 6500/275 + Sonnet L2 400/1M I picked up from VCFMW off the free pile a couple weeks back.

However, I did notice something strange.
Using this with an Orange Micro OrangeLink USB+FW card (in the B slot) I've had for the last 15 years, the patch here seems to present a bit of a speed decrease benchmark wise than the official OrangeLink FW patcher does. I haven't necessarily seen anything regarding this and wanted to know if this was expected behavior with the way the patch worked.

MacBench 5 reports a 100% CPU benchmark against a G3/300 with this patch in place and that speeds up to 112% if I zap the PRAM and install the Orange one instead.
This is also with 128MB of EDO installed and a Radeon 9200 in the A slot.

Now that I've installed the official patch, I'm going to give some other tests a shot and see how the system fares. Framerate on the iTunes visualization is something to test and then playing a game like UT99 and seeing if I still see the stuttering it does when played in RAVE mode. If it does, then it would definitely be down to this patch, somehow.
 

joevt

Well-known member
However, I did notice something strange.
Using this with an Orange Micro OrangeLink USB+FW card (in the B slot) I've had for the last 15 years, the patch here seems to present a bit of a speed decrease benchmark wise than the official OrangeLink FW patcher does. I haven't necessarily seen anything regarding this and wanted to know if this was expected behavior with the way the patch worked.
Do you have a link for the OrangeLink FW patcher?

Does the OrangeLink FW patcher allow you to use both FW and USB of the OrangeLink card? Or do you need the patch described in this thread to get both FW and USB?

Maybe you just need to add this thread's patch to the OrangeLink FW patcher's patch?
 

Superdos

Well-known member
Do you have a link for the OrangeLink FW patcher?

Does the OrangeLink FW patcher allow you to use both FW and USB of the OrangeLink card? Or do you need the patch described in this thread to get both FW and USB?

Maybe you just need to add this thread's patch to the OrangeLink FW patcher's patch?

from Web Archive
The download you want is the last link.
Both patchers let me use USB and FW. Card has a HiNT PCI bridge chip.

It might be a plausible thing to patch the patcher with the newer patch, I was just saying that using the newer one instead of the Orange one seems to give a performance hit and I don't know why.
 

joevt

Well-known member
from Web Archive
The download you want is the last link.
Both patchers let me use USB and FW. Card has a HiNT PCI bridge chip.

It might be a plausible thing to patch the patcher with the newer patch, I was just saying that using the newer one instead of the Orange one seems to give a performance hit and I don't know why.
I extracted the patch info with this:
Code:
derez PCIBridgePatch > PCIBridgePatch.r
# No code in the resources.

mpw dumppef -do All -pi u PCIBridgePatch > PCIBridgePatch.dumppef.txt
# There's an nvram script in the PiData.

perl -nE '
	if (/Unpacked PiData/../^$/) {
		if (/^ *[0-9A-F]+ +([0-9A-F ]{72})  /) { print $1 . "\n" }
	}
' \
PCIBridgePatch.dumppef.txt | xxd -p -r | perl -007 -pE 's/\r/\n/g;s/\x00+/|\n/g;' > PCIBridgePatch.pidata.txt
# Convert the PiData to txt (replacing nulls with |\n)

The OrangeMicro patch looks like this:
Code:
supress-banner probe-all install-console
: config-l! " config-l!" $call-parent ; : config-l@ " config-l@" $call-parent ;
: check-node my-space " config-l@" $call-parent dup d# 16 >> swap h# 0000FFFF and
my-space d# 8 + " config-l@" $call-parent d# 8 >> h# 60400 = swap h# 1668 = and swap h# 100 = and ;
: my-make-properties make-properties 0 alloc-here 0 " pci" encode-cat my-space h# 2c + config-l@ -rot
2 pick h# FFFF and (u.) encode-cat " ," encode-cat rot d# 16 >> (u.) encode-cat
2dup swap 3 + swap bounds do i c@ h# 40 > if i c@ h# 20 + i c! then loop device-name
0 0 encode-2ints " power-consumption" property 0 0 my-space encode-3ints 0 0 encode-2ints encode+
0 0 my-space 2 d# 24 << or h# 10 + encode-3ints 1000 0 encode-2ints encode+ encode+ " reg" property ;
: make-nodes " assigned-addresses" delete-property
my-space dup 18 + 10100 swap config-l! 4 + dup config-l@ h# FFFFFFF4 and 2 or swap config-l!
new-device 0 0 " c,0" set-args my-make-properties 0 100000 20 claim-real swap drop dup
dup 100000 " map-range" $call-parent dup my-space h# 10 + config-l!
dup 0 my-space h# 82 d# 24 << or h# 10 + encode-3ints 1000 0 encode-2ints encode+
" assigned-addresses" property finish-device
new-device 0 0 " d,0" set-args my-make-properties dup 1000 + my-space h# 10 + config-l!
dup 1000 + 0 my-space h# 82 d# 24 << or h# 10 + encode-3ints 1000 0 encode-2ints encode+
" assigned-addresses" property finish-device
dup dup h# 10 >> or my-space h# 20 + config-l! my-space h# 3c + dup config-l@ h# 800000 or swap config-l!
" ranges" delete-property dup 0 h# 82000000 encode-3ints rot 0 h# 82000000 encode-3ints
h# 100000 0 encode-2ints encode+ encode+ " ranges" property my-space h# 18 + config-l@
dup 8 >> h# ff and swap d# 16 >> h# ff and encode-2ints " bus-range" property ;
: x ['] select-dev catch if 2drop else check-node if make-nodes then then ;
" pci1/@d" x " pci1/@e" x
I think this patch or similar patches were discussed before?
It creates the missing device nodes of the OrangeMicro PCI card instead of fixing or working around the Open Firmware bug.

I suppose you might want to get a dump-device-tree for each patch and compare. Otherwise, there's nothing to do here except maybe figure out the real Open Firmware bug (since the patch created in this thread is just a work-around and not a real fix).
 

cheesestraws

Well-known member
Yes, the Orange Micro patch is almost the same as the Sonnet patch, to the extent that I actually wonder whether they had the same source (someone inside Apple? speculation, but they're extremely similar). If you're running my awful patch, I'd be very surprised if that was the cause of any performance difference (but again, I may have missed something, and I've been surprised before).

If you're using the later and better approach (I can't remember who came up with that, sorry, and I don't have the time to look back through the thread right now - @joevt I think it was you?) then I would also be pretty surprised by a performance difference, but my surprise would be far less well-founded.

Only thing I can think of is whether the slowdown is to do with enabling USB or FW in the OS itself. In other words, "does having working USB hardware attached cause higher CPU usage somewhere", rather than "does the patch cause a performance issue". I've never done or seen any comparative benchmarks here, so that's a pure wild hypothesis.
 
Top