Skip to content

Instantly share code, notes, and snippets.

@naruse
Created September 7, 2024 16:00
Show Gist options
  • Save naruse/2fc92eba078a9dc79229ad9aa8c101da to your computer and use it in GitHub Desktop.
Save naruse/2fc92eba078a9dc79229ad9aa8c101da to your computer and use it in GitHub Desktop.
Getting back my ibook G4 booting into OS9
[quote author=Doggoli link=topic=4021.msg27261#msg27261 date=1507384197]
After googling for a bit i found a script that modifies the nvram to work but that didnt help...Do any of you have some ideas?
Here is the script i tried:
#!/bin/sh
echo Enabling OS 9 booting...
echo "You may have to enter your password"
# Use nvram command to setup nvramrc with script to make open firmware changes
sudo nvram nvramrc='" /" select-dev
" PowerBook4,3" encode-string " model" property
" PowerBook4,3" encode-string " MacRISC" encode-string encode+ " MacRISC2" encode-string encode+ " MacRISC3" encode-string encode+ " Power Macintosh" encode-string encode+ " compatible" property
00000000 " graphic-options" get-my-property 2drop !
unselect
" /cpus/PowerPC,G4@0" find-package if drop " /cpus/PowerPC,G4@0" find-device 80010201 encode-int " cpu-version" property then
device-end \ PLX-OS9-PATCH
'
# Enable use of nvramrc on boot. Change to "false" if you want to disable again. Or just clear/reset nvram.
sudo nvram "use-nvramrc?"=true
echo done.
[/quote]
Hey Everyone, I wanted to add to this.
Recently I messed up my OS9 boot and my ibook wasnt booting. It took me a couple of weeks to figure out how to add this script on the nvram in open firmware, because I didnt have any access to any OS.
Here is what I did. [i](All of the commands I am going to post below are in Open Firmware)[/i]
In open firmware there is a variable called [b]nvramrc[/b], this var contains the contents (in open firmware language) of the script shared above. This is the script that patches your ibook G4 to make it bootable.
First thing to check is if you have the var set up in open firmware (if you dont, dont worry, I will explain how to adapt the bash script above to make it work) To do so type:
[b]printenv nvramrc[/b]
That should print you something like
[b]------- Partition: common ------ Signature 0x70 -------
nvramrc Defined: use NVEDIT related words to view
ok[/b]
if you see the "Defined: use NVEDIT...." that means that you have the nvramrc variable set and defined that's good!. if on the contrary you only see "ok" and nothing else you dont have the nvramrc var set up.
to set the var you type [b]nvedit[/b] and press enter
Now you type this line by line pressing enter at the end
[b]" /" select-dev
" PowerBook4,3" encode-string " model" property
" PowerBook4,3" encode-string " MacRISC" encode-string encode+ " MacRISC2" encode-string encode+ " MacRISC3" encode-string encode+ " Power Macintosh" encode-string encode+ " compatible" property
00000000 " graphic-options" get-my-property 2drop !
unselect
" /cpus/PowerPC,G4@0" find-package if drop " /cpus/PowerPC,G4@0" find-device 80010201 encode-int " cpu-version" property then
device-end \ PLX-OS9-PATCH[/b]
you can move with the arrows up/down across lines in case you made a mistake, after finished you type [b]Ctrl + c[/b] to get out of the editor back to Open firmware and then type [b]nvstore[/b] to save what you wrote into the contents of nvramrc.
Just to make sure that you have that var set up; type again [b]printenv nvramrc[/b] and check that you can see that is defined, even restart the machine and when you get back to Open firmware (OF) type [b]printenv nvramrc[/b] just to make sure that the var is there; and make sure the contents are correct with [b]nvedit[/b]
Subsequently; if everything is set up correctly; type [b]mac-boot[/b]
If you have issues, dont dispair, you got this!; I also tried [b]load nvramrc[/b] and helped myself out back and forth with chatgpt; so you can ask it the output you are getting in OF and it will help you; ChatGPT was quite quite helpful for me (along this page and several others) to get my mac OS 9 on my ibook G4 back and running.
Hopefully this will help someone who is in the same situation that I am and get you back to your OS9 booting again :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment