|
Mac OS 9
|
Start Manager Interfaces. More...
Go to the source code of this file.
Data Structures | |
| struct | ExtensionElement |
| struct | ExtensionTableHeader |
| struct | ExtensionTable |
| union | DefStartRec |
| struct | DefVideoRec |
| struct | DefOSRec |
Macros | |
| #define | NewExtensionNotificationUPP(userRoutine) |
| #define | NewExtensionTableHandlerUPP(userRoutine) |
| #define | DisposeExtensionNotificationUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | DisposeExtensionTableHandlerUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| #define | InvokeExtensionNotificationUPP(message, param, extElement, userUPP) |
| #define | InvokeExtensionTableHandlerUPP(message, param, extTableHandle, userUPP) |
| #define | NewExtensionNotificationProc(userRoutine) NewExtensionNotificationUPP(userRoutine) |
| #define | NewExtensionTableHandlerProc(userRoutine) NewExtensionTableHandlerUPP(userRoutine) |
| #define | CallExtensionNotificationProc(userRoutine, message, param, extElement) InvokeExtensionNotificationUPP(message, param, extElement, userRoutine) |
| #define | CallExtensionTableHandlerProc(userRoutine, message, param, extTableHandle) InvokeExtensionTableHandlerUPP(message, param, extTableHandle, userRoutine) |
Typedefs | |
| typedef struct ExtensionElement | ExtensionElement |
| typedef ExtensionElement * | ExtensionElementPtr |
| typedef struct ExtensionTableHeader | ExtensionTableHeader |
| typedef struct ExtensionTable | ExtensionTable |
| typedef ExtensionTable * | ExtensionTablePtr |
| typedef ExtensionTablePtr * | ExtensionTableHandle |
| typedef void * | param |
| typedef void ExtensionElementPtr | extElement |
| typedef void ExtensionTableHandle | extTableHandle |
| typedef union DefStartRec | DefStartRec |
| typedef DefStartRec * | DefStartPtr |
| typedef struct DefVideoRec | DefVideoRec |
| typedef DefVideoRec * | DefVideoPtr |
| typedef struct DefOSRec | DefOSRec |
| typedef DefOSRec * | DefOSPtr |
Enumerations | |
| enum | { kExtensionTableVersion } |
| enum | { extNotificationBeforeFirst = 0 , extNotificationAfterLast = 1 , extNotificationBeforeCurrent , extNotificationAfterCurrent } |
| enum | { uppExtensionNotificationProcInfo = 0x00000FC0 } |
| enum | { uppExtensionTableHandlerProcInfo = 0x00000FC0 } |
| enum | { kNetworkStartupDevice = 32767 , kLocalStartupDevice = 32766 } |
| enum | { kSMProtocolStringSize = 16 , kSMAddressStringSize = 16 , kSMBootFilenameSize = 128 } |
Functions | |
| typedef | CALLBACK_API (void, ExtensionNotificationProcPtr)(UInt32 message |
| typedef | CALLBACK_API (void, ExtensionTableHandlerProcPtr)(UInt32 message |
| typedef | STACK_UPP_TYPE (ExtensionNotificationProcPtr) ExtensionNotificationUPP |
| typedef | STACK_UPP_TYPE (ExtensionTableHandlerProcPtr) ExtensionTableHandlerUPP |
| ExtensionNotificationUPP | NewExtensionNotificationUPP (ExtensionNotificationProcPtr userRoutine) |
| ExtensionTableHandlerUPP | NewExtensionTableHandlerUPP (ExtensionTableHandlerProcPtr userRoutine) |
| void | DisposeExtensionNotificationUPP (ExtensionNotificationUPP userUPP) |
| void | DisposeExtensionTableHandlerUPP (ExtensionTableHandlerUPP userUPP) |
| void | InvokeExtensionNotificationUPP (UInt32 message, void *param, ExtensionElementPtr extElement, ExtensionNotificationUPP userUPP) |
| void | InvokeExtensionTableHandlerUPP (UInt32 message, void *param, ExtensionTableHandle extTableHandle, ExtensionTableHandlerUPP userUPP) |
| void | GetDefaultStartup (DefStartPtr paramBlock) |
| GetDefaultStartup Get default startup device name and reference. More... | |
| void | SetDefaultStartup (DefStartPtr paramBlock) |
| SetDefaultStartup Specify default startup device. More... | |
| void | GetVideoDefault (DefVideoPtr paramBlock) |
| Get default video device location and resource number. More... | |
| void | SetVideoDefault (DefVideoPtr paramBlock) |
| Set default video device location and resource number. More... | |
| void | GetOSDefault (DefOSPtr paramBlock) |
| Get default video device location and resource number. More... | |
| void | SetOSDefault (DefOSPtr paramBlock) |
| Set default operating system. More... | |
| void | SetTimeout (short count) |
| How long you want the system to wait for a hard disk response. More... | |
| void | GetTimeout (short *count) |
| Number of seconds the system wait for a hard disk. More... | |
| OSErr | InstallExtensionNotificationProc (ExtensionNotificationUPP extNotificationProc) |
| OSErr | RemoveExtensionNotificationProc (ExtensionNotificationUPP extNotificationProc) |
| OSErr | InstallExtensionTableHandlerProc (ExtensionTableHandlerUPP extMgrProc, ExtensionTableHandle *extTable) |
| OSErr | RemoveExtensionTableHandlerProc (ExtensionTableHandlerUPP extMgrProc) |
| OSErr | GetSelectedStartupDevice (UInt16 *driveNum) |
| OSErr | GetSelectedStartupDeviceType (OSType *interfaceType) |
| OSErr | GetSelectedFirewireStartupDeviceInfo (UnsignedWide *GUID, UInt32 *mao, UInt32 *lun) |
| OSErr | GetSelectedNetworkStartupDeviceInfo (char *protocol, char *siaddr, char *filename, char *ciaddr, char *giaddr, UInt32 *bootpRetries, UInt32 *tftpRetries, UInt32 reserved) |
| Boolean | IsDriveSelectable (UInt16 driveNum) |
| OSErr | SetSelectedStartupDevice (UInt16 driveNum) |
| OSErr | SetSelectedNetworkStartupDevice (char *protocol, char *siaddr, char *filename, char *ciaddr, char *giaddr, UInt32 bootpRetries, UInt32 tftpRetries, UInt32 reserved) |
Start Manager Interfaces.
For bug reports, consult the following page on the World Wide Web:
http://developer.apple.com/bugreporter/
| #define InvokeExtensionNotificationUPP | ( | message, | |
| param, | |||
| extElement, | |||
| userUPP | |||
| ) |
| #define InvokeExtensionTableHandlerUPP | ( | message, | |
| param, | |||
| extTableHandle, | |||
| userUPP | |||
| ) |
| #define NewExtensionNotificationProc | ( | userRoutine | ) | NewExtensionNotificationUPP(userRoutine) |
CALL_NOT_IN_CARBON support for pre-Carbon UPP routines: New...Proc and Call...Proc
| #define NewExtensionNotificationUPP | ( | userRoutine | ) |
pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes)
| #define NewExtensionTableHandlerUPP | ( | userRoutine | ) |
pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes)
| anonymous enum |
Important: When the major version number of kExtensionTableVersion and the value returned by gestaltExtensionTableVersion change, it indicates that the Extension Table startup mechanism has radically changed and code that doesn't know about the new major version must not attempt to use the Extension Table startup mechanism.
Changes to the minor version number of kExtensionTableVersion indicate that the definition of the ExtensionElement structure has been extended, but the fields defined for previous minor versions of kExtensionTableVersion have not changed.
| anonymous enum |
| anonymous enum |
CALL_NOT_IN_CARBON Native StartLib calls - these are implemented ONLY on NewWorld machines (iMac, etc.)
These functions should be weak linked. If unavailable, use older method (Get/SetDefaultStartup) The enums below define pseudo startup devices, such as a network disk. They can be used in place of driveNums in various StartLib calls
NOTE - the values are chosen to avoid conflict with vRefNums (low negative numbers), wdRefNums (large negative numbers) and drive numbers (low positive numbers)
| anonymous enum |
The enums below determine the maximum string size of parameters for network startup device calls.
| void DisposeExtensionNotificationUPP | ( | ExtensionNotificationUPP | userUPP | ) |
DisposeExtensionNotificationUPP()
| void DisposeExtensionTableHandlerUPP | ( | ExtensionTableHandlerUPP | userUPP | ) |
DisposeExtensionTableHandlerUPP()
| void GetDefaultStartup | ( | DefStartPtr | paramBlock | ) |
GetDefaultStartup Get default startup device name and reference.
GetDefaultStartup obtains information from parameter RAM concerning what kind of default startup device is being used. pbis the address of an 8-byte DefStartRec parameter block structure. It contains the following fields: Out-In Name Type SizeOffsetDescription <-sdExtDevID SignedByte 10External device ID <-sdPartition SignedByte 11Reserved for the future <-sdSlotNum SignedByte 12Slot number <-sdSRsrc SignedByte 13Slot resource ID OR <-sdReserved1 SignedByte 10Reserved for the future <-sdReserved2 SignedByte 11Reserved for the future <-sdRefNum short 22Negative = SCSI, Positive = Slot
none
Deciding which variant to use depends on the content of the sdRefNum field. A negative number means the driver reference of a SCSI device (scsiDev) and no further information is needed, while a positive number means you'll have to access the information in the slotDev variant. If you have to access the information in slotDev, only sdExtDevID (the slot's driver), sdSlotNum (the slot number) and sdSRsrcID (the slot resource ID) will contain pertinent data. sdPartition is a reserved field.
| void GetOSDefault | ( | DefOSPtr | paramBlock | ) |
Get default video device location and resource number.
GetOSDefault obtains information from parameter RAM concerning what operating system is the default. pbis the address of a 2-byte DefOSRec structure. It contains the following fields: Out-In Name Type SizeOffsetDescription <-sdReserved SignedByte 10Not in use, returns a 0 <-sdOSTtype SignedByte 11Operating system ID
none
The general application of this call is when a partitioned drive is loaded with more than one operating system.
| OSErr GetSelectedFirewireStartupDeviceInfo | ( | UnsignedWide * | GUID, |
| UInt32 * | mao, | ||
| UInt32 * | lun | ||
| ) |
GetSelectedFirewireStartupDeviceInfo - for a startup device of type Firewire, get pertinent info, including GUID, mao and lun. This refers to the device selected by the user via Startup Disk control panel, which may or may not be the device currently booted.
GetSelectedFirewireStartupDeviceInfo should only be called if GetSelectedStartupDeviceType returns the type kdgFireWireIntf. If the selected startup device is not kdgFireWireIntf, GetSelectedFirewireStartupDeviceInfo returns an error (nsDrvErr) and the return parameters are undefined. GetSelectedFirewireStartupDeviceInfo()
| OSErr GetSelectedNetworkStartupDeviceInfo | ( | char * | protocol, |
| char * | siaddr, | ||
| char * | filename, | ||
| char * | ciaddr, | ||
| char * | giaddr, | ||
| UInt32 * | bootpRetries, | ||
| UInt32 * | tftpRetries, | ||
| UInt32 | reserved | ||
| ) |
GetSelectedNetworkStartupDeviceInfo - for a network startup device, return relevant information (this refers to the device selected by the user via Startup Disk control panel, which may or may not be the device currently booted):
See the Open Firmware netbooting recommended practices: http://playground.sun.com/1275/practice/obp-tftp/tftp1_0.pdf
The possible parameters for this call are:
[bootp,]siaddr,filename,ciaddr,giaddr,bootp-retries,tftp-retries
bootp...specifies the use of BOOTP as the ©discovery© protocol to be
used. siaddr is the IP address of the intended server. filename is the filename of the file that is to be loaded by TFTP from the server. ciaddr is the IP address of the client (i.e., the system being booted). giaddr is the IP address of the BOOTP ©gateway©. bootp-retries is the maximum number of retries that are attempted before the BOOTP process is determined to have failed. tftp-retries is the maximum number of retries that are attempted before the TFTP process is stopped.
Address parameters are specified as strings, not binary (e.g.,
"128.1.1.1") and are limited to kSMAddressStringSize (16 bytes) in length. filename parameter is limited to kSMBootFilenameSize (128 bytes) in length. protocol parameter is limited to kSMProtocolStringSize in length GetSelectedNetworkStartupDeviceInfo()
| OSErr GetSelectedStartupDevice | ( | UInt16 * | driveNum | ) |
GetSelectedStartupDevice - return the driveNum of the currently selected startup device. This refers to the device selected by the user via Startup Disk control panel, which may or may not be the device currently booted. GetSelectedStartupDevice()
| OSErr GetSelectedStartupDeviceType | ( | OSType * | interfaceType | ) |
GetSelectedStartupDeviceType - return the type of the currently selected startup device. This refers to the device selected by the user via Startup Disk control panel, which may or may not be the device currently booted. Returned types are based on kdgInterface DriverGestalt response ('scsi', 'ata ', 'fire', etc.) GetSelectedStartupDeviceType()
| void GetTimeout | ( | short * | count | ) |
Number of seconds the system wait for a hard disk.
GetTimeout specifies how long the system will wait for a hard disk response. countis the number of seconds the system will wait on the hard disk. A zero in count specifies the default limit of 15 seconds.
none
| void GetVideoDefault | ( | DefVideoPtr | paramBlock | ) |
Get default video device location and resource number.
GetVideoDefault obtains information from parameter RAM concerning what kind of default video device is being used. pbis the address of a 2-byte DefVideoRec structure. It contains the following fields: Out-In Name Type SizeOffsetDescription <-sdSlot SignedByte 10Slot number; 0 = no default video <-sdSResource SignedByte 11Slot resource ID
none
If there is no default video and sdSlot is 0, the system will choose the first available monitor.
| OSErr InstallExtensionNotificationProc | ( | ExtensionNotificationUPP | extNotificationProc | ) |
CALL_NOT_IN_CARBON InstallExtensionNotificationProc
Installs an ExtensionNotificationUPP.
Parameters: extNotificationProc The ExtensionNotificationUPP to install.
Results: noErr 0 The ExtensionNotificationUPP was installed. paramErr -50 This ExtensionNotificationUPP has already been installed. memFullErr -108 Not enough memory to install the ExtensionNotificationUPP. InstallExtensionNotificationProc()
| OSErr InstallExtensionTableHandlerProc | ( | ExtensionTableHandlerUPP | extMgrProc, |
| ExtensionTableHandle * | extTable | ||
| ) |
InstallExtensionTableHandlerProc
Installs an ExtensionTableHandlerUPP. Control is taken away from the system's default handler and the ExtensionTableHandlerUPP is responsible for all changes to the ExtensionTable (except for incrementing extElementIndex between extensions). This is always the first handler called with extNotificationBeforeFirst and extNotificationBeforeCurrent messages and the last handler called with extNotificationAfterLast and extNotificationAfterCurrent messages. extElementIndex is always incremented immediately after the ExtensionTableHandlerUPP is called with the extNotificationAfterCurrent message.
There can only be one ExtensionTableHandler installed.
Warning: The only safe time to change what ExtensionElement is at ExtensionTable.extElements[extElementIndex] is when your ExtensionTableHandlerUPP is called with the extNotificationAfterCurrent message. You may change the ExtensionTable or the extElementIndex at other times, but you must ensure that the ExtensionElement at ExtensionTable.extElements[extElementIndex] stays the same.
Note: If the ExtensionTable or the contents of the folders included in the ExtensionTable are changed after installing an ExtensionTableHandler, RemoveExtensionTableHandlerProc cannot be called.
Parameters: extMgrProc The ExtensionTableHandlerUPP to install. extTable A pointer to an ExtensionTableHandle where InstallExtensionTableHandlerProc will return the current ExtensionTableHandle. You don't own the handle itself and must not dispose of it, but you can change the extElementIndex. the extElementCount, and the ExtensionElements in the table.
Results: noErr 0 The ExtensionTableHandlerUPP was installed. paramErr -50 Another ExtensionTableHandlerUPP has already been installed. memFullErr -108 Not enough memory to install the ExtensionTableHandlerUPP. InstallExtensionTableHandlerProc()
| void InvokeExtensionNotificationUPP | ( | UInt32 | message, |
| void * | param, | ||
| ExtensionElementPtr | extElement, | ||
| ExtensionNotificationUPP | userUPP | ||
| ) |
InvokeExtensionNotificationUPP()
| void InvokeExtensionTableHandlerUPP | ( | UInt32 | message, |
| void * | param, | ||
| ExtensionTableHandle | extTableHandle, | ||
| ExtensionTableHandlerUPP | userUPP | ||
| ) |
InvokeExtensionTableHandlerUPP()
| Boolean IsDriveSelectable | ( | UInt16 | driveNum | ) |
IsDriveSelectable - determines if the drive specified by driveNum is a candidate for booting. This checks criteria, such as necessary driver support and Open Firmware support, which are minimal for the device to be considered as a startup device. This call does not check other criteria, such as whether or not a valid System Folder is present on the volume. IsDriveSelectable()
| ExtensionNotificationUPP NewExtensionNotificationUPP | ( | ExtensionNotificationProcPtr | userRoutine | ) |
| ExtensionTableHandlerUPP NewExtensionTableHandlerUPP | ( | ExtensionTableHandlerProcPtr | userRoutine | ) |
| OSErr RemoveExtensionNotificationProc | ( | ExtensionNotificationUPP | extNotificationProc | ) |
RemoveExtensionNotificationProc
Removes an ExtensionNotificationUPP.
Note: ExtensionNotificationUPPs can't call RemoveExtensionNotificationProc.
Parameters: extNotificationProc The ExtensionNotificationUPP to remove.
Results: noErr 0 The ExtensionNotificationUPP was removed. paramErr -50 The ExtensionNotificationUPP was not found, or RemoveExtensionNotificationProc was called from within a ExtensionNotificationUPP (ExtensionNotificationUPPs can't call RemoveExtensionNotificationProc). RemoveExtensionNotificationProc()
| OSErr RemoveExtensionTableHandlerProc | ( | ExtensionTableHandlerUPP | extMgrProc | ) |
RemoveExtensionTableHandlerProc
Remove an ExtensionTableUPP. Control is passed back to the default handler.
Parameters: extMgrProc The ExtensionTableUPP to remove.
Results: noErr 0 The ExtensionTableUPP was removed. paramErr -50 This ExtensionTableUPP was not installed, or the ExtensionTable no longer matches the original boot ExtensionTable. RemoveExtensionTableHandlerProc()
| void SetDefaultStartup | ( | DefStartPtr | paramBlock | ) |
SetDefaultStartup Specify default startup device.
SetDefaultStartup defines the kind of default startup device being used. pbis the address of an 8-byte DefStartRec parameter block structure. It contains the following fields: Out-In Name Type SizeOffsetDescription ->sdExtDevID SignedByte 10External device ID ->sdPartition SignedByte 11Reserved for the future ->sdSlotNum SignedByte 12Slot number ->sdSRsrc SignedByte 13Slot resource ID OR ->sdReserved1 SignedByte 10Reserved for the future ->sdReserved2 SignedByte 11Reserved for the future ->sdRefNum short 22Negative = SCSI, Positive = Slot
none
If the default startup device is a slotDev, put its identification number in the sdExtDevID field, specify the slot number in sdSlotNum, and fill the sdSRsrcID field with the slot resource ID. If the default startup device is a scsiDev, put its reference number in the sdRefNum field. If you're not specifying a default startup device, pass a 0 in the sdRefNum field. Reserved fields sdReserved1 and sdReserved2 should both be 0.
| void SetOSDefault | ( | DefOSPtr | paramBlock | ) |
Set default operating system.
SetOSDefault specifies what operating system is the default. pbis the address of a 2-byte DefOSRec structure. It contains the following fields: Out-In Name Type SizeOffsetDescription ->sdReserved SignedByte 10Not in use, use a 0 ->sdOSTtype SignedByte 11Operating system ID
none
The general application of this call is when a partitioned drive is loaded with more than one operating system.
| OSErr SetSelectedNetworkStartupDevice | ( | char * | protocol, |
| char * | siaddr, | ||
| char * | filename, | ||
| char * | ciaddr, | ||
| char * | giaddr, | ||
| UInt32 | bootpRetries, | ||
| UInt32 | tftpRetries, | ||
| UInt32 | reserved | ||
| ) |
SetSelectedNetworkStartupDevice - set a network device as the startup device. This is for more complex setup than handled by SetSelectedStartupDevice.
See the Open Firmware netbooting recommended practices: http://playground.sun.com/1275/practice/obp-tftp/tftp1_0.pdf
The possible parameters for this call are:
[bootp,]siaddr,filename,ciaddr,giaddr,bootp-retries,tftp-retries
bootp...specifies the use of BOOTP as the ©discovery© protocol to be
used. if not specified (parameter is nil), bootp is used by default siaddr is the IP address of the intended server. filename is the filename of the file that is to be loaded by TFTP from the server. ciaddr is the IP address of the client (i.e., the system being booted). giaddr is the IP address of the BOOTP ©gateway©. bootp-retries is the maximum number of retries that are attempted before the BOOTP process is determined to have failed. tftp-retries is the maximum number of retries that are attempted before the TFTP process is stopped.
Address parameters are specified as strings, not binary (e.g.,
"128.1.1.1") and are limited to kSMAddressStringSize (16 bytes) in length. filename parameter is limited to kSMBootFilenameSize (128 bytes) in length. protocol parameter is limited to kSMProtocolStringSize in length
NOTE - unspecified parameters should be specified as nil, except for retry parameters which should be zero. SetSelectedNetworkStartupDevice()
| OSErr SetSelectedStartupDevice | ( | UInt16 | driveNum | ) |
SetSelectedStartupDevice - set the device referred to by driveNum to be the startup device. Passing the pseudo-device kNetworkStartupDevice sets default enet:bootp behavior. For more complex scenarios, use SetSelectedNetworkStartupDevice (q.v.). SetSelectedStartupDevice()
| void SetTimeout | ( | short | count | ) |
How long you want the system to wait for a hard disk response.
CALL_NOT_IN_CARBON
SetTimeout lets you tell the system how long to wait for a hard disk response. countis the number of seconds you specify that the system should wait on the hard disk. A zero in count specifies the default limit of 15 seconds. 31 seconds is maximum.
none
| void SetVideoDefault | ( | DefVideoPtr | paramBlock | ) |
Set default video device location and resource number.
SetVideoDefault turns the device specified by the slot number and the resource ID into the default video device. pbis the address of a 2-byte DefVideoRec structure. It contains the following fields: Out-In Name Type SizeOffsetDescription ->sdSlot SignedByte 10Slot number; 0 = no default video ->sdSResource SignedByte 11Slot resource ID
none