-- A partition is part of the storage area on a disk. Disk partitions provide some protection to disk files. A blunder in one partition will not ruin files in another partition. The `root' is the area of the disk that has not been set aside in partitions, it is the starting place and has the regular disk directory. Think of sub-directories as branching off from the root. If the directory in the root area is destroyed, there is no good way to get to the partitions. This is a good reason for NOT working in the root area. In a directory, a partition looks like a file, with type CBM.
Disk partitions allow sub-directories, but there is no access between directories. You can only work within, and operate on files within, one partition at any time. This is just as if each partition was a floppy that you put in the drive one at a time. Having sub-directories allows large numbers of files, far more than the 144 limit of one small directory. Sub-directories are also a convenience, you do not have to look at a long list of files with various subjects, if you partition for each subject.
A partition does not need to have a directory, unless you intend to store files in it. A BOOT track, or sector, does not need a directory. Bad blocks can be partitioned off, without any directory, so that they will not be used. An area of the disk can be partitioned and used for `hidden' storage of data with no directory and no file names, in user defined 'RANDOM' files. The VALIDATE and COLLECT commands bypass partitions, so that the partitions are not turned into free blocks. To VALIDATE inside a partition, the drive must be selected into the partition, first.
There are three aspects to partitions; design, creation, and use.
PARTITION AID comes with the drive and will send the drive into a
partition, with a sub-directory, so that you can work in those files.
OPEN PARTITION is a very short BASIC program for selecting, or
opening, one of four partitions on a disk. If PARTITION MAKER is
modified to use the same partition names, they will be a useful pair;
one for creating and one for selecting.
PARTITION KEYS will set up the function keys on a 128 to make partition
use easy. It is a short BASIC program that gives key definitions for:
F1 Read drive status message F4 Read Directory of Unit 9 F7 Go to a partition; by name F8 Go back to the rootThese keys will save typing disk drive commands.
This is the command to get back to the root: OPEN 1,8,15,"/"
This command goes to the partition named "PX": OPEN 1,8,15,"/0:PX"
You can only go into a partition that is in the directory that is selected. If there are several levels of sub-directories, go down one level at a time. To go up, go all the way to the root and then work down to the needed level.
The drive must be given certain data to create a partition: /0: Command for partitions name Name for the partition TS Starting Track number SS Starting Sector number SL,SH Number of sectors (low & high) C File type, for CBM in directoryThe data must be sent as a drive command, so it must be sent with a secondary (channel) address of 15, to the correct drive unit number, such as 8. An example, with name = PX, is:
A directory partition must be setup in certain ways.
It must be formatted, to make its directory, before use. It must start on sector (block) 0 of a track. It must be long enough, 120 or more blocks. It must be some number of whole tracks (40 blocks each), in length.The partition directory will use the entire first track, 40 blocks. Sub-directory partitions may contain sub-partitions with sub-sub-directories.
NOTES: As with any drive commands, you may want to close the command channel after the command, if you are through giving commands. If you use the OPEN style of command twice without a CLOSE in between, the second command will abort and give an error. Use CLOSE 1 after the commands in this article.
The other option you have with disk commands is to print them, after one open command. Example:
OPEN 1,8,15 PRINT#1,"/" PRINT#1,"/0:PX" CLOSE 1