Read more articles
Compose a new article

Control your Mac fan(s) in Open Firmware

Category: Hacking , Hardware , Repairs
Composed by: OxYGeN
On: 2024-06-24 06:45:23

A mac user said : While setting up a PowerBook G4 (17" 1.33Ghz) to boot into Mac OS 9 natively, there is the lack of controlling the fans. Mac OS 9 is terrible at monitoring hardware temperatures, and especially with unsupported machines. There is no 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 his PBG4 with Mac OS 9 it quickly began overheating with minimal use.

To overcome this we have 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  
Not sure which key to press? Check this article.

 

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 his PowerBook ‘340’ was 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

 

And : Don't forget to leave your comment when you've succesfully did this on your mac. Please write down your Mac model, cpu speed, working enviroinment as well the setting at which the fans were working as desired. yes


source : Controlling System Fans with Open Firmware | Mac Classic (mac-classic.com) original by 'Greystash' , redacted and refined by MR-Member 'OxYGeN'.