12 January 2020
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.
The PowerBook G4 (Model 5,3) has a device ‘fan’ with multiple ‘methods’. To see these enter the following commands:
You can call a method by structuring a command like the example below:
" fan" open-dev constant fan-ih- You only need to do this once.
" fans-on" fan-ih $call-method
fans-offmethod to turn them off again.
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.
" fan" open-dev constant fan-ih
set-speedsmethod with the speed of ‘340’:
1 340 " set-speeds" fan-ih $call-method
nvrunto 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
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
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’.
Restart your machine into Open Firmware and run the following command:
setenv boot-device hd:\bootscript
If you have found a better method, or a way to add variable speeds please get in touch.