[OpenBIOS] Apple's Open Firmware.

Joe van Tunen joevt at shaw.ca
Wed Apr 4 02:09:05 CEST 2018


It's all gibberish. It stops when it sees an end0 token which is just a 0x00 byte. You're detokenizing stuff that isn't fcode. fcode should start with 0xF1,0x08 (start1 format:08 checksum:???? Len:????????). You need to use a version of detok that can skip non-fcode and doesn't stop at a 0x00 byte (like the one I gave you). You also have to find the fcode which is probably in some compressed part of the rom (probably using lz77 or lzss). That seemed too complicated for me, so I created a detok that can just disassemble the compiled fcode from the dictionary (all the bytes between slightly before the first word (which is the last word from the words command) and the value of here).

Anyway, regarding your problem with loading a PCI rom:

I'm updating my toke, detok, and DumpPCIRom commands and scripts (previously Mac OS 9 MPW commands and scripts) to macOS commands and scripts, so you can convert the fcode of your PCI rom to forth, make changes (add debugging or fixes), and recreate the rom. One of the questions is why the ,A and ,B devices are not created on some systems - the problem might be related to how it uses the same fcode to define both devices (if that's what it does)...

It sounds like you are having trouble with connecting to your G4 using telnet. You should boot your G4 into macOS, check the IP address (for example, 192.168.0.120) in the network settings which should come from DHCP from your router, then use that IP address when you boot into Open Firmware (hold Option O F at startup) and type the command:

" enet:telnet,192.168.0.120" io

The capitalization matters. There must be a space after the first quote and nowhere else. I don't know if telnet works from nvramrc or as an input-device. Set those to defaults to start with. Then in Terminal.app on another Mac type

telnet 192.168.0.120

Or use any other telnet client. Current versions of Mac OS X don't come with telnet but it can be easily installed using homebrew or other macOS compatible package installer. On my PowerMac G5, sometimes the telnet connection in Open Firmware stops working and I have to restart the G5. I don't know if it's a bug or a problem with my CPU (it's a quadcore but I have to boot it with cpus=3).

If telnet doesn't work, then consider using a serial port. It should definitely work as input-device and output-device. Newer PowerMacs don't have a built in serial port but they do have a built in serial controller chip which is used by a modem. There are products that let you add a serial port using a connection to that serial controller chip. The Griffin G4Port is one such example. There's also the GeeThree Stealth Port (different version for iMac, G3, G4, (PCI, AGP graphics), and G5),  and Jamport G4. I have one of them in my B&W G3. You can't use a USB serial port adapter from Open Firmware but your other computer can use a USB serial port adapter to connect to the Open Firmware computer.

You can use ttya:57600 (your serial port device might have a different name, maybe you have an scca alias?) as the input and output device to use 57600 bps. I think the default is 38400 bps. You can hack the ttya or scca init routine in Open Firmware so it uses 115200 or 230400 bps (change the init routine so that it will select the RTxC pin (3.8MHz) for the receive and transmit clocks instead of using the baud-rate generator then choose a x16 or x32 divider).


On 4/3/18, 3:42 AM, "Jd Lyons" <lyons_dj at yahoo.com> wrote:

    Now you guys are just talking shop;-)
    
    Just for a lark, I ran detok on a G4 Firmware update.
    
    
    
    I’ll have to try and find why it’s finishing prematurely around 27853 bytes.
    
    > On Apr 3, 2018, at 6:09 AM, Joe van Tunen <joevt at shaw.ca> wrote:
    > 
    > On 4/2/18, 5:30 PM, "Segher Boessenkool" <segher at kernel.crashing.org> wrote:
    > 
    >    On Mon, Apr 02, 2018 at 11:28:43AM -0700, Joe van Tunen wrote:
    >> You couldn't add Apple fcode support because the Apple fcode drivers use different tokens in different firmwares.
    > 
    >    They use FCode numbers < 800, and they are the same everywhere.  For some
    >    reason the didn't use the vendor space (600..7ff) though, but instead
    >    reserved FCode #s.
    > 
    >    (You're right things changed around a bit before NewWorld.  Does
    >    anyone care?  Historians, perhaps.)
    > 
    >    Oh that reminds me...  They do this 16-bit FCode # thing as well, if
    >    memory serves lead by an 0f4 token (followed by two bytes).
    > 
    > 
    >    Segher
    > 
    > I've seen that the compiled fcode has token numbers greater than 0xFFF in the New World Macs. I didn't find the fcode that they are compiled from (need to decompress some parts of rom), and therefore hadn't come to realize that they would need to be tokenized in a special way (if they were sourced from fcode).
    > 
    > I found the code that checks for 0xF4 in the `get-fc function in the PowerMac G5 compiled fcode. So tokens have three ways to be encoded:
    > 
    > 0x00, 0x10-0xFF = one byte    0x??
    > 0x100-0xFFF     = two bytes   0x0???
    > 0x????          = three bytes 0xF4????
    > 
    > 
    > 
    
    





More information about the OpenBIOS mailing list