• Hello MLAers! We've re-enabled auto-approval for accounts. If you are still waiting on account approval, please check this thread for more information.

updated firmware for new world ppc32 macs that allows booting from usb from the boot picker

Oh right. The tbxi of the New World Mac OS ROM file does Open Firmware stuff before Mac OS boots.

tbxi dump extracts a boot script which I guess you can edit. Then tbxi build should take the edited boot script, fix up the offsets and checksum and include it in the new ROM. I haven't tried it before.

However, the USB boot patch part of the nvramrc script is not appropriate for the tbxi boot script because tbxi happens after a boot device is selected.
Would it be persistent if the patched TBXI set up nvramrc and then the system rebooted?
 
I suppose that would work. Not as fun as being able to make your own ROM though.
Definitely. I'm watching the thread(s) on that one, as building up your own firmware definitely provides lots of options... way beyond what I've got time to work on myself though, and I might be able to make time to do something with the TBXI -- didn't want to start on it if others already knew of a reason it would be long and convoluted though.
 
Some minor changes:
  • Translate LF to CR so the script is more easily editable in Open Firmware.
  • Use a heredoc for multi-line nvram variables like nvramrc to make the script easier to read.
  • unselect isn't a word until Open Firmware 3.1.0 (the first New World Mac Open Firmware?) which is ok for this code but for consistency, I would just use device-end (like is done later in the script). device-end is defined in the Open Firmware spec but unselect is not.
  • For consistency, use dev instead of select-dev (like is done later in the script). The nvramrc script is interpreted Forth code so it can use words like dev that take arguments from the command line instead of the stack. Also, dev is shorter and select-dev is an obsolete Open Firmware word.

Code:
sudo nvram nvramrc="$(tr '\n' '\r' << DONE
dev /
" PowerMac10,1" encode-string " model" property
" PowerMac10,1" encode-string
" MacRISC" encode-string encode+
" MacRISC2" encode-string encode+
" MacRISC3" encode-string encode+
" Power Macintosh" encode-string encode+
" compatible" property
device-end

dev /packages/bootpath-search
: mypatch { ; loc0 loc1 loc2 loc3 loc4 } loc4 6 = if loc0 findandadd-block-usb then ;
' findandadd-block 3ac + ' mypatch c + brpatch
device-end
DONE
)"

sudo nvram "use-nvramrc?"=true

# fcode-debug is required for the USB patch to work
sudo nvram "fcode-debug?"=true

# Disable netboot for faster boot picker
sudo nvram "skip-netboot?"=true

# Display OS X versions in boot picker
sudo nvram aapl,debug-mbv=true

echo "Done."

For those without or avoiding OS X, is there a way to, say, save this to a text file as Forth script, give it a Forth-related TYPE code, put the file in the root of, say, a Mac OS 9 partition, then from OF invoke the file/script?
 
For those without or avoiding OS X, is there a way to, say, save this to a text file as Forth script, give it a Forth-related TYPE code, put the file in the root of, say, a Mac OS 9 partition, then from OF invoke the file/script?
Try the attached file.

