| Click here to select a new forum. |
| updated firmware for new world ppc32 macs that allows booting from usb from the boot picker |
I know that it's possible to boot from usb on a 32 bit ppc mac by entering a command into OpenFirmware but would it be possible to code a firmware patch/update that would show usb devices in the boot picker? (by boot picker I mean the menu that pops up when one holds the alt key on startup) Sorry if this is a dumb question.
Posted by: chiggen on 2024-10-06 19:10:23 |
Maybe. It depends on the version of Open Firmware. What versions do you have?
Here's a patch for Open Firmware 5.2.7f1 (Quad G5)
dev /packages/bootpath-search
: mypatch { ; loc0 loc1 loc2 loc3 loc4 } loc4 6 = if loc0 findandadd-block-usb then ;
' findandadd-block 3ac + ' mypatch c + brpatch
Just because a USB item appears in the boot menu, doesn't mean it will successfully boot. You may need to boot into verbose mode to diagnose problems.
You can dump the firmware using #20
An Open Firmware dictionary dump is useful for creating patches that patch compiled fcode. See #1
I've attached some notes.
Posted by: joevt on 2024-10-06 19:56:04 |
I believe that I have 4.2.8? I have a fw800 g4. I can't check right now but I will check later and tell you.
Posted by: chiggen on 2024-10-08 07:58:03 |
The fw800 G4's that I know about have 4.5.7f1 or 4.6.0f1. If you have something different then I would be interested in getting that.
4.2.8f1, 4.5.7f1, and 4.6.0f1 should all be able to boot USB.
Of the firmwares I have, the ones that support USB mass storage but don't scan for USB are built on or after 09/23/04.
09/23/04 4.8.7f1 iBook G4
03/23/05 4.8.9f4 Mac mini G4
07/12/05 4.9.4f1 Mac mini G4
09/22/05 4.9.5f3 PowerBook G4 DLSD
09/30/05 5.2.7f1 G5 Quad
Look at the notes in USB scan.of and try the debug options aapl,debug-bps and aapl,debug-mb
The following firmwares also have the aapl,debug-mbv option.
09/30/02 4.4.8f2
11/11/02 4.5.4f1
01/15/03 4.5.7f1
02/20/03 4.6.0f1
03/15/03 4.6.4f1
04/06/04 4.8.5f0
09/21/04 5.1.5f2
09/23/04 4.8.7f1
03/23/05 4.8.9f4
07/12/05 4.9.4f1
09/22/05 4.9.5f3
09/30/05 5.2.7f1
For the boot option, we are talking strictly Mac OS X or OS 9 tbxi, correct? Linux is a different matter and would require new scanning code (like what rEFIt or rEFInd or RefindPlus or Clover or OpenCore do)
Posted by: joevt on 2024-10-08 17:11:06 |
For the boot option, I would like to get linux working if that's possible. About the firmware, I probably just read it wrong
Posted by: chiggen on 2024-10-08 19:44:49 |
attatched is the dumped firmware:
Posted by: chiggen on 2024-10-08 20:05:49 |
For the boot option, I would like to get linux working if that's possible. About the firmware, I probably just read it wrong What's the boot command for Linux?
Posted by: joevt on 2024-10-08 21:00:31 |
I think I found a command that should work for any operating system:
probe-usb boot usb<port ID>/disk:<partition number>,\\:tbxi
I found it here: https://forums.macrumors.com/threads/guide-new-method-booting-from-usb-on-powerpc-macs.2403368/
Posted by: chiggen on 2024-10-09 09:22:16 |
I think I found a command that should work for any operating system:
probe-usb boot usb<port ID>/disk:<partition number>,\\:tbxi
I found it here: https://forums.macrumors.com/threads/guide-new-method-booting-from-usb-on-powerpc-macs.2403368/ Does that command work for you to boot Linux?
The boot path search code searches for \\:tbxi already. So there must be a reason why it's not showing the one from the Linux boot partition in the multi-boot GUI.
In Open Firmware, what is the output of this command?
dir usb<port ID>/disk:<partition number>,\
In Open Firmware, what is the output of multi-boot-menu after using setenv commands to set the debug options?
I don't think you need to probe-usb if the disk is connected before you boot. My Quad G5 hangs if I do multi-boot after probe-usb.
In OS X, what is the output of
diskutil list
In OS X, what is the output of
pdisk /dev/diskX where diskx is the disk containing your linux partition?
In OS X, what is the output of
bless -info /Volumes/linuxvolumename
Run the script from https://gist.github.com/joevt/a99e3af71343d8242e0078ab4af39b6c#file-dumpvols-sh-L719 and attach the output.
Here's some pictures from my Quad G5 (with the scan USB patch). The first is with aapl,debug-mb (shows USB location text) and the second is without (shows USB icon).


