Author Topic: Mac OS 9 booting on: Mac mini G4 (Detailed Posts)  (Read 537795 times)

Offline darthnVader

  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Re: Booting Mac Os 9 on Mac Mini.
« Reply #240 on: February 28, 2018, 03:26:42 AM »
Do us a favour and try this one?

A lot cleaner, but system bombs out after long spinning wheel, just after Ethernet loads.

Same as an unpatched  PowerBook6,8.

Does the Rom require the Boot 3 resource in the System Suitcase?

Offline RossDarker

  • Gold Member
  • *****
  • Posts: 281
Re: Booting Mac Os 9 on Mac Mini.
« Reply #241 on: February 28, 2018, 04:00:14 AM »
Ok so I just reset the NVRAM with cmd+alt+n+v and now this address error has gone for ever. I can use these new roms.

Offline ELN

  • Gold Member
  • *****
  • Posts: 295
  • new to the forums
Re: Booting Mac Os 9 on Mac Mini.
« Reply #242 on: February 28, 2018, 04:16:58 AM »
Yes, it still requires the patched boot 3. It’d be good to dive further into the Component Manager loafing code and see just why the boot 3 change is required.

Offline darthnVader

  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Re: Booting Mac Os 9 on Mac Mini.
« Reply #243 on: February 28, 2018, 05:00:07 AM »
Yes, it still requires the patched boot 3. It’d be good to dive further into the Component Manager loafing code and see just why the boot 3 change is required.

I gave it a go with boot 3, but system hangs, I think it's loading the QuickDraw3D driver.

Booting with the shift key results in an Address Error.

I'll try with less extensions later, got to do some real world stuff for a few days.

Offline MacOS Plus

  • Gold Member
  • *****
  • Posts: 418
  • The 9serve Lives!
Re: Booting Mac Os 9 on Mac Mini.
« Reply #244 on: February 28, 2018, 07:07:01 AM »
  I haven't been doing this boot 3 patch at all and yet have a working system.  I have no idea why it works for me.

Offline ELN

  • Gold Member
  • *****
  • Posts: 295
  • new to the forums
Re: Booting Mac Os 9 on Mac Mini.
« Reply #245 on: February 28, 2018, 08:01:41 AM »
Me neither! Does the new ROM work for you?

Offline RossDarker

  • Gold Member
  • *****
  • Posts: 281
Re: Booting Mac Os 9 on Mac Mini.
« Reply #246 on: February 28, 2018, 08:25:10 AM »
Me neither! Does the new ROM work for you?
Works for me if I reset PRAM, then NVRAM, then restart then it boots but certain extensions prevent it. By the way I am using a system suitcase with the boot 3 in from a previous rom.

Offline MacOS Plus

  • Gold Member
  • *****
  • Posts: 418
  • The 9serve Lives!
Re: Booting Mac Os 9 on Mac Mini.
« Reply #247 on: February 28, 2018, 08:32:49 AM »
Me neither! Does the new ROM work for you?

  It hangs with pinwheel shortly after Open Transport extension loads and the progress bar hops a bit forward.  It eventually switches the pinwheel to a bomb.  I tried booting with no extensions except darthnVader's new ATI stuff, tried with no control panels, same result.

  I'll be back this evening to look at it further.

Offline Daniel

  • Gold Member
  • *****
  • Posts: 300
  • Programmer, Hacker, Thinker
Re: Booting Mac Os 9 on Mac Mini.
« Reply #248 on: February 28, 2018, 05:54:11 PM »
According to wikipedia there are several varients of the G4 Mini. The differences seem mostly superficial, but I note that the max VRAM differs from model to model. I have no clue what else it could be.

Offline ELN

  • Gold Member
  • *****
  • Posts: 295
  • new to the forums
Re: Booting Mac Os 9 on Mac Mini.
« Reply #249 on: March 02, 2018, 09:50:46 PM »
Progress!