Copy it to the root folder of the Mac OS 9 partition. Get the partition number of the Mac OS 9 partition using pdisk or whatever. In my case, it is partition 10 (decimal).
Code:
Partition Map contents (18 partitions)
 1:         63 @ 1          Type:"Apple_partition_map" Name:"Apple" Status:00000003=Valid,Allocated
 2:         56 @ 64         Type:"Apple_Driver43" Name:"Macintosh" Status:00000103=Valid,Allocated,ChainCompatible BootSize:11286 BootCksum:0x0000F1F0 Processor:"68000" Pad:70744452 = 'ptDR' = kPatchDriverSignature
 3:         56 @ 120        Type:"Apple_Driver43" Name:"Macintosh" Status:00000303=Valid,Allocated,ChainCompatible,RealDeviceDriver BootSize:18142 BootCksum:0x0000040F Processor:"68000" Pad:00010600 = kSCSIDriverSignature
 4:         56 @ 176        Type:"Apple_Driver_ATA" Name:"Macintosh" Status:00000103=Valid,Allocated,ChainCompatible BootSize:10490 BootCksum:0x00007EB4 Processor:"68000" Pad:70744452 = 'ptDR' = kPatchDriverSignature
 5:         56 @ 232        Type:"Apple_Driver_ATA" Name:"Macintosh" Status:00000303=Valid,Allocated,ChainCompatible,RealDeviceDriver BootSize:17254 BootCksum:0x00003417 Processor:"68000" Pad:77696b69 = 'wiki' = kATADriverSignature
 6:        512 @ 288        Type:"Apple_FWDriver" Name:"Macintosh" Status:00000003=Valid,Allocated
 7:        512 @ 800        Type:"Apple_Driver_IOKit" Name:"Macintosh" Status:00000003=Valid,Allocated
 8:        512 @ 1312       Type:"Apple_Patches" Name:"Patch Partition" Status:00000003=Valid,Allocated
 9:   20971520 @ 1824       Type:"Apple_HFS" Name:"Big Clone2" Status:40000031=Valid,Readable,Writeable,MountedAtStartup
10:   12582912 @ 20973344   Type:"Apple_HFS" Name:"MacOS9 Clone2" Status:40000031=Valid,Readable,Writeable,MountedAtStartup
...

Boot into Open Firmware.

Use devalias to list the device aliases. Find the one for your hard drive. On my B&W G3, it is hd:
Code:
0 > devalias 
hd                  /pci/@d/pci-ata@1/ata-4@0/disk@0
 ok

Use the dir command to view the list of files on the partition. The partition number (in decimal) 10 follows the device path after a colon :. The file system path follows the partition number after a comma ,. \ is the path for the root folder of the partition.
Code:
0 > dir hd:10,\ 
   1090 12/ 5/25 23:51:44  MacMiniG4_nvram.of
        12/ 9/24  7: 4:23  System%20Folder
        12/ 9/24 11:53:18  %00%00%00%00HFS+%20Private%20Data ok

Use the load command to load the Open Firmware script to load-base:
Code:
load hd:10,\MacMiniG4_nvram.of
 load-size=442 adler32=db4e6bde 
 ok

Use the go command to execute the loaded script:
Code:
0 > go 
evaluating Forth source

Done.

Use the printenv command to check the nvram variables:
Code:
0 > printenv 
-------------- Partition: common -------- Signature: 0x70 ---------------
fcode-debug?            true                 false
use-nvramrc?            true                 false
nvramrc                 Defined : use NVEDIT related words to view 
skip-netboot?           74727565
aapl,debug-mbv          74727565
 ok

Here's a script to view the nvramrc script correctly (I could have added this to the file):
Code:
: mytype ( prev start len -- )
	cr
	bounds ?do
		i c@ dup d = if
			dup emit a emit
		else
			dup a = if
				over d <> if
					d emit dup emit
				then
			else
				dup emit
			then
		then
		swap drop
	loop drop cr
	;

: .nvramrc
	0 nvramrc mytype ;

Using the new .nvramrc command should look like this:
Code:
0 > .nvramrc 
dev
" PowerMac10,1" encode-string " model" property
" PowerMac10,1" encode-string
" MacRISC" encode-string encode+
" MacRISC2" encode-string encode+
" MacRISC3" encode-string encode+
" Power Macintosh" encode-string encode+
" compatible" property
device-end

dev /packages/bootpath-search
: mypatch { ; loc0 loc1 loc2 loc3 loc4 } loc4 6 = if loc0 findandadd-block-usb then ;
' findandadd-block 3ac + ' mypatch c + brpatch
device-end

 ok

Restart the computer using the reset-all command.
 

Attachments

Try the attached file.