Posted by: joevt on 2024-10-09 20:43:27 |
4.2.8f1, 4.5.7f1, and 4.6.0f1 should all be able to boot USB.
Of the firmwares I have, the ones that support USB mass storage but don't scan for USB are built on or after 09/23/04.
09/23/04 4.8.7f1 iBook G4
03/23/05 4.8.9f4 Mac mini G4
07/12/05 4.9.4f1 Mac mini G4
09/22/05 4.9.5f3 PowerBook G4 DLSD
09/30/05 5.2.7f1 G5 Quad Huh....so 4.2.8f1, 4.5.7f1, and 4.6.0f1 do scan for USB at boot and present it in the picker? I swear I just read another thread where people were saying they saw USB in the picker on pre Mac mini, but maybe I'm imagining things.
Posted by: eharmon on 2024-10-09 21:12:36 |
Huh....so 4.2.8f1, 4.5.7f1, and 4.6.0f1 do scan for USB at boot and present it in the picker? I swear I just read another thread where people were saying they saw USB in the picker on pre Mac mini, but maybe I'm imagining things.
- 08/19/99 1.2f2 : The latest ROM that I have that can't boot USB is from a Yikes G4. The
bootpath-search package is similar to later versions but doesn't include code for USB and FireWire.
- 06/13/00 3.0f3 : The first ROM that I don't have that is known to boot USB is from a iMac DV+.
- 03/20/01 4.1.7f4 : The earliest ROM I have that can boot USB is from an iBook G3.
The bootpath-search package hasn't changed much since this version.
- 09/23/04 4.8.7f1 : The first ROM I have that can boot USB but doesn't include USB in the boot menu because a couple lines of code were removed which my patch restores.
For firmwares for 64-bit Macs (5.x.x), compare the dates to see what range from the above it belongs to.
Posted by: joevt on 2024-10-10 06:11:21 |
06/13/00 3.0f3 : The first ROM that I don't have that is known to boot USB is from a iMac DV+. My contributions earlier were based on an iMac DV/400, which I think predates the iMac DV+. The firmware was updated though.
Posted by: Snial on 2024-10-10 08:25:47 |
I think I found a command that should work for any operating system:
probe-usb boot usb<port ID>/disk:<partition number>,\\:tbxi
I found it here: https://forums.macrumors.com/threads/guide-new-method-booting-from-usb-on-powerpc-macs.2403368/ Not all linux in stalls use a :tbxi as the boot loader.
Most of the later ones use an EFL binary( grub.elf ).
Posted by: DarthNvader on 2024-10-10 09:07:59 |
Not all linux in stalls use a :tbxi as the boot loader.
Most of the later ones use an EFL binary( grub.elf ). Also I have had issues with some USB sticks not being bootable on PPC Macs at all. I've never figured out the rhyme or reasons of it.
Posted by: DarthNvader on 2024-10-10 09:10:23 |
I wish I could make heads or tails of Forth yet...but...
Trying this out for a mini, PowerMac10,1. Doesn't crash but doesn't seem to probe USB at all with the G5 patch. How did you discover the patch values, basically detoking the firmware?
I imagine the procedure is to dump the firmware, detok, and from that determine how to inject findandadd-block-usb again?
Along the way, learning how to understand Forth I suppose...
Posted by: eharmon on 2024-10-11 18:19:43 |
I wish I could make heads or tails of Forth yet...but...
Trying this out for a mini, PowerMac10,1. Doesn't crash but doesn't seem to probe USB at all with the G5 patch. How did you discover the patch values, basically detoking the firmware?
I imagine the procedure is to dump the firmware, detok, and from that determine how to inject findandadd-block-usb again?
Along the way, learning how to understand Forth I suppose... What firmware version does your Mac Mini have? You can dump the ROM using the info at #2
My DumpMacRom.sh script disassembles the Open Firmware assembly part of ROM, and it detokenizes and converts to Forth the fcode parts of ROM.
For making patches, you usually patch the assembled Forth words, rather than the originating fcode. So for this I dump the entire Open Firmware dictionary where the assembled forth words exist in RAM and use DumpMacRom.sh to disassemble that.
There's notes at
https://forums.macrumors.com/thread...l-work-in-a-beige-power-macintosh-g3.2303689/
Open Firmware documentation exists at
https://openfirmware.info/Welcome_to_OpenBIOS
https://openfirmware.info/IEEE_1275-1994 <-- get this one
https://openfirmware.info/Bindings <-- get these if you're working with a particular device type
https://openfirmware.info/On_the_Net
Posted by: joevt on 2024-10-11 23:17:34 |
What firmware version does your Mac Mini have? You can dump the ROM using the info at #2
My DumpMacRom.sh script disassembles the Open Firmware assembly part of ROM, and it detokenizes and converts to Forth the fcode parts of ROM.
For making patches, you usually patch the assembled Forth words, rather than the originating fcode. So for this I dump the entire Open Firmware dictionary where the assembled forth words exist in RAM and use DumpMacRom.sh to disassemble that.
There's notes at
https://forums.macrumors.com/thread...l-work-in-a-beige-power-macintosh-g3.2303689/
Open Firmware documentation exists at
https://openfirmware.info/Welcome_to_OpenBIOS
https://openfirmware.info/IEEE_1275-1994 <-- get this one
https://openfirmware.info/Bindings <-- get these if you're working with a particular device type
https://openfirmware.info/On_the_Net 4.8.9f4 - 03/23/05
I'll give those a try, thanks for the details!
Posted by: eharmon on 2024-10-13 14:28:50 |
[double post]
Posted by: eharmon on 2024-10-13 15:13:02 |
findandadd-block appears to be the same in 4.8.9f4 (Mac mini G4) and 5.2.7f1 (Quad G5).
I suppose we might need to look at the assembly code to make sure they compile the same.
This is how my DumpMacRom.sh script converts fcode to Forth:
Spoiler content hidden.
This is how Open Firmware's see command converts compiled fcode into mostly Forth:
Spoiler content hidden.
Open Firmware's xsee command can show how each fcode word is compiled:
Spoiler content hidden.
My DumpMacRom.sh can disassemble that same compiled fcode:
Spoiler content hidden.
The patch changes the b exit (which is compiled from the ; fcode) at findandadd-block + 0x3ac into a branch that jumps to mypatch + 0xc which is just after mypatch sets up the locals because we want to use the locals that were setup by findandadd-block.
0 > : mypatch { ; loc0 loc1 loc2 loc3 loc4 } loc4 6 = if loc0 findandadd-block-usb then ; ok
0 > xsee mypatch
ffa3b9e8: 967efffc
ffa3b9ec: 7e6802a6
ffa3b9f0: 4be0b859 {0} \ {0} means don't pop any parameters from the stack - doesn't matter because the patch skips this
ffa3b9f4: 4be0b8f5 {4@} \ branch from findandadd-block goes to here; we want to examine the fifth local variable
ffa3b9f8: 4be11cb9 6
ffa3b9fc: 4be0e1f5 =
ffa3ba00: 4be0b629 (b?branch)
ffa3ba04: 4800000c
ffa3ba08: 4be0b8a1 {0@}
ffa3ba0c: 4bf0b1bd findandadd-block-usb
ffa3ba10: 4be0aa90 \ this exit takes the place of the exit that we patched in findandadd-block
Posted by: joevt on 2024-10-13 23:53:15 |
findandadd-block appears to be the same in 4.8.9f4 (Mac mini G4) and 5.2.7f1 (Quad G5).
I suppose we might need to look at the assembly code to make sure they compile the same. Joe, do we have a list of what Macs can find USB disk and boot from them without patching and which ones can't?
I remember I had a 400MHz DV iMac with a dead HD, and I put in a USB stick with an APM and OS 9 installed and I was able to just let the Mac boot and find that from the "?" icon. I took awhile but it eventually found the only bootable disk, the USB stick.
I can't seem to get my 1.6GHz original G5 to boot from a USB stick at all, even when I provide the absolute path to the boot file in OF.
Could just be the brand of USB stick I'm using.
I'll have to dig all my PPC stuff out and set it all up again. So many projects and so little motivation from me lately.
Posted by: DarthNvader on 2024-10-14 03:56:47 |