Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Files /
Chapter 5 - Disk Initialization Manager


Summary of the Disk Initialization Manager

Pascal Summary

Data Types

HFS Defaults Record

TYPE HFSDefaults =
RECORD
   sigWord:    PACKED ARRAY[0..1] OF Byte;   {signature word}
   abSize:     LongInt;                      {allocation block size in bytes}
   clpSize:    LongInt;                      {clump size in bytes}
   nxFreeFN:   LongInt;                      {next free file number}
   btClpSize:  LongInt;                      {B*-tree clump size in bytes}
   rsrv1:      Integer;                      {reserved}
   rsrv2:      Integer;                      {reserved}
   rsrv3:      Integer;                      {reserved}
END;

Routines

Loading and Unloading the Disk Initialization Manager

PROCEDURE DILoad;
PROCEDURE DIUnload;

Initializing a Disk

FUNCTION DIBadMount		(where: Point; evtMessage: LongInt): Integer;

Low-Level Disk-Initialization Routines

FUNCTION DIFormat		(drvNum: Integer): OSErr;
FUNCTION DIVerify		(drvNum: Integer): OSErr;
FUNCTION DIZero			(drvNum: Integer; volName: Str255): OSErr;

C Summary

Data Types

HFS Defaults Record

struct HFSDefaults {
      char        sigWord[2];    /*signature word*/
      long        abSize;        /*allocation block size in bytes*/
      long        clpSize;       /*clump size in bytes*/
      long        nxFreeFN;      /*next free file number*/
      long        btClpSize;     /*B-Tree clump size in bytes*/
      short       rsrv1;         /*reserved*/
      short       rsrv2;         /*reserved*/
      short       rsrv3;         /*reserved*/
};
typedef struct HFSDefaults HFSDefaults;

Routines

Loading and Unloading the Disk Initialization Package

pascal void DILoad	(void);
pascal void DIUnload	(void);

Initializing a Disk

pascal short DIBadMount	(Point where, long evtMessage);

Low-Level Disk-Initialization Routines

pascal OSErr DIFormat	(short drvNum);
pascal OSErr DIVerify	(short drvNum);
pascal OSErr DIZero	(short drvNum, const Str255 volName);

Assembly-Language Summary

Data Structures

HFSDefaults Data Structure
0sigWordwordsignature word
2abSizelongallocation block size in bytes
6clpSizelongclump size in bytes
10nxFreeFNlongnext free file number
14btClpSizelongB*-tree clump size in bytes
18rsrv1wordreserved
20rsrv2wordreserved
22rsrv3wordreserved

Trap Macros

Trap Macro Requiring Routine Selectors

_Pack2 
SelectorRoutine
$0000DIBadMount
$0002DILoad
$0004DIUnload
$0006DIFormat
$0008DIVerify
$000ADIZero

Global Variables
FmtDefaultslongPointer to substitute values for hierarchical volume directories.

Result Codes
[no name]2Disk in specified drive is already mounted
[no name]1User canceled initializing
noErr0No error
ioErr-36I/O error
paramErr-50Drive number specified is bad
volOnLinErr-55Volume is already online
nsDrvErr-56No such drive
noMacDskErr-57Disk is not a Macintosh disk
extFSErr-58Disk has external file system
badMDBErr-60Master directory block is bad
lastDskErr-64Last of the range of low-level disk errors
firstDskErr-84First of the range of low-level disk errors
memFullErr-108Not enough memory


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996