A major difference which has deterred potential users in the past is
that Apple Computer does not document its hardware and firmware as
comprehensively as the way "personal computer" manufacturers did in the
past. However the Open Firmware user interface offers a rich and
interesting programming environment which is available to the user prior
to booting the operating system from disk. (Just hold down the key
combination Ctrl-Alt-O-F after the startup chime, and don't release
until Open Firmware's " 0 > " prompt appears).
Unlike the earlier 8-bit micros, Open Firmware uses forth to implement
its command interpreter instead of BASIC. Forth is more complicated to
learn, but it is also a lot more efficient and powerful. You can write
device drivers with it, for example.
However, because of previous neglect by the user communities, it lacks
interesting and/or useful software beyond what is provided in the
resident Open Firmware ROM. To some extent you could say it is partially
crippled, possibly as a deliberate security measure. Getting around its
lack of easy obvious solutions is what makes it more interesting to
die-hard coders like me.
I see it as a worthwhile goal to help these old Macs extend their
lifespan by writing some of the missing software. I invite others to
contribute and discuss their own Open Firmware efforts as well.
To get the ball rolling, I will post the source code for a tiny program
I just wrote which gives a G4 Mac the ability to list the most recently
loaded Open Firmware program when 'list' is entered at the prompt - just
like on the old 8-bit micros.
If you then use it to list itself and examine its forth source code, you
will see how some of the complications I alluded to can be got around.
One complication is that the built-in value word "actual-load-size" is
normally hidden from the user interface. Another is that the loaded text
is typically concealed, although only the value of parameter "load-size"
is actually erased until another file is loaded or booted.
Yet another complication: modern Mac files typically have only a
linefeed at the end of each line of text, whereas Open Firmware's
terminal emulator takes the terms "linefeed" and "carriage-return"
literally. When outputting such text, it needs what it calls "carret"s
inserted at the appropriate places, otherwise it will start each new
line directly below where the previous line ended.
I will post a screen dump of "list.of" being booted by the user before
being used to list itself in parallel thread "A LIST command for G4
Macintosh Open Firmware"
Obviously it is intended for use with the loaded content of text files,
and will only work with content Open Firmware recognizes (or thinks it
recognizes) as actionable. If you load and then list (without executing)
a bootable binary file, the binary content will typically be preceded by
a "<CHRP-BOOT>" XML structure. After that has listed you will see
garbage, the same as you would in a linux shell. If that happens, press
'q' (maybe twice) to terminate the listing.
Cheers
> (Just hold down the key
> combination Ctrl-Alt-O-F after the startup chime, and don't release
> until Open Firmware's " 0 > " prompt appears).
Correction: Should have been Cmd-Option-O-F to start Open Firmware.