(This page copied from Apple's site in case it goes offline)

Technote 1121

Mac OS 8.1

By Andy Bachorski
Apple Developer Technical Support (DTS)
devsupport@apple.com

Version 1.0

Mac OS 8.1 introduces a number of new and/or updated technologies. This Technote documents the changes that most likely will affect developers.

Contents

NOTE
Many of the changes mentioned here are accompanied by corresponding changes to interface files. These updated interface files will be available in the next release (after 3.0.1) of Universal Interfaces.




Finder 8.1

Finder 8.1 changes fall into three categories:

Finder 8.1 also defines two new bits in its Gestalt selector.

New features:

Enhancements to existing features:

Bug fixes:

Dozens of bugs have been fixed, including many in AppleScript support. Some internal subsystems have been redesigned and re-implemented for substantially better stability.

Finder/AppleScript bug fixes:

Other specific bug fixes:

Gestalt:

As a result of the above changes and changes in Finder 8, Finder's Gestalt selector response value has acquired two new defined bits under Mac OS 8.1:

enum
{
    gestaltFinderFloppyRootComments = 8,
    gestaltFinderLargeAndNotSavedFlavorsOK = 9
};

gestaltFinderFloppyRootComments describes whether desktop database comments for floppy disks contain data the user typed in (notes, etc.) or are used internally by Finder. Under Mac OS 8 and later, this field is used by Finder; if Finder ever relinquishes the use of the field, it will set this bit.

gestaltFinderLargeAndNotSavedFlavorsOK describes whether two bugs (described above) in Finder's handling of clipping files have been fixed. Under Mac OS 8.1, this bit is set.

Before testing for either of these bits, you should first test for the presence of Mac OS 8 or later. If Mac OS 8 is present, neither of these bits will be set.


HFS Plus Volume Format

Mac OS 8.1 introduces support for Apple's new volume format, HFS Plus (also known as Mac OS Extended). This format is available for use with any storage device larger than 32MB that support the HFS volume format.

Benefits Provided in Mac OS 8.1

The main benefit in this release of the Mac OS Extended volume format is the use of smaller allocation blocks. The size of allocation blocks used for a particular volume depend on its size.

Volume Size

Default allocation block size

<= 256 MB

512

<= 512 MB

1K

<= 1GB

2K

> 1GB

4K

The default allocation block size of 4K was chosen for volumes larger than 1GB. For a number of reasons:

Future Benefits

The Mac OS Extended volume format also provides support for long Unicode file names, large files, and extended attributes. However, Mac OS 8.1 does not introduce the new APIs required to access these advanced features. The support for Mac OS Extended volumes was added in such a way that use of these volumes should be transparent to developers who use only the documented File Manager API.

Note:
Even though there are no APIs to directly manipulate Unicode file names, the File Manager does use Unicode to store file names on HFS Plus volumes. These file names are stored in the catalog in an different order than the RelString order for HFS volumes. If an applications depends on the way files are orderd on disk, it will most likely behave differently depending on the volume format used.

Mac OS 8.1 introduces a few changes to the existing File Manager API that developers should be aware of. These changes include routines for getting extended volume information and for controlling the formatting process. These changes are described in a separate HFS Plus Technote which will be published in the near future along with another document, "Mac OS Extended Volume Format", that describes the format of an HFS Plus volume.

Note:
If your application make use of any undocumented File Manager low memory vectors it will most likely not work with Mac OS 8.1. Most of these private vectors were either changed or removed when support for HFS Plus volumes was added.


File Manager Disk Cache

The File Manager provides services for storage and retrieval of disk based information.

The File Manager disk cache performance on multi-block I/O operations has been improved. Cached multi-block I/O operations should be noticeably faster.


Start Manager Changes

The Start Manager was changed in Mac OS 8.1 to add a mechanism for controlling the loading of extensions at system startup. During the boot process, an extension table is created before any extensions are loaded. This table is then used by the boot code to determine which extensions should be loaded and in which order.

Prior to the introduction of the Extension Table Manager in Mac OS 8.1, extensions were loaded from three folders, Extensions, Control Panels and the System Folder, in the order they were found on the disk. On an HFS volume, items are stored in the catalog in RelString order, i.e., in the order the names would be in if sorted by the RelString function. This is the same order items are returned in by the File Manager's GetFInfo routine.

With the introduction of Mac OS 8.1 a new bootable disk format was introduced, HFS Plus. On an HFS Plus volume, items are stored in the catalog in a different order than a Mac OS Standard volume because of the internal use of Unicode for item names. Since extensions were loaded in the order they were found in the catalog, extensions would load in a different order when booted from an HFS vs. an HFS Plus volume.

Note:
Apple has always maintained that extensions can not depend on extension loading order: however, many extension do require specific loading orders.

To prevent problems for our users, and to ensure that extensions load in the same order regardless of the volume format used, an extension table mechanism was added to the Start Manager. The default behavior of the extension table handler is to sort the extensions into RelString order for each folder extensions are loaded from. The result is that extensions are loaded in the same order regardless of which type of volume the system is booting from.

The Extension Table Manager also provides a mechanism that third-party products can use to watch, and optionally control, the extension loading process. A Technote covering this new mechanism is in progress and will be released in the near future.


Sound for PCI Systems

There have been a number of additions and changes to the sound software for PCI-based Macintoshes under Mac OS 8.1 that will affect developers.

Additions

A programmatic method for selecting sound sources via the Sound Input Manager using OSType selectors has been added. Both input and playthrough sources are selectable this way.

Four new selectors have been added to the built-in sound input driver:

enum {
    siMonitorAvailable      = 'mnav',
    siMonitorSource         = 'mons',
    siOSTypeInputSource     = 'inpt',
    siOSTypeInputAvailable  = 'inav'
};

These selectors allow the use of several new constants to set a particular input source or monitor source programmatically. For instance, to have the user record the CD, an application could use code like this:

inline OSErr SetInputSource (long soundRefNum, OSType inputSource) {
	return SPBSetDeviceInfo (soundRefNum, siOSTypeInputSource, &inputSource);
}

where inputSource was set to kCDSource.

The OSType sources were required to guarantee input source selection without user intervention, since the old sound input numbers were not consistent across machines.

The currently defined input source selectors are:

enum {
    kNoSource         = 'none',     /*no source selection*/
    kCDSource         = 'cd  ',     /*internal CD player input*/
    kExtMicSource     = 'emic',     /*external mic input*/
    kRCAInSource      = 'irca',     /*RCA jack input*/
    kTVFMTunerSource  = 'tvfm',
    kDAVInSource      = 'idav',     /*DAV analog input*/
    kIntMicSource     = 'imic',     /*internal mic input*/
    kMediaBaySource   = 'mbay',     /*media bay input*/
    kModemSource      = 'modm',     /*modem input*/
    kZoomVideoSource  = 'zvpc'      /*zoom video input*/
};

Changes

End User Experience

There have also been some minor changes, which make the sound experience more enjoyable and predictable for the user. They are:


MathLib v3

MathLib is a collection of numerical functions designed to facilitate a wide range of numerical programming in preparation for C9X. All of its routines are IEEE-754 aware and treat exceptions, NaNs, positive and negative zero and infinity consistent with the floating- point standard. The interface to MathLib is defined in the fp.h and fenv.h interface files.

MathLib v3 is a major rewrite of MathLib that boosts performance and increases accuracy.

Performance

MathLib v3 boosts the performance of many of its functions by an average of 30 % when measured with a uniform distribution over a subset of the domain of each function.

Accuracy

The accuracy of routines in MathLib v3 have been improved, most notably in the trigonometric functions (e.g, sin and cos). While most numerical functions have been improved, the double data type trigonometric functions are now more in line with their long double counterpart due to a change in their argument reduction methodology.

Argument reduction in MathLib v2 was 53-bit Pi based. To improve coherency and uniformity between double and long double, the trigonometric functions in MathLib v3 reduce their arguments with a 107-bit Pi. This may introduce a difference in the computed results of circular functions in MathLib v2 vs MathLib v3.

The reason for this difference is that MathLib v2 and MathLib v3 carry out a machine Pi argument reduction as opposed to an infinite Pi reduction. Any change in the precision of Pi will affect the final result. Arguments passed to MathLib v3 are no longer able to match the argument reduction seed Pi, (which now has 107-bits of precision) hence, exact edge case results are no longer produced. For example, cos(Pi/2) is no longer exactly 0, but about 6E-17. This result is still well below the roundoff threshold of the IEEE double data type.

All circular inequalities and equalities are maintained under MathLib v3, but their precision has improved. For example, sin(x)^2+cos(x)^2 = 1 more often in an exact sense.

To get cos(±Pi/2) = 0.0, instead of 6E-17, developers have two choices:

Using MathLib v2 will forfeit the performance and added precision of MathLib v3.


ADB Manager

A change was made to the ADB Manager to fix a problem on Power Macintosh 4400 and 4400-based Mac OS clones where PS/2 input devices were reported as being available, when in fact none were connected. The ADB Manager now properly checks for PS/2 input devices and removes entries for nonexistent devices from its device table. This problem affected Game Sprockets and any applications which used it.


Appearance Manager

Mac OS 8.1 includes Appearance Manager 1.0.1. This version of Appearance did not ship as a separate SDK. You should use the Appearance Manager 1.0.2 SDK. While the SDK contains a newer version of the Appearance Manager, there were no API changes.


PC Exchange

PC Exchange permits Macintosh users to mount MS-DOS and Windows disks on their desktops.

Mac OS 8.1 installs Version 2.2 of PC Exchange, which adds:

VFAT Long Filename Support

PC Exchange 2.2 supports Win95 long filenames and can read Unicode filenames of up to 31 characters. Limitations with the Finder and file system require truncation of filenames greater than 31 characters. If the truncated names are not subsequently edited by the user, they will remain >31 character names on disk. PC Exchange 2.2 can also create Win95 long filenames of up to 31 characters in length under Mac OS 8.1.

Language Kit Users

Users of Apple's Language Kits should be aware that PC Exchange allows file names with characters which are technically illegal under Windows 95, but are used to represent non-Roman characters by the Language Kits. Such users may encounter "illegal character" errors when running Windows 95 disk utilities such as ScanDisk. Users are advised to select "ignore" for such errors to avoid unwanted changes to their file names.

Different PC Filenames

Previous versions of PC Exchange use a different method to construct PC filenames. PC Exchange 2.2 uses the same method as Microsoft. For example, the file "helloworld.doc" would have a PC filename of "!HELLOWO.DOC" under previous versions of PC Exchange. Under PC Exchange 2.2, the file "helloworld.doc" would have a long filename of "helloworld.doc" and a PC filename of "HELLOW~1.DOC". The PC names of files which have been created under previous versions of PC Exchange will not change unless the user modifies the filename.

FAT32 Support

The FAT32 disk format introduced with Windows 95 OSR 2 is supported by PC Exchange 2.2.

Formatting PC Disks

Users can format floppies for the Mac OS, PC, or ProDOS. Users may format PC volumes on their Macintosh, but they cannot change the format of a hard disk or removable medium from Mac OS to PC or vice versa. Allowing this might result in the loss of user data without warning.

Bug fixes

There have been a number of bugs fixes, including proper string truncation on two-byte systems and some low-level bugs.


Apple Location Manager 2.0.1

Apple Location Manager is a toolbox extension that allows users to save and restore sets of configurations ("locations") under a single name. For example, a user can define a group of printers, network settings, and extension sets for multiple locations.

Apple Location Manager 2.0.1 includes the following changes:

Additional API Calls

If gestaltALMHasSFLocation is returned from a gestalt call with gestaltALMAttr, then the following calls are supported:

extern pascal OSErr
ALMPutLocation (ConstStr255Param            prompt,
                ALMLocationName             name,
                SInt16                      numTypes,
                ConstALMModuleTypeListPtr   typeList,
                ModalFilterYDUPP            filter,
                void*                       yourDataPtr)

This function allows the developer to create a location using a standardized interface. Typically, the developer will pass kALMAddAllOff or kALMAddAllOnSimple for numTypes, and NULL for typeList, but it is possible to pass an array of module signatures. The filter and yourDataPtr parameters behave as in Standard File.

extern pascal OSErr
ALMMergeLocation (ConstStr255Param            prompt,
                  ALMLocationName             name,
                  SInt16                      numTypes,
                  ConstALMModuleTypeListPtr   typeList,
                  ModalFilterYDUPP            filter,
                  void*                       yourDataPtr);

This function allow the developer to merge settings into an existing location using a standardized interface; the parameters are as with ALMPutLocation, though typically a module signature array is used in this case.

extern pascal OSErr
ALMGetLocation (ConstStr255Param    prompt,
                ALMLocationName     name,
                ModalFilterYDUPP    filter,
                void*               yourDataPtr);

To ask the user to choose a location by name, call this.

This function allows a user to choose a location by name.

New Notifications

Previously, an interested program could receive notification that the current location had changed. In ALM 2.0.1, if bit gestaltALMHasRescanNotifiers returned from gestaltALMAttr is set, the client code will be notified when the locations list is changed (a location gets deleted, renamed, or added). In this way, interested programs will know if location data they retrieved earlier (such as through a call to ALMGetIndLocation) might be out of date because the user has edited the locations list.

New Module Types

Under ALM 1.0.x, all modules had file types of 'thng'. Under ALM 2.0.1, 'thng' files are still supported, but the preferred file types are 'almn' and 'almb'. An 'almn' file is a preference-swapping module, such as "Extension Set". An 'almb' file is an action module, such as "Auto-Open Items". The distinction is that the "value" of an action module cannot be directly determined from the system--it requires user intervention (for example, in the case of Auto-Open Items, the user is asked what files to open).

Developers are encouraged to adopt these new file types so that modules can be auto-routed to the Module folder in a later version of the system software.

CFM-68K Support

All calls in ALM 2.0.1 are available under CFM-68K.

Reboot Level Escalation

When a module was called with the kALMSetCurrentSelect selector, the value of the *flags parameter was kALMNoChange under 1.0.x. Under 2.0 this value is the current "escalation" of the setting; that is, the level to which all modules prior to the developer's module have raised the setting. For example, if a location contains an Extension Set that requires a restart, and subsequent modules do not want to act if the system is restarting, the module can use the input value to decide how to interpret the SetCurrent call.

Bug Fixes

Name

Apple may, for business reasons, change the name of "Apple Location Manager". Developers are cautioned not to rely on the names of items such as the modules folder, and should use FindFolder.

SDK

The Apple Location Manager 2.0.1 SDK is available on the Jan 98 Mac OS SDK CDs. The necessary interface files are included in Universal Interfaces 3.0.1.


Virtual Memory

The Virtual Memory Manager provides virtual memory services for the Mac OS.

There have been a number of changes to the Virtual Memory Manager aimed at providing improved performance for applications. Some of these changes are transparent to applications, while others allow applications to actively control Virtual Memory.

System Level Changes

Virtual Memory Paging Control Functions

The Virtual Memory Paging Control functions allow applications to help the Virtual Memory Manager optimize system performance. This is accomplished by giving the Virtual Memory Manager hints about:

Determining When Virtual Memory Paging Control Functions Are Available

You can determine when the four Virtual Memory Paging Control functions (MakeMemoryResident, MakeMemoryNonResident, FlushMemory, and ReleaseMemoryData) are available by calling Gestalt with the gestaltVMAttr selector and checking if the gestaltVMHasPagingControl bit (bit 4) is set in the response.

Boolean VMHasPagingControl(void)
{
    long response;
    
    if ( (Gestalt( gestaltVMAttr, &response ) == noErr) &&
         ((response & ( 1L << gestaltVMHasPagingControl )) != 0) )
    {
        return ( true );
    }
    else
    {
        return ( false );
    }
}

Virtual Memory Page States

Mac OS virtual memory pages can be in several states. A page's state determines what happens when it's not resident in physical memory, and is made resident, and what happens when it's resident in physical memory and is made non-resident. Understanding how the state of a page affects the Mac OS virtual memory system will help you understand the purpose of the Virtual Memory Paging Control functions.

A page can be either resident or non-resident. A page that is currently in physical memory is resident. A page that is currently not in physical memory is non-resident.

Note:
Pages held by HoldMemory or locked by LockMemory, LockMemoryContiguous, and LockMemoryForOutput are always resident.

A resident page has two states: clean and dirty. A clean page's data does not need to written from memory to the backing store file before the page is made non-resident. A dirty page's data must be written from memory to the backing store file before the page is made non-resident.

A non-resident page also has two states: valid on disk and invalid on disk. A non-resident page which is valid on disk must be read from the backing store file into memory when it is made resident. A non-resident page which is invalid on disk does not need to be read from the backing store file into memory when it is made resident.

Note:
Memory pages are used for file mapping CFM containers stored in file data forks are always clean when resident (because they are read-only) and are always valid on disk when non-resident.

MakeMemoryResident

Use the MakeMemoryResident function to make a portion of the address space resident in physical memory. MakeMemoryResident can be used to optimize system performance by causing the Virtual Memory Manager to read in pages that will be needed in the future.

pascal OSErr MakeMemoryResident (void *address,
                                 unsigned long count);
 
address   The starting address of the range of memory to be made resident.
count     The size, in bytes, of the range of memory to be made resident.

Description

The MakeMemoryResident function makes a portion of the address space beginning at address and having a size of count bytes resident in physical memory.

If the address parameter supplied to the MakeMemoryResident function is not on a page boundary, then it is rounded down to the nearest page boundary. Similarly, if the specified range does not end on a page boundary, the count parameter is rounded up so that the entire range of memory is made resident.

The MakeMemoryResident function makes the range of memory resident as efficiently as possible. Non-resident pages that are made resident are always marked clean.

Special Considerations

Even though MakeMemoryResident does not move or purge memory, you must not call it at interrupt time.

The specified range must be entirely in allocated space in main memory (the System and Process Manager memory partitions), or entirely in a single file-mapped space.

Assembly-Language Information

The trap macro and routine selector for the MakeMemoryResident function are:

Trap macro Selector

_MemoryDispatch	$000B

The registers on entry and exit for this routine are

Registers on entry

D0	Selector code
A0	Starting address
A1	Number of bytes to make resident

Registers on exit

D0	Result code

Result Codes

noErr                   0  No error
paramErr              -50  The address range specified is invalid
notEnoughMemoryErr   -620  There is insufficient physical memory to make entire range resident

MakeMemoryNonResident

Use the MakeMemoryNonResident function to make a portion of the address space non-resident. MakeMemoryNonResident can be used to optimize system performance by giving the Virtual Memory Manager pages which can be used to handle future page faults.

pascal OSErr MakeMemoryNonResident (void *address,
                                    unsigned long count);
 
address   The starting address of the range of memory to be made non-resident.
count     The size, in bytes, of the range of memory to be made non-resident.

Description

The MakeMemoryNonResident function makes a portion of the address space beginning at address and having a size of count bytes non-resident.

If the address parameter supplied to the MakeMemoryResident function is not on a page boundary, it is rounded up to the nearest page boundary. Similarly, if the specified range does not end on a page boundary, the count parameter is rounded down so that only pages completely contained in the range of memory are made non-resident (although all pages of the specified range are flushed). This means that less memory than was specified may be made non-resident.

All dirty pages of the specified range are first written to the backing store file and then marked valid on disk.

Any pages of the specified range that are held (with HoldMemory) or locked (with LockMemory or LockMemoryForOutput) will not be made non-resident, but are flushed.

Special Considerations

Even though MakeMemoryNonResident does not move or purge memory, you must not call it at interrupt time.

The specified range must be entirely in allocated space in main memory (the System and Process Manager memory partitions), or entirely in a single file mapped space.

Assembly-Language Information

The trap macro and routine selector for the MakeMemoryNonResident function are:

Trap macro Selector

_MemoryDispatch	$000D

The registers on entry and exit for this routine are

Registers on entry

D0	Selector code
A0	Starting address
A1	Number of bytes to make non-resident

Registers on exit

D0	Result code

Result Codes

noErr            0   No error
paramErr       -50   The address range specified is invalid

FlushMemory

Use the FlushMemory function to make a portion of the address space clean. This can be useful when you want to ensure the backing store file's data matches what is in a resident page. FlushMemory can also be used to optimize system performance by letting the Virtual Memory Manager know what pages can be made clean because they are unlikely to change again in the near future (making those pages non-resident will not require I/O in the future).

pascal OSErr FlushMemory (void *address,
                          unsigned long count);
address	  The starting address of the range of memory to flush.
count	  The size, in bytes, of the range of memory to flush.

Description

The FlushMemory function makes a portion of the address space, beginning at address and having a size of count bytes, clean. All dirty pages found in the specified range are written to the backing store file. Resident pages are left resident by FlushMemory.

If the address parameter supplied to the FlushMemory function is not on a page boundary, then it is rounded down to the nearest page boundary. Similarly, if the specified range does not end on a page boundary, the count parameter is rounded up so that the entire range of memory is flushed.

Special Considerations

Even though FlushMemory does not move or purge memory, you must not call it at interrupt time.

The specified range must be entirely in allocated space in main memory (the System and Process Manager memory partitions), or entirely in a single file mapped space.

Assembly-Language Information

The trap macro and routine selector for the FlushMemory function are:

Trap macro Selector

_MemoryDispatch	$000E

The registers on entry and exit for this routine are

Registers on entry

D0	Selector code
A0	Starting address
A1	Number of bytes to flush

Registers on exit

D0	Result code

Result Codes

noErr           0   No error
paramErr      -50   The address range specified is invalid

ReleaseMemoryData

Use the ReleaseMemoryData function to release the data of a portion of the address space. ReleaseMemoryData can be used to optimize system performance by preventing unnecessary writing to and reading from the backing store file.

pascal OSErr ReleaseMemoryData (void *address,
                                unsigned long count);
address	  The starting address of the range of memory to release.
count	  The size, in bytes, of the range of memory to release.

Description

The ReleaseMemoryData function informs the Virtual Memory Manager that a portion of the address space, beginning at address and having a size of count bytes, is no longer needed.

If the address parameter supplied to the ReleaseMemoryData function is not on a page boundary, then it is rounded up to the nearest page boundary. Similarly, if the specified range does not end on a page boundary, the count parameter is rounded down so that only pages completely contained in the range of memory are made invalidated. This means that less memory than was specified may be released.

All resident pages in the specified range are marked clean without writing their contents to the backing store file; all non-resident pages in read/write areas of the specified range are marked invalid on disk (Note: read-only file mapped areas are not invalidated on disk). Following a ReleaseMemoryData request with a MakeMemoryNonResident request makes pages in the specified range immediately available for reuse by the Virtual Memory Manager.

Special Considerations

If the released range is subsequently accessed, the values in memory will be unpredictable.

Even though ReleaseMemoryData does not move or purge memory, you should not call it at interrupt time.

The specified range must be entirely in allocated space in main memory (the System and Process Manager memory partitions), or entirely in a single file mapped space.

The Memory Manager calls ReleaseMemoryData for NewPtr, NewHandle, TempNewHandle, and InitZone requests. There's no need to duplicate the work the Memory Manager has already done.

Assembly-Language Information

The trap macro and routine selector for the ReleaseMemoryData function are:

Trap macro Selector

_MemoryDispatch	$000C

The registers on entry and exit for this routine are

Registers on entry

D0	Selector code
A0	Starting address
A1	Number of bytes to release

Registers on exit

D0	Result code

Result Codes

noErr            0   No error
paramErr       -50   The address range specified is invalid


File System Manager

The File System Manager provides a general means by which foreign file systems can be installed, identified, and interfaced to the Operating System. Mac OS 8.1 includes version 2.0 of the File System Manager, which includes a number of changes:

An updated version of the Guide to the File System Manager will be available in the near future.


DriverGestalt Additions

The DriverGestalt driver status and control calls allow drivers to provide information about the services they provide to clients of the driver.

Two new DriverGestalt selectors have been added. These new selectors allow drivers to provide information to the system about the support they provide for VM backing store and about the physical characteristics of the media they support.

The selectors are:

kdgVMOptions Returns information about VM support

kdgMediaInfo Returns information about supported media

kdgVMOptions

The kdgVMOptions DriverGestalt selector allows a disk driver to tell the Virtual Memory Manager about its support for Virtual Memory operations. The disk drive for which the driver should return information for is indicated by the value in the ioVRefNum field of the DriverGestaltParam. This is a per-drive call, not a per-driver call.

The response to this selector is a DriverGestaltVMOptionsResponse structure. The vmOptions field contain flags that, when combined and tested against the possible masks, indicate a drive's suitability for various combinations of Virtual Memory operations.

The only three valid responses to kdgVMOptions at this time are kAllowVMNoneMask, kAllowVMReadOnlyMask, and kAllowVMReadWriteMask (i.e., setting only kAllowVMWriteBit is not valid).

Important: All bits not defined here are reserved and should be set to zero until they are defined for a specific purpose.

The kdcVMOptions Driver Configure _Control call provides the ability to change a driver's response to kdgVMOptions Driver Gestalt requests. A driver should return controlErr if it doesn't want to provide the ability to change the kdgVMOptions response. If a driver supports the kdcVMOptions Driver Configure _Control call, but is asked to set an option bit that it doesn't support (for example, if a read-only device is asked to set the kAllowVMWriteBit), it should return paramErr.

struct DriverGestaltVMOptionsResponse {
    UInt32      vmOptions;
};
typedef struct DriverGestaltVMOptionsResponse DriverGestaltVMOptionsResponse;
 
/* Bits and masks for DriverGestaltVMOptionsResponse.vmOptions field */
enum {
    kAllowVMReadBit         = 0,        /* Allow VM to use this drive for read access */
    kAllowVMWriteBit        = 1,        /* Allow VM to use this drive for write access */
    kAllowVMNoneMask        = 0,
    kAllowVMReadOnlyMask    = 1 << kAllowVMReadBit,
    kAllowVMReadWriteMask   = (1 << kAllowVMReadBit) + (1 << kAllowVMWriteBit)
};

kdgMediaInfo

The kdgMediaInfo DriverGestalt selector allows a disk driver to tell the caller about physical characteristics of the device it supports. The disk drive for which the driver should return information for is indicated by the value in the ioVRefNum field of the DriverGestaltParam. This is a per-drive call, not a per-driver call.

The response to this selector is a DriverGestaltMediaInfoResponse structure. The fields in this structure contain the physical block size, the number of blocks that are of that size, and the media type for a given device.

On drives that support ejectable media, the response can change depending on what media is currently in the drive.

Note:
There are currently media types defined only for CD-ROM and DVD-ROM media. This is because the caller who cares about the media type currently only cares if it's one of these two types. Until this changes, all other media types should return kMediaTypeUnknown.

The File Manager calls this selector and uses the values returned to help determine the value it will use for the allocation block size when formatting a volume as Mac OS Extended.

struct DriverGestaltMediaInfoResponse {
    UInt32          numberBlocks;   /* number of blocks */
    UInt32          blockSize;      /* physical size of blocks */
    SInt16          mediaType;      /* media type identifier */
};
typedef struct DriverGestaltMediaInfoResponse DriverGestaltMediaInfoResponse;
 
/* DriverGestaltMediaInfoResponse.mediaType constants */
enum {
    kMediaTypeUnknown    = 128,   /* media type is unknown */
    kMediaTypeCDROM      = 129,   /* media type is a CD-ROM */
    kMediaTypeDVDROM     = 130,   /* media type is a DVD-ROM */
    kMediaTypeNoMedia    = -1     /* no media is present */
};


Mac OS Runtime for Java 2.0

MRJ 2.0 supports Sun's Java version 1.1.3 specification, which has added or improved support in the following areas:

For further information, see the Mac OS Runtime for Java site.


Open Transport 1.3

Mac OS 8.1 installs Open Transport v1.3, which contains a number of new features and bug fixes.

An updated OT 1.3 SDK and OT 1.3 Release Notes are available.

Bug fixes:

General

Open Transport Debugger Preferences (for debug version only)

AppleTalk

TCP/IP

Links

API Changes

 

CFM-68K Support

Single Link Multi-homing

Open Transport 1.3 introduces single link multi-homing, a mechanism by which Open Transport can support multiple IP addresses on the same hardware interface. Synonyms for this feature include IP Aliasing, Secondary IP address support, IP Masquerading, "Multihoming", and IP Multinode support. This is useful for sites like Internet Service Providers (ISPs), that want to give each of their clients a distinct IP address, without requiring separate computers for each address. Web server software packages or server plug-ins that utilize this feature can offer virtual domain support that supports all web browsers.

This functionality is transparent to Open Transport clients who are not specifically interested in single link multi-homing. The following information will help TCP/IP server developers implement single link multi-homing support into their products.

Important: As described below, in a multi-homed environment, if you bind to a specific IP address, you will only received connections targeted at that IP address. While this is useful if you want to support different operations on different IP addresses, most programs do not want this. If your program does not take advantage of single link multi-homing, it's important that it bind listening endpoints to the address kOTAnyInetAddress, not to a specific IP address (such as the address returned by OTInetGetInterfaceInfo). The use of kOTAnyInetAddress has always been the recommended way of binding listening endpoints, and single link multi-homing makes it important that you follow this recommendation.

Single Link Multi-homing System Setup

Single link multi-homing support is only available with Open Transport 1.3 or higher. Your product will need to check that this version of Open Transport is present. See the section Checking the Open Transport Version for details on how to check for the presence of Open Transport 1.3 or higher.

You configure a system to use multiple IP addresses as follows:

Each line of the IP Secondary Addresses file contains a secondary IP address to be used by the system, and an optional subnet mask and router address for the secondary IP address. If there is no subnet mask entry, then a default subnet mask for the IP address class will be used. If there is no router address entry, then the default router associated with the primary address will be used.

Each secondary address entry must be prefixed by "ip=". Each subnet mask entry must be prefixed by "sm=". Each router address entry must be prefixed by "rt=". An example of the contents of the IP Secondary Addresses file follows.

; 'ip=' for ip address, 'sm=' subnet mask, 'rt=' router address
;  Note: nspace in 'ip=192.168.22.200'
;
; IP address             Subnet Mask          router addresses
;-----------             -----------          ----------------
ip=192.168.22.200        sm=255.255.255.0     rt=192.168.20.1
ip=192.168.22.201                             rt=192.168.20.1
ip=192.168.22.202

The order of the entries is important. The "rt=" entry must follow the "sm=" entry if used.

When Open Transport 1.3 activates TCP/IP, the primary address will be obtained from the TCP/IP Control Panel setting. Open Transport then looks for the IP Secondary Addresses file in the Preferences folder, to determine if additional addresses should also be configured. If there are duplicate IP address entries in the IP Secondary Addresses file, the duplicated addresses will be ignored. When Open Transport binds a TCP/IP connection, if there is an address conflict of the primary or any secondary addresses with another host, Open Transport will present an error message using a dialog box and will unload Open Transport TCP/IP from memory. The error dialog will display the conflicting IP address, the hardware address of the conflicting machine and note that your TCP/IP network interface has been shut down.

Checking the Open Transport Version

To check that Open Transport version 1.3 is present, use the Gestalt function with the gestaltOpenTptVersions 'otvr' selector. Check that the result is greater or equal to kOTIPSingleLinkMultihomingVersion.

enum
{
	kOTIPSingleLinkMultihomingVersion = 0x01300000	// OT 1.3
};

InetInterfaceInfo Structure Change

The OTInetGetInterfaceInfo returns information about the local host. Under Open Transport 1.3, the InetInterfaceInfo structure has changed to allow the function to return additional information on supported secondary addresses. The new version of the structure is as follows

struct InetInterfaceInfo
{
    InetHost          fAddress;
    InetHost          fNetmask;
    InetHost          fBroadcastAddr;
    InetHost          fDefaultGatewayAddr;
    InetHost          fDNSAddr;
    UInt16            fVersion;
    UInt16            fHWAddrLen;
    UInt8*            fHWAddr;
    UInt32            fIfMTU;
    UInt8*            fReservedPtrs[2];
    InetDomainName    fDomainName;
    UInt32            fIPSecondaryCount;  // returns number of IP secondary addresses
    UInt8             fReserved[252];           
};

You can pass this new structure to the OTInetGetInterfaceInfo. On return, the fIPSecondaryCount field returns the number of secondary IP addresses configured for the system. If there are secondary addresses, use the OTInetGetSecondaryAddresses function to obtain the additional addresses.

To distinguish this structure from earlier variants, the OTInetGetInterfaceInfo sets the fVersion field to 3.

OTInetGetSecondaryAddresses

FUNCTION

 OTInetGetSecondaryAddresses return active secondary IP addresses

C INTERFACE

OSStatus OTInetGetSecondaryAddresses(InetHost* addr, UInt32* count, SInt32 index);

C++ INTERFACE

None. C++ clients use the C interface to this function.

DESCRIPTION

Parameters

Before Call

After Call

addr

x

(x)

count

(x)

(x)

index

x

/

OTInetGetSecondaryAddress is used to copy the supported secondary addresses associated with an IP interface. OTInetGetSecondaryAddress uses the index parameter to specify which IP interface to obtain secondary addresses for. For the primary IP interface, set index to kDefaultInetInterface which is -1. OTInetGetSecondaryAddress uses the count parameter to know how many secondary addresses to return in the buffer pointed to by addr. The addr buffer must be of size count * sizeof(InetAddr) to hold all of the desired addresses. Use the fIPSecondaryCount field of the InetInterfaceInfstructure returned by calling OTInetGetInterfaceInfo to determine the required size of the buffer. OTInetGetSecondaryAddress also modifies count to indicate the number of secondary addresses actually returned if less than the specified number of secondary addresses are returned.


Text Encoding Converter Manager 1.3

The Text Encoding Conversion Manager provides two facilities--the Text Encoding Converter and the Unicode Converter--that your application can use to handle text encoding conversion on the Mac OS.

For further information, see Inside Macintosh: Programming With the Text Encoding Conversion Manager.

Version 1.3 of the Text Encoding Converter Manager (TEC) is included with Mac OS 8.1. The HFS Plus volume format introduced with Mac OS 8.1 stores filenames using the canonical decomposition form of Unicode 2.0; several of the TEC 1.3 changes are to support HFS Plus.

Interface File Changes

Implementation Bug Fixes

Implementation Enhancements

Mapping Changes

Among other things, the changes listed below ensure 100% round trip fidelity for strict mapping in either direction (non-Unicode to Unicode and back or vice versa) for both Mac OS encodings and other non-Unicode encodings.

User Interface Changes


Acknowledgments

Special thanks to: Mark Cookson, Pete Gontier, Jim Luther, Barb Kozlowski, Rich Kubota, Otto Schlosser, Quinn, Ali Sazegari

Thanks also to: Cameron Birse, Sheryl Boone, Robert Bowers, Don Brady, Doug Clarke, Daniel Carr, Mark Day, Dave Evans, Dave Falkenburg, Richard V. Ford, Tim Holmes, Deric Horn, Ingrid Kelly, Barry Langdon-Lassagne, David A. Lyons, Harita Patel, Andy Poupart, Jim Reekes, Greg Scown, Erik Sea, Tim Stahlke, Steven Swenson, Allen Tuf, Chad Williams


Send feedback to devsupport apple.com
Updated: 30-January-98

Tech Support
Technotes
Previous Technote | This Technote | Next Technote | Contents

 

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help