Author Topic: Setting PowerBook G4 fan speed in open firmware  (Read 12453 times)

Offline Daniel

  • Gold Member
  • *****
  • Posts: 300
  • Programmer, Hacker, Thinker
Re: Setting PowerBook G4 fan speed in open firmware
« Reply #20 on: July 23, 2020, 04:32:02 PM »
I messed up the script a bit. Here is the modified version.
Code: [Select]
' mac-boot @ constant saved-word

: fake-mac-boot
  saved-word ' mac-boot code!
  " boot hd:42,\path\to\fan\script.of" evaluate
;

' mac-boot ' fake-mac-boot brpatch

The word boot always grabs the boot path from the text in front of it at runtime, so directly compiling it in a function is a mistake. The Forth interpreter would have treated the path as forth code, and boot would have tried to grab text from who knows where.

Offline LarsG5

  • Enthusiast Member
  • ***
  • Posts: 25
  • New Member
Re: Setting PowerBook G4 fan speed in open firmware
« Reply #21 on: July 26, 2020, 05:55:06 PM »
Looks like my English isn't enough to get an answer from you said, so I would much appreciate of you could tell me (yes or no) whether this piece of code would reenable the Startup Disk control panel or, again, it forces a Mac to boot from a specific, fixed partition every single time?
Thanks!

Offline Daniel

  • Gold Member
  • *****
  • Posts: 300
  • Programmer, Hacker, Thinker
Re: Setting PowerBook G4 fan speed in open firmware
« Reply #22 on: July 26, 2020, 06:06:09 PM »
Yes, the code will reenable Startup Disk.

Stick the piece of code in NVRAM. Then modify your fan script so it has mac-boot at the end instead of boot.

You will have to make sure the boot-device NVRAM property doesn't point to your fan script. Just point it to the normal hd:,\\tbxi and use Startup Disk normally.

You don't need to worry about not understanding what I said in the last message. It was extreme tech-speak.

Offline LarsG5

  • Enthusiast Member
  • ***
  • Posts: 25
  • New Member
Re: Setting PowerBook G4 fan speed in open firmware
« Reply #23 on: November 21, 2020, 08:31:38 PM »
Yeah, not only it didn't work for me, but also bricked my iBook.
Thanks nonetheless.

I'll be back to my previous method granted I somehow unbrick my iBook...

Offline Daniel

  • Gold Member
  • *****
  • Posts: 300
  • Programmer, Hacker, Thinker
Re: Setting PowerBook G4 fan speed in open firmware
« Reply #24 on: November 21, 2020, 08:52:39 PM »
Yeah, not only it didn't work for me, but also bricked my iBook.
Thanks nonetheless.

I'll be back to my previous method granted I somehow unbrick my iBook...

Try holding down the power button for a very long time. On some devices OF will ignore the NVRAM and boot to a "recovery mode". Then you can clear the changes with reset-nvram.

iMic found out about it here. http://macos9lives.com/smforum/index.php?topic=2138.0

I think there's some article on it somewhere, but I can't find it.

Offline LarsG5

  • Enthusiast Member
  • ***
  • Posts: 25
  • New Member
Re: Setting PowerBook G4 fan speed in open firmware
« Reply #25 on: November 21, 2020, 09:03:12 PM »
I'll give it a try, thanks!

Offline ahihi

  • Active Member
  • *
  • Posts: 5
  • New Member
Re: Setting PowerBook G4 fan speed in open firmware
« Reply #26 on: December 20, 2023, 12:54:47 PM »
many thanks to everyone for all the good info in this thread!

i wanted a quick way to boot my OS9 partition with a specified fan speed, so i spent some quality time with OF and came up with the following...

firstly, i found out that the range of speeds accepted by the set-speeds method seems to be 0 to ff (OF defaults to hexadecimal, so that would be 0 to 255 in decimal). this is the case on my PowerBook6,7 (iBook G4 2005), dont know about others. larger numbers just wrap around to this range. it is worth noting that this is different from the numbers reported by .speed, which look like they might be RPMs.

with that in mind, i wrote this routine and added it to my nvramrc:

Code: [Select]
: fans9
dup 0 ff between if
    " set-speeds" " fan" open-dev dup >r $call-method r> close-dev
    " hd:\\,tbxi" boot
  else
    ." speed must be between 0 and ff"
    drop
  then
  ;

now, i can boot into OF and simply type

Code: [Select]
ff fans9

to boot from my OS9 partition with fans at full speed! or perhaps 80 fans9, for 50%-ish speed, etc.

note that this is hardcoded to boot hd:\\,tbxi, you may have to change that for your system. and as always, run at your own risk :)

Offline Greystash

  • Gold Member
  • *****
  • Posts: 225
  • Tinkerer
    • Mac-Classic.com
Re: Setting PowerBook G4 fan speed in open firmware
« Reply #27 on: December 28, 2023, 01:05:51 AM »
Thanks ahihi that's fantastic! Looking forward to trying this out  8)