Newsgroups: comp.sys.apple2 Path: news.uiowa.edu!hobbes.physics.uiowa.edu!math.ohio-state.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!waikato!comp.vuw.ac.nz!actrix.gen.nz!dempson From: dempson@atlantis.actrix.gen.nz (David Empson) Subject: Re: Apple][ SCSI Message-ID: Sender: news@actrix.gen.nz (News Administrator) Organization: Actrix Information Exchange Date: Tue, 21 Mar 1995 10:50:22 GMT References: <3kk85k$jve@sue.cc.uregina.ca> X-Nntp-Posting-Host: atlantis.actrix.gen.nz Lines: 34 In article <3kk85k$jve@sue.cc.uregina.ca>, charles macdonald wrote: > > Does anyone out there know if I'm limited to the 128M in 4 partitions > on the Apple][ SCSI or if there is some way around this limit. It really depends on the partitioning software. With the software supplied with the original Apple SCSI card, you can only create two partitions (64 MB in total). With the software supplied with the high-speed card, you can only create four partitions (128 MB in total). If you can get a third-party utility which can create more partitions (or find someone nearby who has the necessary software and can do this for you) then you can go up to seven partitions (224 MB) with the original SCSI card, or at least nine (depending on the partitioning software) with the high-speed card. You will usually be limited to 11 partitions in total on all drives, because there are only 11 spare entries in the ProDOS drive table (assuming a 128k machine, one 5.25" controller and no other disk drives or standard slot RAM cards). Nine partitions would be 288 MB, eleven would be 352 MB. To be able to use more than four partitions with an Apple SCSI card, you must be running ProDOS-8 2.0.1 or later, which requires an enhanced IIe. With earlier versions, you can only get four partitions if the SCSI card is in slot 5. If it is in another slot, you will only be able to access two partitions. -- David Empson dempson@actrix.gen.nz Snail mail: P.O. Box 27-103, Wellington, New Zealand Newsgroups: comp.sys.apple2 Path: news.uiowa.edu!uunet!EU.net!news.sprintlink.net!cs.utexas.edu!uwm.edu!lll-winken.llnl.gov!enews.sgi.com!decwrl!waikato!comp.vuw.ac.nz!actrix.gen.nz!dempson From: dempson@atlantis.actrix.gen.nz (David Empson) Subject: Re: Disk Format Message-ID: Sender: news@actrix.gen.nz (News Administrator) Organization: Actrix Information Exchange Date: Fri, 24 Mar 1995 14:54:34 GMT References: <3kpf4o$387@senator-bedfellow.MIT.EDU> X-Nntp-Posting-Host: atlantis.actrix.gen.nz Lines: 67 In article <3kpf4o$387@senator-bedfellow.MIT.EDU>, Paul H Bauer wrote: > I am trying to find out the physical arrangement of data and directory > information on a disk partition and where it is located on the disk. On an unpartitioned disk (e.g. a small hard drive, or a floppy), the logical block numbers correspond to the physical block numbers. The boot block is at physical block 0, the directory starts at physical block 2, etc. In detail, the first few blocks on a ProDOS volume are: 0 Boot block (boot code) 1 Unused (can contain Apple /// boot code on a 5.25" disk) 2-5 Root directory 6-N Volume Bitmap (free space list) The first entry in the root directory contains the volume name and size in blocks. The size of the volume directory is determined by the number of blocks on the disk. One block is required in the volume bitmap for every 4096 disk blocks (8 bits per byte times 512 bytes per block). The data area starts immediately after the bitmap. Subdirectories, file data blocks and file index blocks are scattered throughout the remainder of the disk. On a partitioned disk (assuming we are talking about Apple's SCSI partitioning), physical block 0 contains the "device descriptor map", which is used to locate Macintosh device drivers. The partition table starts at physical block 1, with one block per partition (there are usually several unused blocks at the end of the partition table, to allow for more partitions to be added). The partition table is regarded as a partition, and requires one entry in the partition table. Every user partition (e.g. ProDOS or HFS volume), device driver and free area also requires an entry. Each subsequent partition is a contiguous range of blocks on the drive, starting immediately after the previous partition. When you access a partitioned drive from ProDOS or GS/OS, you never get to see the DDM or partition map - you can only see the logical blocks within the partitions. If you ask for block 0, you will get logical block 0 of the partition, which contains the boot code as normal. Accessing the DDM or partition map requires special calls to the device driver or SmartPort firmware. This is much easier under GS/OS with Apple's drivers, because they have provided calls for this purpose. Under ProDOS-8 with an Apple high-speed SCSI card, the only way to read the partition map is to use the "Generic SCSI" call to do a direct SCSI READ operation on the appropriate physical block range. This is NOT easy, and requires the technical reference manual for the HS SCSI card, and documentation on the SCSI command set. With the original Apple SCSI card, it is even harder, because you have to download code to do the SCSI READ into the memory of the SCSI card, and arrange for it to be run from there. I have no idea how you could access the partition map with a RamFAST (either from GS/OS or using the SmartPort firmware). -- David Empson dempson@actrix.gen.nz Snail mail: P.O. Box 27-103, Wellington, New Zealand Path: news.uiowa.edu!chi-news.cic.net!news.uoregon.edu!cie-2.uoregon.edu!nparker From: nparker@cie-2.uoregon.edu (Neil Parker) Newsgroups: comp.sys.apple2 Subject: Re: where on the disk is ProDOS partitioning information stored? Date: 1 Nov 1995 09:29:19 GMT Organization: University of Oregon Campus Information Exchange Lines: 58 Distribution: world Message-ID: <477elf$6ig@pith.uoregon.edu> References: <4736uv$7qt@aplinfo.jhuapl.edu> NNTP-Posting-Host: cie-2.uoregon.edu In article <4736uv$7qt@aplinfo.jhuapl.edu> Robert Jensen writes: >When a ProDOS disk is partitioned into multiple volumes, where >and how is the partitioning information stored? Or, where and >how is the answer to my question stored? The answer to your question is stored in several different places--the Apple IIGS GS/OS Device Driver Reference, and Inside Mac (both the old version--around volume IV or V, I think--and the new black version). The Inside Mac documentation is more complete than the GS/OS Device Driver Reference. Apple's standard partitioning scheme is currently supported only for SCSI disks. A partitioned disk starts with a "Device Descriptor Map" located at the beginning of physical block 0, which has the following layout: Byte Purpose ---- ------- 0 (1 byte) signature, always $45 (ASCII "E") 1 (1 byte) signature, always $52 (ASCII "R") 2 (2 bytes) device's block size, in bytes 4 (4 bytes) number of blocks on device 8 (8 bytes) reserved 16 (2 bytes) number of driver descriptors following This structure may optionally be followed by one or more driver descriptors, which describe the locations on disk of any Macintosh device drivers on the disk. Each device driver descriptor has the following layout: Byte Purpose ---- ------- +0 (4 bytes) starting block of device driver +4 (2 bytes) size of device driver in blocks +6 (2 bytes) driver type (1=Macintosh) A disk used on an Apple II need not have any device driver descriptors at all, but such a disk will not be recognized on a Macintosh. The Partition Map starts in physical block 1, and contains one block for every partition on the disk. Note that the Partition Map itself is a partition, and must have an entry in the Partition Map (but physical block 0, containing the Device Descriptor Map, is not part of any partition, and has no Partition Map entry). Each block of the Partition Map contains exactly one Partition Map entry which describes the characteristics of a single partition, including the partition's starting block address and length. Partition Map entries are a bit lengthier than what I feel like typing in tonight...I recommend reading the GS/OS Device Driver Reference or Inside Macintosh for the full details. - Neil Parker -- Neil Parker, nparker@{cie-2,cie}.uoregon.edu, http://cie-2.uoregon.edu/~nparker "Evolution is vastly overrated." -- Ambassador Delenn, _Babylon_5_ Newsgroups: comp.sys.apple2 Path: news.uiowa.edu!chi-news.cic.net!newsfeed.internetmci.com!in2.uu.net!comp.vuw.ac.nz!actrix.gen.nz!dempson From: dempson@atlantis.actrix.gen.nz (David Empson) Subject: Re: where on the disk is ProDOS partitioning information stored? Message-ID: Sender: news@actrix.gen.nz (News Administrator) Organization: Actrix - Internet Services Date: Sat, 4 Nov 1995 13:42:24 GMT References: <4736uv$7qt@aplinfo.jhuapl.edu> <47dr6r$hrv@gap.cco.caltech.edu> X-Nntp-Posting-Host: atlantis.actrix.gen.nz Lines: 109 In article <47dr6r$hrv@gap.cco.caltech.edu>, Nathan Mates wrote: > In article <4736uv$7qt@aplinfo.jhuapl.edu>, > Robert Jensen wrote: > >When a ProDOS disk is partitioned into multiple volumes, where > >and how is the partitioning information stored? Or, where and > >how is the answer to my question stored? > > It's not located anywhere within the partitions themselves; scsi > retains a few blocks as a sorta directory of contents for the disk. > Only by some very low-level scsi commands to go out to disk, and read > the partition table directly can you get at it. > > I've never seen this info documented; your best bets might be > either some very technical scsi manuals, or disassembling partitioning > programs. The partitioning scheme used on Apple II and Mac is documented in the GS/OS Device Driver Reference, and also in the Inside Mac series. (In the original series, it was covered most fully in Inside Mac Volume 5. I haven't seen the newer versions, but it is probably in the same manual that documents the SCSI Manager.) In short, the partition map resides on the first few physical blocks of the hard drive. Physical block zero contains the "device descriptor map", which contains information used by the Macintosh to locate the device drivers on the disk. The partition map starts on physical block 1. There is one block used for each partition map entry (usually with several unused blocks to allow further partitions to be added). Each entry indicates the physical location and size of the partition, and the type of data stored in the partition (any of "partition map", "driver", "free", or a specific file system). The partition map is itself counted as a partition - all blocks from 1 to the end of the disk must be listed in the partition map. On the Macintosh (at least, in older machines), the boot code in the ROM doesn't know about partitioning - all it knows is how to read the device descriptor map and to locate the device driver. This is read into memory, and takes over for further accesses to the drive. One of its first actions is to read the partition map into memory. On the Apple II under ProDOS-8, the SCSI card firmware is responsible for dealing with partitions. When the system is booted, the SCSI card looks at the drive to see if there is a partition map (there are specific ID bytes at the start of each entry). If not, the drive is assumed to be unpartitioned, and is treated as a single volume. If a partition map is detected, it is read by the firmware, and a logical volume is set up for each ProDOS partition. Other file systems and other types of partitions are ignored. (With the Apple High-Speed SCSI card, at least one volume is always created, even if there are no ProDOS partitions. I don't know how the RamFast and original Apple SCSI card act.) Subsequently, ProDOS-8 (through the driver on the SCSI card) treats each partition as a separate volume. It has no knowledge of the fact that the volumes are partitions on the same physical drive. The driver on the SCSI card only provides access to the blocks within the partitions, so you do not have direct access to the partition map (unless special calls are used). If you re-partition the drive, the partitioning software reinitializes the SCSI firmware, which causes the partition map to be re-read, and volumes to be reassigned if necessary. Under GS/OS (with an Apple SCSI card), the SCSI Manager and drivers take over all access to the SCSI drive once they have been loaded. SCSIHD.Driver deals with the partition map, and as with ProDOS-8, allows access to each file system partition on the drive (it obviously recognises HFS and ProDOS partitions, but I'm not sure how it would react to another file system, such as A/UX). As with ProDOS-8, direct access to the partition map requires the use of special calls (this is much easier under GS/OS with the Apple drivers than it is under ProDOS-8). When you repartition the drive with Advanced Disk Utility, special driver calls are used, which causes the driver to re-read the partition map, as with partitioning software under ProDOS-8. There is sufficient documentation in the GS/OS Reference + GS/OS Device Driver Reference + Programmer's Guide for System 6.0.1 to be able to write your own version of ADU (for use with the Apple SCSI drivers under GS/OS). It is a different matter under ProDOS-8. You need the technical reference manual for the appropriate SCSI card (I don't think the manual for the original Apple SCSI card is available any more, but Byte Works might be able to supply it). With the Apple High-Speed SCSI card, you also need documentation on the SCSI command set (the SCSI-1 and SCSI-2 standards), as access to the partition map involves a "direct SCSI" call to the firmware, using a SCSI READ call with the appropriate block range. With the original Apple SCSI card, there is a special option provided by the firmware which disables the normal partition mapping, and allows direct access to the physical blocks on the disk using the normal SmartPort BlockRead and BlockWrite calls. -- David Empson dempson@actrix.gen.nz Snail mail: P.O. Box 27-103, Wellington, New Zealand