|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. ! 3: * ! 4: * @APPLE_LICENSE_HEADER_START@ ! 5: * ! 6: * Portions Copyright (c) 1999 Apple Computer, Inc. All Rights ! 7: * Reserved. This file contains Original Code and/or Modifications of ! 8: * Original Code as defined in and that are subject to the Apple Public ! 9: * Source License Version 1.1 (the "License"). You may not use this file ! 10: * except in compliance with the License. Please obtain a copy of the ! 11: * License at http://www.apple.com/publicsource and read it before using ! 12: * this file. ! 13: * ! 14: * The Original Code and all software distributed under the License are ! 15: * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER ! 16: * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, ! 17: * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, ! 18: * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the ! 19: * License for the specific language governing rights and limitations ! 20: * under the License. ! 21: * ! 22: * @APPLE_LICENSE_HEADER_END@ ! 23: */ ! 24: ! 25: /* ! 26: File: DiskInitInternal.h ! 27: ! 28: Contains: IPI for HFS Disk Initialization ! 29: ! 30: Version: HFS Plus 1.0 ! 31: ! 32: Copyright: � 1996-1998 by Apple Computer, Inc., all rights reserved. ! 33: ! 34: File Ownership: ! 35: ! 36: DRI: Don Brady ! 37: ! 38: Other Contact: Mark Day ! 39: ! 40: Technology: File Systems ! 41: ! 42: Writers: ! 43: ! 44: (DSH) Deric Horn ! 45: (msd) Mark Day ! 46: (djb) Don Brady ! 47: ! 48: Change History (most recent first): ! 49: ! 50: <CS11> 10/29/97 djb Add clump size factor. Increase kMinHFSPlusVolumeSize to 32 MB. ! 51: <CS10> 10/23/97 msd Bug 1685113. Add a createDate parameter to ! 52: InitializeHFSPlusVolume. ! 53: <CS9> 9/26/97 DSH Moved HFSPlusDefaults to DiskInit.i ! 54: <CS8> 9/5/97 msd Add a parameter to InitHFSVolume to indicate alignment of ! 55: allocation blocks. ! 56: <CS7> 9/4/97 msd In HFSPlusDefaults, specify the clump and node sizes of the ! 57: attributes file. Bump kHFSPlusDefaultsVersion to 1. ! 58: <CS6> 7/18/97 msd Include DiskInit.h. ! 59: <CS5> 7/2/97 msd Add prototype for GetMediaInfo driver status call. ! 60: <CS4> 6/17/97 msd Change minimum HFS Plus volume size to 2 MB (so we can test with ! 61: RAM disks). Added version and flags fields to HFSPlusDefaults. ! 62: <CS3> 6/11/97 msd Remove the #pragma load; this should be done by source files, ! 63: and generally not interface files. (Allows the test tools to ! 64: build separately from HFS Plus.) ! 65: <CS2> 6/6/97 djb Change kMinHFSVolumeSize to kMinHFSPlusVolumeSize and make it ! 66: 20MB ! 67: <CS1> 4/28/97 djb first checked in ! 68: <HFS5> 3/3/97 djb Add new fields to DriveInfo and HFSPlusDefaults. ! 69: <HFS4> 12/19/96 djb Changed kMinHFSVolumeSize so we can make HFS+ floppies for ! 70: debugging. ! 71: <HFS3> 12/10/96 msd Check PRAGMA_LOAD_SUPPORTED before loading precompiled headers. ! 72: <HFS2> 12/4/96 DSH Precompiled Headers ! 73: <HFS1> 12/4/96 djb first checked in ! 74: */ ! 75: ! 76: #ifndef __DISKINITINTERNAL__ ! 77: #define __DISKINITINTERNAL__ ! 78: ! 79: #include <Types.h> ! 80: #include <DiskInit.h> ! 81: ! 82: ! 83: enum { ! 84: kHFS1440KAltFormatStrID = -6077, ! 85: kHFS800KAltFormatStrID = -6076, ! 86: kMacintoshStrID = -6075, // Macintosh name StrID ! 87: kHFS720KFormatStrID = -6074, // Format name string for 720K HFS ! 88: kHFS720KAltFormatStrID = -6073 // HFS Alternate Format string for 720K HFS ! 89: }; ! 90: ! 91: enum { ! 92: kMinHFSPlusVolumeSize = (32*1024*1024), // 32 MB ! 93: ! 94: kBytesPerSector = 512, // default block size ! 95: kBitsPerSector = 4096, // 512 * 8 ! 96: kLog2SectorSize = 9, // log2 of 512 when sector size = 512 ! 97: ! 98: kHFSPlusDataClumpFactor = 16, ! 99: kHFSPlusRsrcClumpFactor = 16 ! 100: }; ! 101: ! 102: ! 103: struct DriveInfo { ! 104: SInt16 driveNumber; ! 105: SInt16 driverRefNum; ! 106: UInt32 totalSectors; ! 107: UInt32 sectorSize; ! 108: UInt32 sectorOffset; ! 109: }; ! 110: typedef struct DriveInfo DriveInfo; ! 111: ! 112: ! 113: ! 114: // ! 115: // The following is a new driver status call that returns a device's actual block ! 116: // size. It should be moved to some other interface file so third parties can ! 117: // support it. ! 118: // ! 119: enum { csGetMediaInfo = 128 }; ! 120: typedef struct GetMediaCapCntrlParam { ! 121: QElem *qLink; ! 122: short qType; ! 123: short ioTrap; ! 124: Ptr ioCmdAddr; ! 125: IOCompletionUPP ioCompletion; /* completion routine addr (0 for synch calls) */ ! 126: OSErr ioResult; /* result code */ ! 127: StringPtr ioNamePtr; ! 128: short ioVRefNum; /* drive number */ ! 129: short ioRefNum; /* refNum for I/O operation */ ! 130: short csCode; /* word for control status code */ ! 131: struct { ! 132: unsigned long numBlks; // number of blocks on media ! 133: unsigned long blksize; // block size in that session ! 134: short mediaType; // block size in that session ! 135: } csParam; /* operation-defined parameters */ ! 136: } GetMediaCapCntrlParam; ! 137: ! 138: ! 139: // ! 140: // Exported function prototypes ! 141: // ! 142: ! 143: pascal OSErr HFSDiskInitComponent (short whatFunction, void *paramBlock, void *fsdGlobalPtr); ! 144: ! 145: OSErr InitHFSVolume (const DriveInfo *driveInfo, ConstStr31Param volumeName, HFSDefaults *defaults, UInt32 alignment); ! 146: ! 147: OSErr InitializeHFSPlusVolume (const DriveInfo *driveInfo, ConstStr31Param volumeName, HFSPlusDefaults *defaults, UInt32 createDate); ! 148: ! 149: ! 150: #endif /* __DISKINITINTERNAL__ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.