Copy it to the root folder of the Mac OS 9 partition. Get the partition number of the Mac OS 9 partition using pdisk or whatever. In my case, it is partition 10 (decimal).
Code:
Partition Map contents (18 partitions)
 1:         63 @ 1          Type:"Apple_partition_map" Name:"Apple" Status:00000003=Valid,Allocated
 2:         56 @ 64         Type:"Apple_Driver43" Name:"Macintosh" Status:00000103=Valid,Allocated,ChainCompatible BootSize:11286 BootCksum:0x0000F1F0 Processor:"68000" Pad:70744452 = 'ptDR' = kPatchDriverSignature
 3:         56 @ 120        Type:"Apple_Driver43" Name:"Macintosh" Status:00000303=Valid,Allocated,ChainCompatible,RealDeviceDriver BootSize:18142 BootCksum:0x0000040F Processor:"68000" Pad:00010600 = kSCSIDriverSignature
 4:         56 @ 176        Type:"Apple_Driver_ATA" Name:"Macintosh" Status:00000103=Valid,Allocated,ChainCompatible BootSize:10490 BootCksum:0x00007EB4 Processor:"68000" Pad:70744452 = 'ptDR' = kPatchDriverSignature
 5:         56 @ 232        Type:"Apple_Driver_ATA" Name:"Macintosh" Status:00000303=Valid,Allocated,ChainCompatible,RealDeviceDriver BootSize:17254 BootCksum:0x00003417 Processor:"68000" Pad:77696b69 = 'wiki' = kATADriverSignature
 6:        512 @ 288        Type:"Apple_FWDriver" Name:"Macintosh" Status:00000003=Valid,Allocated
 7:        512 @ 800        Type:"Apple_Driver_IOKit" Name:"Macintosh" Status:00000003=Valid,Allocated
 8:        512 @ 1312       Type:"Apple_Patches" Name:"Patch Partition" Status:00000003=Valid,Allocated
 9:   20971520 @ 1824       Type:"Apple_HFS" Name:"Big Clone2" Status:40000031=Valid,Readable,Writeable,MountedAtStartup
10:   12582912 @ 20973344   Type:"Apple_HFS" Name:"MacOS9 Clone2" Status:40000031=Valid,Readable,Writeable,MountedAtStartup
...

Boot into Open Firmware.

Use devalias to list the device aliases. Find the one for your hard drive. On my B&W G3, it is hd:
Code:
0 > devalias
hd                  /pci/@d/pci-ata@1/ata-4@0/disk@0
 ok

Use the dir command to view the list of files on the partition. The partition number (in decimal) 10 follows the device path after a colon :. The file system path follows the partition number after a comma ,. \ is the path for the root folder of the partition.
Code:
0 > dir hd:10,\
   1090 12/ 5/25 23:51:44  MacMiniG4_nvram.of
        12/ 9/24  7: 4:23  System%20Folder
        12/ 9/24 11:53:18  %00%00%00%00HFS+%20Private%20Data ok

Use the load command to load the Open Firmware script to load-base:
Code:
load hd:10,\MacMiniG4_nvram.of
 load-size=442 adler32=db4e6bde
 ok

Use the go command to execute the loaded script:
Code:
0 > go
evaluating Forth source

Done.

Use the printenv command to check the nvram variables:
Code:
0 > printenv
-------------- Partition: common -------- Signature: 0x70 ---------------
fcode-debug?            true                 false
use-nvramrc?            true                 false
nvramrc                 Defined : use NVEDIT related words to view
skip-netboot?           74727565
aapl,debug-mbv          74727565
 ok

Here's a script to view the nvramrc script correctly (I could have added this to the file):
Code:
: mytype ( prev start len -- )
    cr
    bounds ?do
        i c@ dup d = if
            dup emit a emit
        else
            dup a = if
                over d <> if
                    d emit dup emit
                then
            else
                dup emit
            then
        then
        swap drop
    loop drop cr
    ;

