1 /* @(#)low.h 1.1 00/03/05 joerg */ 2 /* 3 * hfsutils - tools for reading and writing Macintosh HFS volumes 4 * Copyright (C) 1996, 1997 Robert Leslie 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 */ 20 21 typedef struct { 22 Integer sbSig; /* device signature (should be 0x4552) */ 23 Integer sbBlkSize; /* block size of the device (in bytes) */ 24 LongInt sbBlkCount; /* number of blocks on the device */ 25 Integer sbDevType; /* reserved */ 26 Integer sbDevId; /* reserved */ 27 LongInt sbData; /* reserved */ 28 Integer sbDrvrCount; /* number of driver descriptor entries */ 29 LongInt ddBlock; /* first driver's starting block */ 30 Integer ddSize; /* size of the driver, in 512-byte blocks */ 31 Integer ddType; /* driver operating system type (MacOS = 1) */ 32 Integer ddPad[243]; /* additional drivers, if any */ 33 } Block0; 34 35 typedef struct { 36 Integer bbID; /* boot blocks signature */ 37 LongInt bbEntry; /* entry point to boot code */ 38 Integer bbVersion; /* boot blocks version number */ 39 Integer bbPageFlags; /* used internally */ 40 Str15 bbSysName; /* System filename */ 41 Str15 bbShellName; /* Finder filename */ 42 Str15 bbDbg1Name; /* debugger filename */ 43 Str15 bbDbg2Name; /* debugger filename */ 44 Str15 bbScreenName; /* name of startup screen */ 45 Str15 bbHelloName; /* name of startup program */ 46 Str15 bbScrapName; /* name of system scrap file */ 47 Integer bbCntFCBs; /* number of FCBs to allocate */ 48 Integer bbCntEvts; /* number of event queue elements */ 49 LongInt bb128KSHeap; /* system heap size on 128K Mac */ 50 LongInt bb256KSHeap; /* used internally */ 51 LongInt bbSysHeapSize; /* system heap size on all machines */ 52 Integer filler; /* reserved */ 53 LongInt bbSysHeapExtra; /* additional system heap space */ 54 LongInt bbSysHeapFract; /* fraction of RAM for system heap */ 55 } BootBlkHdr; 56 57 typedef struct { 58 Integer pmSig; /* partition signature (0x504d or 0x5453) */ 59 Integer pmSigPad; /* reserved */ 60 LongInt pmMapBlkCnt; /* number of blocks in partition map */ 61 LongInt pmPyPartStart; /* first physical block of partition */ 62 LongInt pmPartBlkCnt; /* number of blocks in partition */ 63 Char pmPartName[33]; /* partition name */ 64 Char pmParType[33]; /* partition type */ 65 /* 66 * Apple_partition_map partition map 67 * Apple_Driver device driver 68 * Apple_Driver43 SCSI Manager 4.3 device driver 69 * Apple_MFS Macintosh 64K ROM filesystem 70 * Apple_HFS Macintosh hierarchical filesystem 71 * Apple_Unix_SVR2 Unix filesystem 72 * Apple_PRODOS ProDOS filesystem 73 * Apple_Free unused 74 * Apple_Scratch empty 75 */ 76 LongInt pmLgDataStart; /* first logical block of data area */ 77 LongInt pmDataCnt; /* number of blocks in data area */ 78 LongInt pmPartStatus; /* partition status information */ 79 LongInt pmLgBootStart; /* first logical block of boot code */ 80 LongInt pmBootSize; /* size of boot code, in bytes */ 81 LongInt pmBootAddr; /* boot code load address */ 82 LongInt pmBootAddr2; /* reserved */ 83 LongInt pmBootEntry; /* boot code entry point */ 84 LongInt pmBootEntry2; /* reserved */ 85 LongInt pmBootCksum; /* boot code checksum */ 86 Char pmProcessor[17];/* processor type */ 87 Integer pmPad[188]; /* reserved */ 88 } Partition; 89 90 int l_lockvol __PR((hfsvol *)); 91 92 int l_readblock0 __PR((hfsvol *)); 93 int l_readpm __PR((hfsvol *)); 94 95 int l_readmdb __PR((hfsvol *)); 96 int l_writemdb __PR((hfsvol *)); 97 98 int l_readvbm __PR((hfsvol *)); 99 int l_writevbm __PR((hfsvol *)); 100