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.
I don't play with Open Firmware on my old Mac* but I do on an equally
old Sun. Good fun. There is quite a bit of OF documentation
available online if you search for it.
* My old Mac is older than a G4, a 7300 with dual 180
processors...runs MOPS for Forth.
--
Cheers,
Stan Barr plan.b .at. dsl .dot. pipex .dot. com
The future was never like this!
> On Sat, 11 Sep 2010 13:07:46 +1000, Tinkerer Atlarge
> <tink...@optusnet.com.au> wrote:
> > Anyone nostalgic for the old 8-bit micros might be interested to know
> > the powerpc Mac's boot monitor Open Firmware has a lot of similarities
> > to the built-in BASIC interpreters. The 32-bit PowerPC registers are
> > somewhat analagous to the 6502's zero-page memory. The cpu has 32
> > general purpose (integer) registers, each 4 bytes wide, making a total
> > of 128 bytes - half the size of a 6502's zero page memory.
> >
> > 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.
>
> I don't play with Open Firmware on my old Mac* but I do on an equally
> old Sun.
I believe a lot of non-Apple computers can revisit Open Firmware after
the machine has booted, which would encourage people to take more
interest. Not so in the case of Apple Macs unfortunately. You have to
restart the machine every time you want to get back to Open Firmware.
> Good fun. There is quite a bit of OF documentation
> available online if you search for it.
I am more into exploring the underlying hardware and firmware. Apart
from the cpu itself, and standard usage at the Open Firmware prompt, I
have not been able to find much helpful stuff online. My only experience
with computers since my Commodore 128 (apart from end-user and a few
shell scripts) was a short stint as a sysadmin on a unix system. Most of
my time there was spent reordering long chains of scsi devices trying to
get them all to work at the same time.
Consequently I missed out on all the standard developments in mainstream
computer hardware over the past 2 decades and I am now trying to catch
up. What I really liked about the old 8-bit machines is their memory
maps where everything lives at a known familiar address. The G4 Mac will
never be quite that simple, but I have spotted similarities which serve
as toeholds in trying to figure out how the more recent Macs work.
> * My old Mac is older than a G4, a 7300 with dual 180
> processors...runs MOPS for Forth.
My first and only previous Mac was a 7200. I remember taking a look at
Open Firmware on it and I was horrified. I don't blame you for giving it
a miss. However I now have two eMacs, one dated 2003, the other 2006.
There seems to have been considerable improvement in Apple's Open
Firmware since then.
If you really need to know more I might be able to answer some
questions as I started the Open Firmware department at Apple.