NOTE: This Technical Note has been
retired. Please see the Technical Notes
page for current documentation.|
The Process of Turning On Your Macintosh
Most server software is designed to run in an environment where you're not guaranteed human supervision. A remote server, for example, ought to be able to restart itself after a power failure without any manual interaction.
By default, Macintosh computers are designed to be used in a desktop environment, where the user must power up by manually pressing the power-on key. However, in most cases it is possible to configure the Macintosh firmware, so that the system will power itself up the next time that primary AC is available.
Most Macintosh computers are equipped with an internal
microcontroller that, among other things, manages the
Macintosh power providing Soft Power Control. This
microcontroller, a custom ASIC designed specifically for
Apple, dictates the circumstances under which the Macintosh
will initiate a power up cycle. Typical power-on options
This Note only concentrates on the last two options, Server Mode and Wakeup Mode, and how to enable/disable them.
Introducing The Cuda Manager
Server Mode is enabled by accessing an internal piece of Macintosh system software known as the Cuda Manager (also known as Egret). The Cuda is the firmware that communicates to the microcontroller responsible for managing the Macintosh power.
Keep in mind that not all Macintosh models have the Cuda Manager or Soft Power Control. Soft Power Control exists only on systems where AC voltage is always available to the power supply, and the power supply is controlled by the state of the power fail warning (PFW) signal.
On the other hand, Passive Power Control exists in systems where the power supply is turned off or on by a switch directly in line with the primary AC voltage to the supply.
For example, Macintosh Classic and Macintosh II LC employ Passive power control, while the Macintosh II and most Power Macs use Soft Power.
There are also certain Macintosh models, such as the Color Classic, LC475 and LC575 CPUs, that implement a Pseudo Soft Power supply control. In those cases, the keyboard power key can be used to initiate a power-up of the system, but the chassis switch is wired directly to the power supply and is not utilized by Cuda.
Determining If Your Mac Supports the Cuda
The proper way to determine if a particular Macintosh model supports the Cuda Manager is as follows:
In addition to checking the
Calling the Cuda Manager
Only after you have established the existence of the Cuda
Manager should you then pass commands to it. You can do this
by issuing a trap dispatch call to the Cuda Manager through
On entry, register
When issuing a Cuda dispatch trap from C, it is necessary to pass a pointer to the Cuda parameter block to the trap using register A0 as a pointer to the parameter block. The following function prototype can be used to interface to the Cuda Manager:
Cuda Manager Parameter Block Structure
The Cuda Manager parameter block structure used by all the Cuda Management functions is defined as follows:
The Cuda Manager functions that you need to use are classified as Pseudo Device functions. Typically, parameters of four bytes or less can be passed to or from the Cuda in the parameter block. An error code may also be returned in the event of an unsuccessful completion of a function.
Enable / Disable File Server Mode
This call is used to inform Cuda whether the system should be configured as a standard personal computer or as a file server. When configured as a file server, the system will power itself up any time primary AC is available. When configured as a standard personal computer, the system must be powered up either by manual intervention of the user or the power up timer. A value of zero passed to pbParam will configure the system as a standard personal computer while a non zero value will configure the system as a file server.
Working with a UPS
File Server Mode can be used in conjunction with an external Uninterruptible Power Supply (UPS). But it requires that you programatically shut down the Macintosh before the UPS powers off. Since the File Server Mode state is only valid until the next shutdown, you must "force" the shutdown into not reverting the Cuda into personal computer mode.
One way to accomplish this is to interact with the shutdown process, as follows:
Near the end of the shutdown process the ShutDownMgr will
As part of your UPS Manager's setup, you can use the ShutDwnInstall procedure to install a custom shutdown proc that will run before the computer powers down. For example:
Then in your Shutdown proc, you can use the
Power Fail Time Clock
Although this Technote describes how to configure your Macintosh to automatically restart from a power failure, not all Macintoshes support this feature. This is because there are other ways for Macintosh computers to implement soft power control. For instance, PowerBooks utilize a completely different system. This is why your code should follow the steps outlined in this Note to check if the Cuda/Egret trap is implemented.
Since accessing the Cuda Manager requires intimate knowledge of low memory globals, it may not work in later Mac OS releases.
Contact ADC | ADC Site Map | ADC Advanced Search
|For information about Apple Products, please visit Apple.com.|
Contact Apple | Privacy Notice
Copyright © 2002 Apple Computer, Inc. All rights reserved.