: .nvramrc
    0 nvramrc mytype ;

Using the new .nvramrc command should look like this:
Code:
0 > .nvramrc
dev
" PowerMac10,1" encode-string " model" property
" PowerMac10,1" encode-string
" MacRISC" encode-string encode+
" MacRISC2" encode-string encode+
" MacRISC3" encode-string encode+
" Power Macintosh" encode-string encode+
" compatible" property
device-end

dev /packages/bootpath-search
: mypatch { ; loc0 loc1 loc2 loc3 loc4 } loc4 6 = if loc0 findandadd-block-usb then ;
' findandadd-block 3ac + ' mypatch c + brpatch
device-end

 ok

Restart the computer using the reset-all command.

Thank you! I will give this a try later today!
 
Well, I tried it, everything went according to the script, in that printenv reveals that fcode-debug?, use-nvramrc? etc. were set to true and all else is configured as per the script...

... But I don't see my blessed System 7.5.5 folder in either of my two partitions from my USB stick from the boot picker.

For the record, both partititions are formatted with HFS Standard and are perfectly usable on Mac OS 9. The drive should also be formatted as APM as far as I know. I also rebooted with reset-all, and then again from the GUI in Mac OS 9, but the boot picker still won't show it.

Any ideas? I'm using the 1.5 GHz version of the mini, which has different firmware compared to the earlier 1.42 GHz and 1.25 GHz releases (and a more recent version of Open Firmware than theirs, as such).
 
Well, I tried it, everything went according to the script, in that printenv reveals that fcode-debug?, use-nvramrc? etc. were set to true and all else is configured as per the script...

... But I don't see my blessed System 7.5.5 folder in either of my two partitions from my USB stick from the boot picker.

For the record, both partititions are formatted with HFS Standard and are perfectly usable on Mac OS 9. The drive should also be formatted as APM as far as I know. I also rebooted with reset-all, and then again from the GUI in Mac OS 9, but the boot picker still won't show it.

Any ideas? I'm using the 1.5 GHz version of the mini, which has different firmware from the the earlier 1.42 GHz and 1.25 GHz releases (and a more recent version of Open Firmware than theirs, as such).
My own 1.5GHz G4 Mini experience has been different from yours, but I think I've figured out why: it's to do with the drive partitioning.
For the USB boot, the boot manager only ever picks up the first partition on the USB device for me. So if that's not the one you're trying to select, that may be the problem. However, I've also found that even some partitions on the internal drive don't get picked up, and that appears to do with how APM has got them set up -- I even get different volume labels when booted from OS X 10.5 and from System 7.5. And... what's available in the boot screen seems directly related to what was visible in the Startup Items control panel the last time it opened. If I set things up and then fail to open the Startup Items control panel, the new blessed volumes might not be present in the boot picker, or might be present but without a label -- and they might actually boot, or they might not.
 
My own 1.5GHz G4 Mini experience has been different from yours, but I think I've figured out why: it's to do with the drive partitioning.
For the USB boot, the boot manager only ever picks up the first partition on the USB device for me. So if that's not the one you're trying to select, that may be the problem. However, I've also found that even some partitions on the internal drive don't get picked up, and that appears to do with how APM has got them set up -- I even get different volume labels when booted from OS X 10.5 and from System 7.5. And... what's available in the boot screen seems directly related to what was visible in the Startup Items control panel the last time it opened. If I set things up and then fail to open the Startup Items control panel, the new blessed volumes might not be present in the boot picker, or might be present but without a label -- and they might actually boot, or they might not.

Yeah, I made sure both of my partitions had each System 7.5.5 for that reason. So my issue is a bit different, still.

But that reminded me I forgot to mention one more thing: The mini has 2 USB slots. I use the slot that is next to the FireWire 400 port. Could it be this script will only work with the other port? I will give it a quick try...

In any case, it's good to know the mini model isn't the cause.

