The +3e uses its own disk partitioning scheme (called IDEDOS) to divide up your hard disk into different partitions where you can store data. If you intend only to use your hard disk/compactflash card with the +3e (or ResiDOS or ZXVGS, which also run under IDEDOS), then you can simply let the +3e format the whole thing. On the other hand, if you want to also use the drive with a PC/Mac or some other Spectrum firmware (such as FATware, if you have a divIDE interface) then it is possible to allocate just some of the disk space to the +3e.
For full details of the commands shown in the following sections, see the command reference.
Until v1.28 of the +3e ROMs, this was the only option available. Once you format a disk in this way, it cannot be accessed by a PC/Mac (except with certain emulators, such as EightyOne or disk imaging utilities like drimg). This is the best option for many users, especially those with 8-bit interfaces where there is no possibility of any future software for the +3e to transfer files between +3DOS and PC (FAT) partitions.
To do this, simply use the following command:
FORMAT TO unit,maxpartition
Here, unit is the hard drive number (0 is the "master" drive, and 1 is the "slave" drive). maxpartition is one less than the maximum number of partitions that will be allowed on the drive. Although this can be as high as 65535, I'd recommend calculating the maximum number of partitions that will fit (eg on a 200MB drive you can fit 200/16=12.5 partitions; half this for an 8-bit interface) and adding a few more "spare".
For example, format a 200MB drive with a command such as:
FORMAT TO 0,31
Once you have formatted your drive, create some partitions for storing data. A swap partition may also come in useful (although no applications actually use these yet!). For example:
NEW DATA "Games",16 NEW DATA "Utils",16 NEW EXP "Swap",2
Finally, map your partitions to drives and change the default drive. If you use the ASN option, then these settings will be restored every time you turn on the +3e. For example:
MOVE "C:" IN "Games" ASN MOVE "D:" IN "Utils" ASN LOAD "C:" ASN
From v1.28, the +3e supports the extended IDEDOS scheme devised by Jarek Adamski. This is already supported by ZXVGS, and will also shortly be supported by ResiDOS.
This scheme allows the PC's partition table to live in the bootsector, and moves the IDEDOS system partition on to the first sector of the second "head" of the disk. For the scheme to work, the following has to happen:
Once this has been accomplished, the disk can be happily used by both the +3e and PCs/FATware etc. In the near future, a utility will be made available for the +3e which can copy files between the +3DOS and FAT partitions. (Please note that this utility will only work on a +3e with a full 16-bit interface - such as divIDE, ZXCF or ZXATASP, and probably will initially only support FAT16 partitions).
Before attempting to create a shared disk/compactflash card, you must first backup all data on the drive, since this will be destroyed by the process. You are also advised to backup all the data on your PC/Mac, since the system-level utilities that are being used are highly dangerous, and could result in you accidentally wiping the wrong disk if you are not careful! I cannot accept any responsibility for lost data if things go wrong...
First, enter the following command on your +3e, to determine the disk geometry (cylinders/heads/sectors):
CAT TAB
My SanDisk 64MB compactflash card appears as 490 cylinders, 8 heads and 32 sectors. I have decided to allocate cylinders 0-245 (approximately 32MB) to the +3e, and cylinders 246-489 to the FAT partition. The PC/Mac side usually works in logical blocks, where each block is equivalent to a sector. Therefore, the IDEDOS partition will start at block 1 (block 0 is occupied by the boot sector) and occupy (245*8*32) - 1 = 62719 blocks.
The method then used differs depending upon your operating system. Follow the appropriate link below:
The following method is for Mac OS X, but something similar should also work on Linux and other flavours of Unix. It will work with hard disks and compactflash cards.
Determine which "device" your disk is, by typing the following command both before and after connecting the disk to the Mac:
diskutil list
On my iBook, a connected compactflash card showed up as the device /dev/disk2. Now run fdisk on the device, but inserting an "r" before the "disk" part of the name. For example:
fdisk -e /dev/rdisk2
Use the following commands within fdisk to erase the drive, create a placeholder partition for IDEDOS, and create a FAT16 partition with the rest of the disk:
erase (erase the partition table) edit 1 (start editing partition 1) Partition id ('0' to disable) [0-FF]: [0] 7F (unused partition type) Do you wish to edit in CHS mode? [n] n Partition offset [0 - 125440]: [63] 1 Partition size [1 - 125439]: [125439] 62719 edit 2 (start editing partition 2) Partition id ('0' to disable) [0-FF]: [0] 0E (FAT16) Do you wish to edit in CHS mode? [n] n Partition offset [0 - 125440]: [62720] 62720 Partition size [1 - 62720]: [62720] 62720 print (display partition table) write (write partition table) quit
Mac OS X will probably pop up a dialog box at this point, asking if you want to initilize the disk. Just click "ignore" to get rid of it. Next, use diskutil to format the FAT16 partition:
diskutil list (the FAT partition should be listed, in my case as disk2s2) diskutil eraseVolume "MS-DOS" MyCF /dev/disk2s2
The FAT partition should now be formatted and will automatically mount on the desktop. Once you have ejected it, you can attach the drive to your +3e. Finally, format the IDEDOS partition using the following command, which limits the +3e to using the first 246 cylinders (0-245):
FORMAT TO 0,15,246
You can now create some partitions and map some drives, as in the first part of this document.
This method is for Windows XP. Something similar will probably work under Windows 2000 and Windows NT. Only hard disks can be initialised in this way. However, you can get an IDE adapter for a compactflash card so that you can plug it in to your PC as if it was a hard disk.
Right-click on your "computer" icon and choose "Manage". Then choose "Disk Management" in the "Storage" section. Highlight the disk you want to partition. Highlight each existing partition in turn and delete them by right-clicking and choosing "delete partition".
Right-click on the unallocated space and choose "new partition". First create an extended partition; we will use this for the IDEDOS partition. Choose a size in megabytes (noting that 1MB=1048576 bytes); I chose 31MB for my IDEDOS partition. This will show up as "free space" and you should leave it alone.
Right-click on the unallocated space and again choose "new partition". Now create a primary partition, and accept the defaults to use all the remaining space. When asked to format it, choose the FAT filesystem.
Now you can attach the drive to your +3e. Finally, format the IDEDOS partition. Since we don't know exactly which cylinder the FAT partition starts on, we should make sure we underestimate the maximum cylinder that IDEDOS can use. In my case, I'll assume 50% of the disk space since I allocated slightly more than 50% to IDEDOS (ie IDEDOS could use 490/2 = 245 cylinders) and limit it to 244 cylinders, using the following command:
FORMAT TO 0,15,244
You can now create some partitions and map some drives, as in the first part of this document.
Shutdown and restart in MS-DOS mode, and then follow the instructions for DOS.
Only hard disks can be initialised in this way. However, you can get an IDE adapter for a compactflash card so that you can plug it in to your PC as if it was a hard disk.
Start fdisk with the following command:
fdisk
(If asked if you want to enable large disk support here, say no). Select option 5 (change current fixed disk drive) to ensure you are working on the drive you want to partition. Hopefully it will be obvious from the size. Then use option 3 to delete all the existing partitions on this drive.
Once the disk is completely empty (check this with option 4, display partition information), select option 1 (create DOS partition). Then choose sub-option 2 (create extended partition); this will become your IDEDOS partition. Choose a size in megabytes (noting that fdisk treats 1MB=1048576 bytes); I chose 31MB for my IDEDOS partition. Once this has been done, you will automatically be asked to create a logical drive within the extended partition - do not do this! Instead ESCape back to the main menu.
Now choose option 1 and sub-option 1 (create primary DOS partition). Choose the default of allocating all remaining space to this drive.
Choose option 4 (display partition information), and validate that your partition table looks something like this (depending on your choice of partition sizes):
Partition Status Type Volume Label MBytes System Usage 1 EXT DOS 31 UNKNOWN 50% D: 2 PRI DOS 30 UNKNOWN 50%
Now exit fdisk and re-start your computer as advised. Finally, format the FAT partition (for Windows 95/98/98SE/ME, just right-click on the drive icon in My Computer and select "format") with the following DOS command (assuming that the new FAT partition was shown as drive D:, as above):
format /u d:
Now you can attach the drive to your +3e. Finally, format the IDEDOS partition. Since we don't know exactly which cylinder the FAT partition starts on, we should make sure we underestimate the maximum cylinder that IDEDOS can use. In my case, I'll assume 50% of the disk space (ie IDEDOS could use 490/2 =245 cylinders) and limit it to 244 cylinders, using the following command:
FORMAT TO 0,15,244
You can now create some partitions and map some drives, as in the first part of this document.