From: JL
Reply-To: JL
Date: Mon, 18 Jan 2010 16:04:56 +0000 (GMT)
To: joevt
Subject: Fw: ROM Tools...
Hi,
I'm looking to spend sometime debugging the nvidia FX5200 PCI Roms to work on oldworld 2.1/2.4 open firmware - it would be the icing on the cake after my work on getting Leopard running on oldworld macs:
I was just wondering if you have any experience of editing PPC nvidia mac roms and if so if you just used hexedit to change them, or detokenized them, and re-tokenized them after changes? If so could you point me in the directions of these tools?
Thanks very much,
JL.
============================
You won't understand anything by using just HexEdit. You need to look at the forth code. Do you have my detok, toke, and DumpPCIRom MPW Tools from Jan 25, 2007? You need to understand the forth code if there's a problem with the version of Open Firmware on the Mac you are running on and not with the graphics card timing. Does the card work in the latest Macs that have a PCI slot, such as a Power Mac G4? After getting the forth code from the card, you can modify it (such as adding debug statements to output to the serial port to follow how the code works and see how far it gets if it hangs).
The first thing you would need to do with the card is make sure it's Open Firmware driver loads in Open Firmware correctly so that you can initialize the screen, draw to it, and change the resolution in Open Firmware.
I haven't done any work on the NVIDIA ROMs myself. The people that post to
http://strangedogs.proboards.com/ have done a lot of work on NVIDIA cards.
They have a download site of ROMs:
themacelite.wikidot.com
Notes on NV Roms:
themacelite.wikidot.com
The hex they show can probably be found in the forth code as a sequence of encode-bytes encode+ instructions which build an Open Firmware property called NVDA,BMP (or maybe it's one of the other properties) which is probably a copy of the data that would appear in a BIOS rom and which is used by the Open Firmware code. Note that the hex they show may contain forth tokens so it may help to use a hex editor to find their offset, then look for the offset in the forth code (detok has a show offsets option).
For example, the 01 15 01 12 12 FC string that they talk about are the Fcode tokens: encode-bytes, encode+, b(\")
Thomas Perrier's softwares.
thomas.perrier.name
Editing timing info on Nvidia Mac roms.
themacelite.wikidot.com
This is a PC app. Maybe it can work on a datafork file containing the bytes from the NVDA,BMP property.
There's a Softstrap Copier.app utility to copy softstrap info from PC BIOS rom to a Mac Open Firmware Rom.
You can see how the utilities modify the ROMs by viewing the forth code before and after the change and doing a text compare.
I tried creating an ATI Multi Flasher which would flash an NVIDIA FX 5500 card but I don't remember how far I got. I made the app but don't know if it was used successfully. You probably already have a flasher that will do the job anyway (such as the one included with Graphiccelerator.app or NVIDIAFirmwareUpdate 1.1
============================
Hi,
Thanks very much for taking the time to reply.
I've not got a copy of the detok, toke, and DumpPCIRom MPW tools... is this lurking on the old strangedogs board (if so I can't seem to find it) or would you be able to send via e-mail?
The 5200 PCI has been flashed and works on the NewWorld macs (B&W G3 upwards) - as a starting point I was thinking of comparing the successful load in newOF and seeing how far it got in oldOF and comparing the words/methods available in OF.
Thanks for the links - and suggestions - a great place to start.
JL.
============================
The tools are on the strangedogs website. I'm organizing my Open Firmware notes and stuff and then I'll put them on a website where you can download them. I should be done by Sunday.
Open Firmware probes a PCI card by doing stuff to the card's registers and creates properties that describe the address ranges (reg I think - it's all in the notes). Then it checks if the card has an Open Firmware rom and executes that. The Open Firmware rom can modify those reg properties so you will want to see what the properties are when the card does not have an Open Firmware rom on it (use the original PC BIOS rom) and compare that on both a Newworld and Oldworld Mac. Then compare that with the properties you see on both a Newworld and Oldworld Mac when using the Open Firmware rom.
Can you describe the problem you see when the card has an Open Firmware ROM on a Beige G3?
The Rom might be using new fcode tokens that don't exist on Old World Macs. My detokenizer might give you warnings for that.
The get-inherited-property method has a bug in Open Firmware 1.0.5 and so does map-in but you're using Open Firmware 2.0f1 I think. It's something to keep in mind if you decide to try to make it work in an older Mac like the Power Mac 8500/8600/9500/9600.
Old World Macs can't save name registry properties greater than 8 bytes in length in NVRAM. I've made an extension for Mac OS 9 (and patches to XPostFacto for Mac OS X) to work around that problem. This shouldn't be a problem since a card should work without that property existing in NVRAM. The property is used by the card's Open Firmware driver for setting up the startup resolution. It's also used by the Mac OS 9 or Mac OS X drivers but that's later in the boot process.
============================
Oops - I meant to say the tools are not on the strangedogs website.
My ISP only allows 22MB of files on their server so I placed them on one of my computers here that you can access using sftp.
In a Terminal window:
cd ~
sftp ______.com (password is _______)
cd Public
cd "Drop Box"
get OF.zip
quit
The OF.zip file (340 MB) contains a bunch of other zip files and a Read Me.rtf which you should read first. Tell me when you're done getting the file so I can remove the test account.
Let me know if you have any questions.
You should get the forth code from the rom using DumpPCIRom, tokenize that into a new rom using toke, then use DumpPCIRom on the new rom and compare the 4th code of the two roms to make sure the tools are faithfully detokenizing and tokenizing the rom.
============================
Hi Joe,
Thanks - have now got the OF.zip file
Will be posting on a few forums (applefritter and strangedogs) if I get anything sorted.
JL.