Name Date Size #Lines LOC

..--

pdisk.mac.data/H--

ATA_media.cH A D23-Mar-201329.3 KiB1,241953

ATA_media.hH A D23-Mar-20131.4 KiB6510

DoSCSICommand.cH A D23-Mar-201319 KiB650430

DoSCSICommand.hH A D23-Mar-20133.2 KiB13156

HISTORYH A D23-Mar-20132.5 KiB6956

MacSCSICommand.hH A D23-Mar-201316.4 KiB421281

READMEH A D23-Mar-20136 KiB148111

SCSI_media.cH A D23-Mar-201323.5 KiB1,110860

SCSI_media.hH A D23-Mar-20131.5 KiB6611

bitfield.cH A D23-Mar-20132.3 KiB10334

bitfield.hH A D23-Mar-20131.9 KiB745

convert.cH A D23-Mar-20134.8 KiB207124

convert.hH A D23-Mar-20131.5 KiB667

cvt_pt.cH A D23-Mar-20133.8 KiB204126

deblock_media.cH A D23-Mar-20138.1 KiB336227

deblock_media.hH A D23-Mar-20131.2 KiB605

dpme.hH A D23-Mar-20138 KiB216124

dump.cH A D23-Mar-201322 KiB907741

dump.hH A D23-Mar-20131.7 KiB7318

errors.cH A D23-Mar-20133.6 KiB17985

errors.hH A D23-Mar-20131.4 KiB639

file_media.cH A D23-Mar-201312.2 KiB579422

file_media.hH A D23-Mar-20131.3 KiB616

hfs_misc.cH A D23-Mar-20136.5 KiB256169

hfs_misc.hH A D23-Mar-2013381 425

io.cH A D10-Aug-20237.9 KiB465343

io.hH A D23-Mar-20131.7 KiB6814

layout_dump.cH A D23-Mar-20134.2 KiB182111

layout_dump.hH A D23-Mar-20131.5 KiB7919

makefileH A D23-Mar-20134 KiB213157

media.cH A D23-Mar-20133.4 KiB229132

media.hH A D23-Mar-20134.1 KiB14048

partition_map.cH A D20-Oct-201334.7 KiB1,4371,180

partition_map.hH A D23-Mar-20133.5 KiB12365

pathname.cH A D23-Mar-20135.4 KiB249145

pathname.hH A D23-Mar-20131.3 KiB638

pdisk.8H A D23-Mar-20136.4 KiB241240

pdisk.cH A D23-Mar-201326 KiB1,168996

pdisk.hH A D23-Mar-20131.2 KiB584

pdisk.htmlH A D23-Mar-201314.4 KiB407305

pdisk.mac.binHD23-Mar-201362.5 KiB

pdisk.rH A D23-Mar-20138.3 KiB235213

util.cH A D23-Mar-20133.6 KiB16689

util.hH A D23-Mar-20131.4 KiB639

validate.cH A D23-Mar-201310.3 KiB509361

validate.hH A D23-Mar-20131.2 KiB605

version.hH A D23-Mar-20132.2 KiB8310

README

1Product name:	pdisk
2Version:	0.8
3Ship date:	16 May 2000
4Company name:	n/a
5Author name:	Eryk Vershen
6
7Description:	A low-level Apple partition table editor for Linux.
8		A MacOS version exists for "standalone" use.
9
10What'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'
21
22Last 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.
27
28Requirements:	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
31
32Price:		Free
33
34Legalese:
35    Modifications copyright 2000 by Eryk Vershen
36
37    Copyright 1996,1997,1998 by Apple Computer, Inc.
38    All Rights Reserved
39
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.
45
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.
49
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.
55
56
57Contact 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
59		or a feature added.
60
61
62Other info:
63
64
65READ the html file or the man page.
66
67
68Finding out about apple partitioning
69------------------------------------
70The best curently available documentation on the Apple disk partitioning scheme
71is "Technote 1189: The Monster Disk Drive Technote".  This release is not
72completely in sync with that technote.  Maybe next time.
73
74
75Building the macintosh application
76----------------------------------
77I have only built this under Code Warrior Pro.  The project file is included.
78Thanks to Martin Minow for the SCSI support code.
79
80
81Some notes on the apple partitioning
82------------------------------------
83The apple disk partitioning scheme was developed in 1986. It attempted to
84be forward thinking as it was intended to handle drives of sizes up to several
85hundred megabytes.  There was a design document, but like most such documents
86it was neither complete nor unambiguous.
87
88While the original intent was to handle various block sizes, in practice
89most devices use a partitioning block size of 512 bytes.
90Since the various address fields are 32 bits unsigned this means the format
91can handle disks up to 2 Terabytes in size.  (32bits + 9 bits = 41 bits)
92Because the format was designed around SCSI, there is no knowledge of
93cylinders or heads, all block address are in absolute sector form.
94A correct map should describe every block on the disk except for block zero.
95
96An aside on CDROMs.  Most old apple CDROMs have incorrect data in block zero.
97Since the HFS file-system could only handle 512 byte blocks, apple drives had
98a special mode where they would do deblocking (i.e. converting 2k blocks
99into four 512byte blocks and accepting 512byte block addresses.)  The partition
100maps laid down on these disks are for the deblocked form.  In many cases the
101partition maps they contain have only the minimum number of fields correct.
102At least one CDROM I have seen doesn't even contain a partition map at all,
103but is simply an HFS volume.
104Bootable CD-ROMs have even stranger partition maps since two are laid down:
105one at 2K offsets and one at 512-byte offsets.  If you notice that these
106overlap then you begin to get an idea of how wierd these maps can be.
107Apple refers to this "technique" as ghost partitioning.
108
109The documentation in Inside Macintosh is only partially correct.
110The boot-arguments field was left out.  A/UX used the boot arguments field
111for something that was called the bzb (block zero block - don't ask me why).
112This structure evolved over the course of A/UX.  I have recapitulated this
113in the dpme.h header file.
114
115
116Making a disk with Apple & Intel partitioning
117---------------------------------------------
118Don't cringe. I know it is an awful hack, but sometimes...
119While I don't recommend doing this, it can be useful.
120The procedure below is what we did.
121
122The intel map can contain NO MORE THAN FOUR PRIMARY PARTITIONS.
123You can't have any extended or logical partitions.  (Well, you might get it
124to work but I wouldn't want to try it.)  The disk will NOT BE INTEL BOOTABLE.
125
1261) Use pdisk to initialize an apple partition map.  Don't add any partitions
127   yet, just write the map out and quit.
128
1292) 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.
132
1333) 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.
137
138At present file systems are not compatible between Linux & MkLinux, but you
139can tar stuff into these partitions and tar them out on another machine.
140
141
142
143Good luck,
144
145-eryk vershen
146 software mechanic
147 eryk@cfcl.com
148