EDIT: Nope, same symptoms. Maybe it depends on what formatted the USB? I used LaCie Silverlining Pro 6.5.9.1 on Mac OS 9.2.2. Maybe I ought to try 10.4.11 Tiger (non-Server) with Disk Utility next, which I have on my "paperweight-awaiting-for-Mac-OS-compatibility" DLSD.
 
Last edited:
It definitely has to be formatted with OS 9 drivers, at least.You'll see 10 or so partitions on the disk if so.

That said, it's possible the later mini needs a different patch. But I doubt it, since the G5s are the same.
 
Well, I tried it, everything went according to the script, in that printenv reveals that fcode-debug?, use-nvramrc? etc. were set to true and all else is configured as per the script...

... But I don't see my blessed System 7.5.5 folder in either of my two partitions from my USB stick from the boot picker.

For the record, both partititions are formatted with HFS Standard and are perfectly usable on Mac OS 9. The drive should also be formatted as APM as far as I know. I also rebooted with reset-all, and then again from the GUI in Mac OS 9, but the boot picker still won't show it.

Any ideas? I'm using the 1.5 GHz version of the mini, which has different firmware compared to the earlier 1.42 GHz and 1.25 GHz releases (and a more recent version of Open Firmware than theirs, as such).

Connect to the Mac mini G4 in Open Firmware using telnet.
https://forums.macrumors.com/thread...l-work-in-a-beige-power-macintosh-g3.2303689/

Gather info about the Mac mini G4 using this command:
dev / ls unselect-dev " devalias" evaluate " printenv" evaluate dump-device-tree words

Capture the output of the multi-boot-menu command with debugging enabled.
Code:
\ enable debugging of bootpath-search
setenv aapl,debug-bps
\ enable debugging of multi-boot
setenv aapl,debug-mb
\ disable debugging of multi-boot
\ delenv aapl,debug-mb
\ enable show version in boot menu GUI (since 4.4.5b8)
setenv aapl,debug-mbv

\ skip scan of ethernet stuff since that will conflict with telnet
\ This example is from a Quad G5:
dev /aliases
" /ht@0,f2000000/pci@2/bcom5714@4"
encode-string
" /ht@0,f2000000/pci@2/bcom5714@4,1"
encode-string+
" no-boot" property

\ use the multi-boot text menu instead of the multi-boot GUI
dev /multiboot
multi-boot-menu

Try my dumpvols.sh script in Mac OS X to gather more info about the partitioning. Maybe we can see a pattern.
https://gist.github.com/joevt/a99e3af71343d8242e0078ab4af39b6c
 
it's possible the later mini needs a different patch. But I doubt it, since the G5s are the same.
Has anyone actually tried booting System 7 on a G5?!?!

I would think that the architecture of the G5 is different enough that nothing before Mac OS X will work?

c
 
I was finally able to boot System 7 on the 1.5 GHz mini from USB via the GUI bootpicker. These patches are awesome! Thank you for providing them.

Unfortunately, I couldn't get it to work directly from OF alone. This is what I tried and how I was able to get the mini to boot:

- I changed the script from "PowerMac10,1" to "PowerMac10,2", because that's what the "silent upgrade" minis like the 1.5 GHz and 1.33 GHz models are. This might be why the patches failed for me originally. However, just changing that reference and reinvoking the script from OF was not enough to change the outcome. Perhaps it would if I had also reset my NVRAM? Thing is, I currently have precious data in my NVRAM, which I must dump first, and learn to restore from said dump, before I re-attempt this from OF from a clean slate.

(How do I dump and restore my NVRAM based on an NVRAM dump, anyway? Any OF commands? Mac OS 9 commands? OS X commands? And is there a way I can manually view/edit/add/delete NVRAM variables as well as variable values?)

- I just used the OS X script (with the PowerMac10,x model identifier adjustments), and then it just worked. That's the route I wish to avoid having to rely on, though, but it does work, at least after the adjustment I mentioned.

