Mac Classic

My need control fan speeds arose while setting up a PowerBook G4 (17" 1.33Ghz) to boot into Mac OS 9 natively. Mac OS 9 is terrible at monitoring hardware temperatures, and especially with unsupported machines. At the time of writing this I haven't found any software that runs under Mac OS 9 that can control system fan speeds. G4FanControl is an excellent tool for PPC machines running Mac OS X, but may not work with all machines.

After successfully setting up my PBG4 with Mac OS 9 it quickly began overheating with minimal use. To overcome this I had to manually adjust the fan speeds within the Open Firmware.

Please note that the commands and values specified in this post may not be applicable to the machine you are using, and have the potential to cause irreversible damage. Proceed at your own caution.

Boot into Open Firmware

Boot into your machine's Open Firmware my restarting and holding the keys Command + Shift + O + F
 

Testing the fans

The PowerBook G4 (Model 5,3) has a device ‘fan’ with multiple ‘methods’. To see these enter the following commands:

dev fan

words

You can call a method by structuring a command like the example below:

  1. " fan" open-dev constant fan-ih - You only need to do this once.
  2. " fans-on" fan-ih $call-method
    This should turn both fans on for your machine (at full speed). Run the fans-off method to turn them off again.

Setting a fan speed

You can set a constant fan speed that will persist as long as your machine is connected to a power source (power adapter/charged battery). To do this you need to add the required Open Firmware commands to the NVRAM.

  1. Open the NVRAM editor by running nvedit
  2. Add the command to open the fan device:" fan" open-dev constant fan-ih
  3.  Call the set-speeds method with the speed of ‘340’:1 340 " set-speeds" fan-ih $call-method
  4. Press Control + C on the keyboard to exit the NVRAM editor
  5. Run the command nvrun to execute the contents of the NVRAM

Here’s what this should look like on your screen:

> nvedit
> " fan" open-dev constant fan-ih
> 1 340 " set-speeds" fan-ih $call-method
> nvrun

On my PowerBook ‘340’ is a moderate speed. Open the NVRAM editor again to adjust this number to find your desired fan speed. Press the down arrow key to navigate the different commands in the NVRAM. Make small adjustments such as ‘340’, ‘350’, ‘360’. You will find that there is a small window in which the fans operate.

If you have found a speed that you are happy with, run the following commands to store this information in the NVRAM:

nvstore
setenv use-nvramrc? true
reset-all

Your machine will reboot and these values will persist as long as it’s powered (power adapter, plugged into the wall, or with a charged battery). As soon as your machine loses power the contents of the NVRAM are lost. To reduce the amount of typing after a power loss, you can write an Open Firmware script. If you have a script called ‘bootscript’, you will just need to enter the following into Open Firmware after a power loss:

setenv boot-device hd:\bootscript
mac-boot

Writing a script

Scripts can be written with the Mac OS 9 application ‘SimpleText’. Open SimpleText and add the following to your new document. Alter the speed if necessary.

This script tells all fans to run at the specified speed.

\ comment
cr

" fan" open-dev constant fan-ih
1 340 " set-speeds" fan-ih $call-method

boot hd:,\\:tbxi

OR

This script tells both Fan 1 and Fan 2 to run at the specified speeds.

\ comment
cr

" fan" open-dev constant fan-ih
1 356 " set-speed" fan-ih $call-method
2 356 " set-speed" fan-ih $call-method

boot hd:,\\:tbxi

The first line of the script must contain an Open Firmware comment, followed by a carriage return (‘cr’).

The last line sets the boot device to the default HD so the machine continues to boot after running the script.

Save the file to the root of your hard drive and call it ‘bootscript’.

Running the script

Restart your machine into Open Firmware and run the following command:

setenv boot-device hd:\bootscript

Is there a better method?

If you have found a better method, or a way to add variable speeds please get in touch.

Post a Comment