CircuitBored
Well-known member
Having finally revived my Umax Pulsar (SuperMac S900) I thought it was about time I had a poke around in Open Firmware and took a look at if and how this patch could be applied to it.
For context:
The S900 is quite strange. From a hardware perspective it is very similar to a Power Macintosh 9500 and most of the chipset is identical, however four of its six PCI slots sit behind a PCI bridge. As I understand it, the ROM is identical to the 9500's too. The S900's killer issue is that any PCI card that contains a PCI-PCI bridge installed into a bridged slot will cause the machine to hang when the OS starts to load extensions. This is most definitely a firmware issue, as @trag has experimented with replacing the onboard PCI bridge chip with a later revision to no avail.
Probing into Open Firmware, I found that devices behind a second PCI-PCI bridge are indeed not enumerated properly. Having read the Gazelle thread thoroughly, I was still quite confident that this patch would allow these cards to work, however...
As it stands the pitcher-patcher created by @cheesestraws does not work on the S900 for what I assumed was some arbitrary reason, perhaps due to the fact that this machine runs a buggy implementation of Open Firmware 1.0.5. The compiled patcher will load but returns a "Type 1" error when you actually try to apply the patch.
I attempted to patch nvramrc the hard way using nvedit but unfortunately a line length limit kicks in and "auto-returns", scuppering the whole procedure. If there's a smarter way to try this, please let me know.
Compiling and running the original patcher from the source appears to yield no errors, however it seems as though all is still not well. For some reason, every time the S900 boots to Mac OS, the following code is written to the nvramrc:
After a bit of light debugging with @cheesestraws we quickly realised that the pitcher-patcher is trying to write the nvramrc to the wrong nvram address. In "bootvars.c" there is an interesting comment:
This suggests that there is a degree of variety in how different machines address their vram, one that is properly accommodated for in the various utilities that can write to nvram e.g. netbsd boot variables control panel. Over the next couple of days I'll be doing a bit of cross-referencing to see how they're doing things differently. As of my writing this, I haven't a clue what the correct address for the S900 is.
Exactly what the above Forth code is doing or where it is coming from eludes me. I'm not sure that my copy of it is complete, as my outputs in Xterm are quite messy. At first I thought its source could be one of the control panels that are installed on my system disk, or even the oldworld Mac patcher for 9.2.2. Unfortunately, having removed those variables, I am still left with this script in nvramrc every time I boot 9.1 or 9.2.x.
Could it be a patch applied by a PCI card or even the Sonnet CPU? Sadly, it seems it's not that simple. A bit of trial and error has proven that it's likely something being done by the system software during the boot process. I deduced this by booting with blank nvram and observing that nvramrc has always been updated by the time the desktop loads. If anyone recognises the above script or has any insights they will be greatly valued. At the moment, my best hypothesis is that it is a patch made by Apple specific to the logic boards in the 9500 family. It could even be the case that this patch isn't quite right for the S900's niche hardware and the source of some of the PCI woes. That last part is pure speculation, mind.
Ignoring loading the script from the OS, it seems as though I could still be able to load it from the Open Firmware console by sending a Forth file over serial or by loading from a floppy disk (if I have understood the Gazelle hack thread correctly). I'm not sure that the Fcode cooked up by @joevt could be applied here as it seems to be focused on an issue with the Gazelle's internal graphics, whereas the S900 has no internal graphics at all. Sadly, it strikes me as a bit of wild goose chase to attempt forcing the patch into place before I actually know what is going on here. All of this is moot if whatever I write to nvram is overwritten by the system software starting up.
I am a novice when it comes to most forms of programming. My limited experience comes from tooling around with the firmware on Sun workstations, a lot of which is not very transferable, and fiddling with other people's Python and C to make it do what I want. Creating stuff from scratch is an intimidating challenge but I am hoping to learn a lot as I go. For now, I will simply attempt to accumulate as much information as possible here before grabbing the bull by the horns. Tomorrow I am going to attempt to run lspci for Open Firmware and will share the results accordingly. This may well shed some light on exactly what is going wrong with this frankly shambolic firmware.
This is somewhat of a nothingy post for now. I am mostly writing it here as a way to keep track of what I have tried so far but, as mentioned, it would be tremendous to have some external input too. Thanks in advance to anyone who gets involved.
For context:
The S900 is quite strange. From a hardware perspective it is very similar to a Power Macintosh 9500 and most of the chipset is identical, however four of its six PCI slots sit behind a PCI bridge. As I understand it, the ROM is identical to the 9500's too. The S900's killer issue is that any PCI card that contains a PCI-PCI bridge installed into a bridged slot will cause the machine to hang when the OS starts to load extensions. This is most definitely a firmware issue, as @trag has experimented with replacing the onboard PCI bridge chip with a later revision to no avail.
Probing into Open Firmware, I found that devices behind a second PCI-PCI bridge are indeed not enumerated properly. Having read the Gazelle thread thoroughly, I was still quite confident that this patch would allow these cards to work, however...
As it stands the pitcher-patcher created by @cheesestraws does not work on the S900 for what I assumed was some arbitrary reason, perhaps due to the fact that this machine runs a buggy implementation of Open Firmware 1.0.5. The compiled patcher will load but returns a "Type 1" error when you actually try to apply the patch.
I attempted to patch nvramrc the hard way using nvedit but unfortunately a line length limit kicks in and "auto-returns", scuppering the whole procedure. If there's a smarter way to try this, please let me know.
Compiling and running the original patcher from the source appears to yield no errors, however it seems as though all is still not well. For some reason, every time the S900 boots to Mac OS, the following code is written to the nvramrc:
: '& get-token drop ;
: >& dup @ 6 << 6 >>a -4 and + ;
: & na+ >& ;
6ED '& execute
0 value mi
: mmr " map-range" mi if my-self $call-method else $call-parent then ;
89B '& ' mmr BRpatch
: mcm -1 to mi $call-method 0 to mi ;
8CB '& 1E na+ ' mcm BLpatch
: maa -1 to mi 1D swap ;
8C9 '& 5 na+ ' maa BLpatch
8C9 '& 134 + ' 1 BLpatch
8CD '& 184 + dup 14 + >& BRpatch
8C6 '& 7C + ' u< BLpatch
0 value yn
: y yn 0= if dup @ to yn then ;
8CB '& ' y BRpatch
' y 28 + 8CB '& 8 + BRpatch
: z yn ?dup if over ! 0 to yn then ;
8CC '& ' z BRpatch
' z 2C + 8CC '& 8 + BRpatch
After a bit of light debugging with @cheesestraws we quickly realised that the pitcher-patcher is trying to write the nvramrc to the wrong nvram address. In "bootvars.c" there is an interesting comment:
If it's a powerbase, we'll read 0 from nvram location 0.
This suggests that there is a degree of variety in how different machines address their vram, one that is properly accommodated for in the various utilities that can write to nvram e.g. netbsd boot variables control panel. Over the next couple of days I'll be doing a bit of cross-referencing to see how they're doing things differently. As of my writing this, I haven't a clue what the correct address for the S900 is.
Exactly what the above Forth code is doing or where it is coming from eludes me. I'm not sure that my copy of it is complete, as my outputs in Xterm are quite messy. At first I thought its source could be one of the control panels that are installed on my system disk, or even the oldworld Mac patcher for 9.2.2. Unfortunately, having removed those variables, I am still left with this script in nvramrc every time I boot 9.1 or 9.2.x.
Could it be a patch applied by a PCI card or even the Sonnet CPU? Sadly, it seems it's not that simple. A bit of trial and error has proven that it's likely something being done by the system software during the boot process. I deduced this by booting with blank nvram and observing that nvramrc has always been updated by the time the desktop loads. If anyone recognises the above script or has any insights they will be greatly valued. At the moment, my best hypothesis is that it is a patch made by Apple specific to the logic boards in the 9500 family. It could even be the case that this patch isn't quite right for the S900's niche hardware and the source of some of the PCI woes. That last part is pure speculation, mind.
Ignoring loading the script from the OS, it seems as though I could still be able to load it from the Open Firmware console by sending a Forth file over serial or by loading from a floppy disk (if I have understood the Gazelle hack thread correctly). I'm not sure that the Fcode cooked up by @joevt could be applied here as it seems to be focused on an issue with the Gazelle's internal graphics, whereas the S900 has no internal graphics at all. Sadly, it strikes me as a bit of wild goose chase to attempt forcing the patch into place before I actually know what is going on here. All of this is moot if whatever I write to nvram is overwritten by the system software starting up.
I am a novice when it comes to most forms of programming. My limited experience comes from tooling around with the firmware on Sun workstations, a lot of which is not very transferable, and fiddling with other people's Python and C to make it do what I want. Creating stuff from scratch is an intimidating challenge but I am hoping to learn a lot as I go. For now, I will simply attempt to accumulate as much information as possible here before grabbing the bull by the horns. Tomorrow I am going to attempt to run lspci for Open Firmware and will share the results accordingly. This may well shed some light on exactly what is going wrong with this frankly shambolic firmware.
This is somewhat of a nothingy post for now. I am mostly writing it here as a way to keep track of what I have tried so far but, as mentioned, it would be tremendous to have some external input too. Thanks in advance to anyone who gets involved.
Last edited: