5 Author name: Eryk Vershen
7 Description: A low-level Apple partition table editor for Linux.
8 A MacOS version exists for "standalone" use.
10 What's New: Clean up sources - fix naming, delete old email addresses
11 Added support for display of Mac volume names
12 Added cvt_pt target (for LinuxPPC team)
13 Fix block 0 display to show logical offset of drivers
14 Require confimation of quit without write
15 Fix iteration to not complain about missing devices
16 Warn when creating/writing a map with more than 15 entries
17 Make initial window larger in Mac version
18 Fix ATA support to scan buses correctly
19 Fix linux names (in MacOS) to work right when many devices
20 Change so WORM devices are considered 'CDs'
22 Last time: Added support for ATA/IDE disks without LBA capability
23 Fixed bug - create partition with unmodified size failed
24 Added support for new (DR3) MkLinux names - show MkLinux
25 name when displaying under another name and allow the
26 MkLinux name to be used on input.
28 Requirements: Linux PPC - just run the binary
29 MacOS - Distributed binaries for PowerPC or 68000
30 I haven't tried it except on 7.6.1 and 8.0
35 Modifications copyright 2000 by Eryk Vershen
37 Copyright 1996,1997,1998 by Apple Computer, Inc.
40 Permission to use, copy, modify, and distribute this software and
41 its documentation for any purpose and without fee is hereby granted,
42 provided that the above copyright notice appears in all copies and
43 that both the copyright notice and this permission notice appear in
44 supporting documentation.
46 APPLE COMPUTER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
47 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
48 FOR A PARTICULAR PURPOSE.
50 IN NO EVENT SHALL APPLE COMPUTER BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
51 CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
52 LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
53 NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
54 WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
57 Contact Info: You can send mail to the author. There is no guarantee of
58 a response, but it is your best hope of getting a bug fixed
65 READ the html file or the man page.
68 Finding out about apple partitioning
69 ------------------------------------
70 The best curently available documentation on the Apple disk partitioning scheme
71 is "Technote 1189: The Monster Disk Drive Technote". This release is not
72 completely in sync with that technote. Maybe next time.
75 Building the macintosh application
76 ----------------------------------
77 I have only built this under Code Warrior Pro. The project file is included.
78 Thanks to Martin Minow for the SCSI support code.
81 Some notes on the apple partitioning
82 ------------------------------------
83 The apple disk partitioning scheme was developed in 1986. It attempted to
84 be forward thinking as it was intended to handle drives of sizes up to several
85 hundred megabytes. There was a design document, but like most such documents
86 it was neither complete nor unambiguous.
88 While the original intent was to handle various block sizes, in practice
89 most devices use a partitioning block size of 512 bytes.
90 Since the various address fields are 32 bits unsigned this means the format
91 can handle disks up to 2 Terabytes in size. (32bits + 9 bits = 41 bits)
92 Because the format was designed around SCSI, there is no knowledge of
93 cylinders or heads, all block address are in absolute sector form.
94 A correct map should describe every block on the disk except for block zero.
96 An aside on CDROMs. Most old apple CDROMs have incorrect data in block zero.
97 Since the HFS file-system could only handle 512 byte blocks, apple drives had
98 a special mode where they would do deblocking (i.e. converting 2k blocks
99 into four 512byte blocks and accepting 512byte block addresses.) The partition
100 maps laid down on these disks are for the deblocked form. In many cases the
101 partition maps they contain have only the minimum number of fields correct.
102 At least one CDROM I have seen doesn't even contain a partition map at all,
103 but is simply an HFS volume.
104 Bootable CD-ROMs have even stranger partition maps since two are laid down:
105 one at 2K offsets and one at 512-byte offsets. If you notice that these
106 overlap then you begin to get an idea of how wierd these maps can be.
107 Apple refers to this "technique" as ghost partitioning.
109 The documentation in Inside Macintosh is only partially correct.
110 The boot-arguments field was left out. A/UX used the boot arguments field
111 for something that was called the bzb (block zero block - don't ask me why).
112 This structure evolved over the course of A/UX. I have recapitulated this
113 in the dpme.h header file.
116 Making a disk with Apple & Intel partitioning
117 ---------------------------------------------
118 Don't cringe. I know it is an awful hack, but sometimes...
119 While I don't recommend doing this, it can be useful.
120 The procedure below is what we did.
122 The intel map can contain NO MORE THAN FOUR PRIMARY PARTITIONS.
123 You can't have any extended or logical partitions. (Well, you might get it
124 to work but I wouldn't want to try it.) The disk will NOT BE INTEL BOOTABLE.
126 1) Use pdisk to initialize an apple partition map. Don't add any partitions
127 yet, just write the map out and quit.
129 2) Use fdisk to create the primary partitions. Go into the expert 'x' menu
130 in fdisk and print out the table with the sector addresses. Write the
131 start and lengths down some where. Write the table out.
133 3) Use pdisk again. Shrink the partition map down, if necessary, so it
134 does not overlap any intel partition. Create an apple partition for each
135 intel partition using the start and length value you got from fdisk.
136 Write out the map and quit.
138 At present file systems are not compatible between Linux & MkLinux, but you
139 can tar stuff into these partitions and tar them out on another machine.