For the record, once I got it working, both of my HFS Standard partitions could be identified in the GUI bootpicker, AND be booted from, for System 7 or otherwise. Just throwing that out there.

Also for the record, before I realized what was needed for the fix, I reformatted my USB with OS X's Disk Utility (10.4.11 "Client" Tiger PPC), and it was no different than when I used LaCie Silverlining Pro 6.5.9.1 on Mac OS 9 (which I confirmed to have successfully formatted my USB drive with APM, by the way, meaning we don't need OS X for USB formatting at all with this tool).

Again just for the record, and what even led me to realize the model identifier was wrong, I successfully connected to my mini's OF via telnet as per @joevt's detailed instructions, using the built-in client on Windows 7 SP1 (would have used a Mac OS 9 client here too on a different machine, if only I could source another Mac-OS-capable computer, but where I live such privileges do not exist). I'm glad to have learned about both telnet, running a telnet server in OF, and using telnet (and SSH) clients from my preferred OSes (Mac OS 9 in particular). Thanks for setting up that path of learning for me, @joevt! This should come in handy in the future.
 
Dumping the entire 8K of NVRAM is overkill. Setting the entire 8K is probably dangerous.

In Mac OS X, use the nvram command to view, change, or create nvram variables.
In Open Firmware, use printenv and setenv.

For the nvramrc variable, use nvedit, arrow keys to move up/down lines, additional control keys do other kinds of editing such as insert or remove lines, Control-C to exit. nvstore to save.

The MacMiniG4_nvram.of script at
https://68kmla.org/bb/index.php?thr...om-usb-from-the-boot-picker.48601/post-576979
uses setenv for some nvram variables but uses " nvramrc" $setenv to change nvramrc. $setenv requires the address and length of the nvramrc script on the stack. Since the nvramrc script is longer than the Open Firmware line input buffer size, the string has to be built up in pieces like this:
Code:
: e+ encode-bytes encode+ " "(0D)" encode-bytes encode+ ;
" " encode-bytes " "
e+ " dev /"
e+ " "" PowerMac10,1"" encode-string "" model"" property"
e+ " "" PowerMac10,1"" encode-string"
e+ " "" MacRISC"" encode-string encode+"
e+ " "" MacRISC2"" encode-string encode+"
e+ " "" MacRISC3"" encode-string encode+"
e+ " "" Power Macintosh"" encode-string encode+"
e+ " "" compatible"" property"
e+ " device-end"
e+ " "
e+ " dev /packages/bootpath-search"
e+ " : mypatch { ; loc0 loc1 loc2 loc3 loc4 } loc4 6 = if loc0 findandadd-block-usb then ;"
e+ " ' findandadd-block 3ac + ' mypatch c + brpatch"
e+ " device-end"
e+ " nvramrc" $setenv

Note that my MacMiniG4_nvram.of script is missing a / on the first line of the nvramrc script. I've attached an updated version.

Does changing the startup disk between different OS versions only change nvram/pram (pram is part of the nvram variables listed by printenv) or does it change info in the partition map? Multiple system folders on the same disk are handled by modifying the blessed System Folder in the HFS header.

My DumpNameRegistry app for classic macOS (not for classic in Mac OS X) can dump the Name Registry and NVRAM.
https://68kmla.org/bb/index.php?threads/skipping-the-startup-memory-test.50699/post-570896

My DumpVols.sh script can dump partition info and boot block info and blessed info for all partitions.
https://68kmla.org/bb/index.php?thr...om-usb-from-the-boot-picker.48601/post-577228

But they are not convenient if you need to be in a particular OS to use them! I suppose you could boot into FireWire target disk mode and have a different Mac use DumpVols.sh to check the disk. Or an Open Firmware script could be created to dump blocks of interest from the disk - same for contents of nvram...
 

Attachments

Back
Top