kernelthread.com

The Towers of Hanoi in Open Firmware

Following is a screen shot of "The Towers of Hanoi" as a FORTH program for the Open Firmware implementation found on "new world" Macintosh systems. This program is essentially the same as the one for Sun OpenBOOT, except that 2r@ and 2r> are not implemented on Apple's PROM.

The Towers of Hanoi in Open Firmware

Note that rather than type this program at a Macintosh's keyboard, it is easier (particularly for the purpose of taking a screen shot) to use the TELNET protocol to connect a client machine (any platform) to a target machine (Macintosh) running Open Firmware. The procedure is outlined below.

First we need to determine if the Macintosh in question is capable of being a TELNET server while in Open Firmware. Boot the machine into Open Firmware (Cmd-Option-O-F) and type the following at the 0> prompt:

dev /packages ls

If the output (a listing of Open Firmware packages) contains a node named /telnet, then the machine is capable of being debugged over Ethernet.

Connect the Macintosh to another Ethernet capable machine with a TELNET client using a crossover Ethernet cable. Type the following at the Open Firmware prompt of the target machine:

" enet:telnet,10.0.0.1" io

This would launch a TELNET server with IP address 10.0.0.1 on the target machine. The Ethernet interface of the client machine should be configured with an appropriate address (for example, 10.0.0.2 as the IP address and 255.255.255.0 as the netmask). Thereafter, a TELNET client can be used on the client machine to connect to the Open Firmware of the target Macintosh:

telnet 10.0.0.1

As the screen shot above might suggest, I used a Windows machine as the client.

Download

hanoi.macprom

hanoi-gfx.macprom (Graphical)