As we all know, a stock copy of Mac OS 9, when run on the Mac mini, will freeze early in the boot process. By inspecting and editing the 68k ROM code in StartInit.a, I isolated this crash to the Power Manager initialisation code. By inspecting and editing the PowerPC code in the NativePowerMgrLib parcel, I further isolated it to the PMInitialize function, in particular the part that calls code in a "PMU plugin" parcel. (PMU = "Power Management Unit".) I assumed at this point that the mini had a PMU for which no Mac OS 9 plugin had been written. To get the machine booting, I made a tiny change to the NativePowerMgrLib to make it ignore the PMU.

Mac OS 9 does not like going without a working PMU! To work around this, patches are required to the Component Manager init code and to the USB family expert, and many system extensions must be removed. This is an inelegant hack and as some of you have noticed, results in a very unstable system.

Luckily, it turns out that I was wrong about the PMU in the Mac mini. Its Open Firmware properties describe it as a 9-compatible "PMU-99". In fact, the Trampoline bootloader notices this and loads the PMU-99 plugin ndrv. The NativePowerMgrLib actually behaves correctly. It is the plugin that causes the crash.

I have been disassembling and editing the PMU-99 plugin to determine why it crashes on the mini. The answer seems to be simple: the "prim-info" property is missing from the PMU-99 "power-mgt" node in the device tree. Spoofing this property gets me past primary Power Manager initialisation, but not past secondary initialisation. I am working on this now.

Attached is a ROM that gets past primary initialisation with a zeroed-out "prim-info". You can get it past secondary initialisation by holding down the shift key at boot. Use an unpatched boot 3.

Could mini-watchers please help out by posting the contents of the "prim-info" properties on their machines? Also, any technical information about this property would be very useful. I have looked at the Linux driver code but no further.

Offline darthnVader

  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Re: Booting Mac Os 9 on Mac Mini.
« Reply #250 on: March 02, 2018, 10:43:50 PM »
Does anyone remember the old Apple tech note on two machine debugging that told how to directly connect two Mac's with an ethernet cable?

One of my routers died and I can't connect my Mac's via ethernet to my router via ethernet.

I'd like to be able to dump the "prim-info" property to help ELN debug the PMU.


Offline darthnVader

  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Re: Booting Mac Os 9 on Mac Mini.
« Reply #251 on: March 02, 2018, 11:01:01 PM »
EDIT: Sorry my eyes going bad on me, and I didn't fully read what you said. I gave the "pmu-info" rather than the "prim-info".


My mini doesn't appear to have that property under the power-mgt.

iBook G4 1.33 12":
000000ff 00000060 00003e80 00017fb5 0202d607 00000000 00011300 46000220 101400

PowerBook G4 1.5 12" same as above.

Ibook G3 600 is the same as above.

My QuickSilver Dual 1.0 Ghz
000000ff 0000002c 00030d40 0001e705 00003400 00000000 0000260d 46000278 783c00

« Last Edit: March 02, 2018, 11:35:24 PM by darthnVader »

Offline ELN

  • Gold Member
  • *****
  • Posts: 295
  • new to the forums
Re: Booting Mac Os 9 on Mac Mini.
« Reply #252 on: March 03, 2018, 03:09:10 AM »
Thanks darthnVader! Your results accord with some that I dug up. But are those last six digits spurious in each case?

Here is a ROM file that patches prim-info using Forth. There are no other patches!

This gets us past primary and secondary Power Manager init (the latter only if the Apple CPU Plugins file is removed). My mini freezes after loading the Finder unless extensions are disabled. I isolated the offending extension to one starting with A, B, C or D but then had to stop work for the day. Can anyone figure this out for me?

Offline ELN

  • Gold Member
  • *****
  • Posts: 295
  • new to the forums
Re: Booting Mac Os 9 on Mac Mini.
« Reply #253 on: March 03, 2018, 03:10:36 AM »
Here are my notes on prim-info.

Code: [Select]
iBook G4            000000ff 00000060 00003e80 00017fb5 0202d607 00000000 00011300 46000220
Power Mac G4 MDD    000000ff 0000002c 00030d40 0001e705 00003400 00000000 0000260d 46000270

                                               ^^^^^^^^ public PM features
                                                        ^^^^^^^^ private PM features
                                                                          ^^^^ batt count

FROM THE DARWIN SOURCES:

// PUBLIC power management features
// NOTE: this is a direct port from classic, some of these bits
//       are obsolete but are included for completeness
enum {
  kPMHasWakeupTimerMask        = (1<<0),  // 1=wake timer is supported
  kPMHasSharedModemPortMask    = (1<<1),  // Not used
  kPMHasProcessorCyclingMask   = (1<<2),  // 1=processor cycling supported
  kPMMustProcessorCycleMask    = (1<<3),  // Not used
  kPMHasReducedSpeedMask       = (1<<4),  // 1=supports reduced processor speed
  kPMDynamicSpeedChangeMask    = (1<<5),  // 1=supports changing processor speed on the fly
  kPMHasSCSIDiskModeMask       = (1<<6),  // 1=supports using machine as SCSI drive
  kPMCanGetBatteryTimeMask     = (1<<7),  // 1=battery time can be calculated
  kPMCanWakeupOnRingMask       = (1<<8),  // 1=machine can wake on modem ring
  kPMHasDimmingSupportMask     = (1<<9),  // 1=has monitor dimming support
  kPMHasStartupTimerMask       = (1<<10), // 1=can program startup timer
  kPMHasChargeNotificationMask = (1<<11), // 1=client can determine charger status/get notifications
  kPMHasDimSuspendSupportMask  = (1<<12), // 1=can dim diplay to DPMS ('off') state
  kPMHasWakeOnNetActivityMask  = (1<<13), // 1=supports waking upon receipt of net packet
  kPMHasWakeOnLidMask          = (1<<14), // 1=can wake upon lid/case opening
  kPMCanPowerOffPCIBusMask     = (1<<15), // 1=can remove power from PCI bus on sleep
  kPMHasDeepSleepMask          = (1<<16), // 1=supports deep (hibernation) sleep
  kPMHasSleepMask              = (1<<17), // 1=machine support low power sleep (ala powerbooks)
  kPMSupportsServerModeAPIMask = (1<<18), // 1=supports reboot on AC resume for unexpected power loss
  kPMHasUPSIntegrationMask     = (1<<19)  // 1=supports incorporating UPS devices into power source calcs
};

// PRIVATE power management features
// NOTE: this is a direct port from classic, some of these bits
//       are obsolete but are included for completeness.
enum {
  kPMHasExtdBattInfoMask       = (1<<0),  // Not used
  kPMHasBatteryIDMask          = (1<<1),  // Not used
  kPMCanSwitchPowerMask        = (1<<2),  // Not used
  kPMHasCelsiusCyclingMask     = (1<<3),  // Not used
  kPMHasBatteryPredictionMask  = (1<<4),  // Not used
  kPMHasPowerLevelsMask        = (1<<5),  // Not used
  kPMHasSleepCPUSpeedMask      = (1<<6),  // Not used
  kPMHasBtnIntHandlersMask     = (1<<7),  // 1=supports individual button interrupt handlers
  kPMHasSCSITermPowerMask      = (1<<8),  // 1=supports SCSI termination power switch
  kPMHasADBButtonHandlersMask  = (1<<9),  // 1=supports button handlers via ADB
  kPMHasICTControlMask         = (1<<10), // 1=supports ICT control
  kPMHasLegacyDesktopSleepMask = (1<<11), // 1=supports 'doze' style sleep
  kPMHasDeepIdleMask           = (1<<12), // 1=supports Idle2 in hardware
  kPMOpenLidPreventsSleepMask  = (1<<13), // 1=open case prevent machine from sleeping
  kPMClosedLidCausesSleepMask  = (1<<14), // 1=case closed (clamshell closed) causes sleep
  kPMHasFanControlMask         = (1<<15), // 1=machine has software-programmable fan/thermostat controls
  kPMHasThermalControlMask     = (1<<16), // 1=machine supports thermal monitoring
  kPMHasVStepSpeedChangeMask   = (1<<17), // 1=machine supports processor voltage/clock change
  kPMEnvironEventsPolledMask   = (1<<18)  // 1=machine doesn't generate pmu env ints, we must poll instead
};

// DEFAULT public and private features for machines whose device tree
// does NOT contain this information (pre-Core99).

// For Cuda-based Desktops

#define kStdDesktopPMFeatures   kPMHasWakeupTimerMask         |\
                                kPMHasProcessorCyclingMask    |\
                                kPMHasDimmingSupportMask      |\
                                kPMHasStartupTimerMask        |\
                                kPMSupportsServerModeAPIMask  |\
                                kPMHasUPSIntegrationMask

#define kStdDesktopPrivPMFeatures  kPMHasExtdBattInfoMask     |\
                                   kPMHasICTControlMask       |\
                                   kPMHasLegacyDesktopSleepMask

#define kStdDesktopNumBatteries 0

// For Wallstreet (PowerBook G3 Series 1998)

#define kWallstreetPMFeatures   kPMHasWakeupTimerMask         |\
                                kPMHasProcessorCyclingMask    |\
                                kPMHasReducedSpeedMask        |\
                                kPMDynamicSpeedChangeMask     |\
                                kPMHasSCSIDiskModeMask        |\
                                kPMCanGetBatteryTimeMask      |\
                                kPMHasDimmingSupportMask      |\
                                kPMHasChargeNotificationMask  |\
                                kPMHasDimSuspendSupportMask   |\
                                kPMHasSleepMask

#define kWallstreetPrivPMFeatures  kPMHasExtdBattInfoMask      |\
                                   kPMHasBatteryIDMask         |\
                                   kPMCanSwitchPowerMask       |\
                                   kPMHasADBButtonHandlersMask |\
                                   kPMHasSCSITermPowerMask     |\
                                   kPMHasICTControlMask        |\
                                   kPMClosedLidCausesSleepMask |\
                                   kPMEnvironEventsPolledMask

#define kStdPowerBookPMFeatures      kWallstreetPMFeatures
#define kStdPowerBookPrivPMFeatures  kWallstreetPrivPMFeatures

#define kStdPowerBookNumBatteries 2

// For 101 (PowerBook G3 Series 1999)

#define k101PMFeatures          kPMHasWakeupTimerMask         |\
                                kPMHasProcessorCyclingMask    |\
                                kPMHasReducedSpeedMask        |\
                                kPMDynamicSpeedChangeMask     |\
                                kPMHasSCSIDiskModeMask        |\
                                kPMCanGetBatteryTimeMask      |\
                                kPMHasDimmingSupportMask      |\
                                kPMHasChargeNotificationMask  |\
                                kPMHasDimSuspendSupportMask   |\
                                kPMHasSleepMask               |\
                                kPMHasUPSIntegrationMask

#define k101PrivPMFeatures      kPMHasExtdBattInfoMask        |\
                                kPMHasBatteryIDMask           |\
                                kPMCanSwitchPowerMask         |\
                                kPMHasADBButtonHandlersMask   |\
                                kPMHasSCSITermPowerMask       |\
                                kPMHasICTControlMask          |\
                                kPMClosedLidCausesSleepMask   |\
                                kPMEnvironEventsPolledMask

#define IOPMNoErr       0   // normal return

                        // returned by powerStateWillChange and powerStateDidChange:
#define IOPMAckImplied      0   // acknowledgement of power state change is implied
#define IOPMWillAckLater    1   // acknowledgement of power state change will come later

                        // returned by requestDomainState
#define IOPMBadSpecification    4   // unrecognized specification parameter
#define IOPMNoSuchState     5   // no power state matches search specification

#define IOPMCannotRaisePower    6   // a device cannot change its power for some reason

                        // returned by changeStateTo
#define IOPMParameterError  7   // requested state doesn't exist
#define IOPMNotYetInitialized   8   // device not yet fully hooked into power management "graph"

Offline darthnVader

  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Re: Booting Mac Os 9 on Mac Mini.
« Reply #254 on: March 03, 2018, 03:30:49 AM »
Thanks darthnVader! Your results accord with some that I dug up. But are those last six digits spurious in each case?

Here is a ROM file that patches prim-info using Forth. There are no other patches!

This gets us past primary and secondary Power Manager init (the latter only if the Apple CPU Plugins file is removed). My mini freezes after loading the Finder unless extensions are disabled. I isolated the offending extension to one starting with A, B, C or D but then had to stop work for the day. Can anyone figure this out for me?

I gave the latest Rom a try, ASP reports the system is a G4 Cube, but if I try and sleep the system, I get the message:

The System can not sleep until the case is closed. Please close the case and try again.

So if we can set a bit in the "prim-info" that makes the system think the case is closed, lets see if that will enable sleep.

Likely, the Finder not loading is the Apple CD/DVD extension.
« Last Edit: March 03, 2018, 03:49:56 AM by darthnVader »

Offline darthnVader

  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Re: Booting Mac Os 9 on Mac Mini.
« Reply #255 on: March 03, 2018, 04:33:20 AM »
I opened the case on my Quicksilver, and checked the IOReg, but the "prim-info" didn't change.

OS 9 nor OS X seems to care if the case is open, they both sleep just fine.

I'm not sure if the Quicksilver has the case switch, I remember the G5 has one, I don't know about the Cube.


Offline ELN

  • Gold Member
  • *****
  • Posts: 295
  • new to the forums
Re: Booting Mac Os 9 on Mac Mini.
« Reply #256 on: March 03, 2018, 06:10:58 AM »
The prim-info property does not change after boot. It just tells the OS how to behave under certain conditions.

Try this one. I have unset the "open case prevent machine from sleeping" bit.

By the way, does anyone have trouble with the mini fans running loud?

Offline RossDarker

  • Gold Member
  • *****
  • Posts: 281
Re: Booting Mac Os 9 on Mac Mini.
« Reply #257 on: March 03, 2018, 06:31:47 AM »
The prim-info property does not change after boot. It just tells the OS how to behave under certain conditions.

Try this one. I have unset the "open case prevent machine from sleeping" bit.

By the way, does anyone have trouble with the mini fans running loud?
ELN, I got a tiBook and I can finally format and install on to my mini without the use of dodgy emulators then restoring. This latest ROM does seem to make the fans run loud on the mini.

Offline darthnVader

  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Re: Booting Mac Os 9 on Mac Mini.
« Reply #258 on: March 03, 2018, 08:15:47 AM »
The prim-info property does not change after boot. It just tells the OS how to behave under certain conditions.

Try this one. I have unset the "open case prevent machine from sleeping" bit.

By the way, does anyone have trouble with the mini fans running loud?

I haven't really noticed a loud fan,  lots of heat coming out the back, the fan seems pretty quite.


Offline darthnVader

  • Platinum Member
  • *****
  • Posts: 679
  • New Member
Re: Booting Mac Os 9 on Mac Mini.
« Reply #259 on: March 03, 2018, 08:33:24 AM »
The prim-info property does not change after boot. It just tells the OS how to behave under certain conditions.

Try this one. I have unset the "open case prevent machine from sleeping" bit.


No dice on sleep, the system reports missing software and asks for a reinstall, but I only have minimal extensions enabled for internet, USB, and graphics.

So a full install may get us further.

Just figured it was worth a shot while you were working with the PMU to see what we could learn.

The Mini doesn't draw a great deal of power, but anything we can learn about the PMU and how it responds to OS 9 and it's drivers may help us if we ever want to get sleep working on the unsupported mobiles.

Not really a priority, getting the system stable, and loading as many extensions as we can. the Apple CD/DVD extension seems to be troublesome, if at some point we want to make a bootable disc for the Mini we'll need to figure why it is causing the Finder to hang, and see if there is anything we can do to fix it.