Here's a reasonably functional build of the new partition editor:
Don't use this to experiment on partitioned disks with anything valuable on them. I expect there to be a fair number of bugs, so anyone who wants to test would be better off doing so with empty CF cards or by using imaged CF cards in Altirra.
Changes since FDISK3:
- The partition editor has been completely redesigned. Partitions now "float" to the beginning of the available space. Although there are many excellent reasons for doing things this way, if you edit a disk prepared with FDISK3 which had empty space between partitions, this editor will close up that empty space. You have been warned!
- Y/N responses have been replaced with OK/Cancel dialogue boxes. In fact, the entire UI has been revamped. Dialogues operate much as you'd expect: you can navigate between fields using Tab/Shift-Tab, or the left and right arrow keys. Return generally fires the "OK" button, unless the Cancel button has the highlight on it.
- The Device selector now lists every PBI device on the system which responds to APT requests. I tested this with an IDEa interface and U1MB/SIDE2 (PBI) connected at the same time, but I'd appreciate it if someone could test this with different hardware set-ups. SDX soft-driver devices should also be picked up and added to the list. The three-digit number before each listed device is: [PBI Device].[BUS ID].[Device ID]. PBI device is just the PBI ID (0-7), BUS ID is the generic ID for PBI devices ($01; the SDX SIDE driver will show up as $02), and Device ID is 1 for Master, 2 for Slave. These values are documented in the APT API manual, found on my website.
- For partition tables with more than sixteen entries, the partition table chain now threads itself properly between the partition data, at the appropriate points (i.e. before every subsequent block of 31 partitions). This should reduce seek time on spinning disks by a slight but probably unnoticeable amount.
- Partition sizes can now be viewed as sectors or MB values. When you're in MB mode, you also specify the partition size in MB. Watch out for changes to partition sizes when editing in MB view. Although a 65,535 sector partition will show up as 31.99MB, a 31.99 typed into the size field will not yield a 65,535 sector partition, but a 65,515 sector one. Likewise, specifying a 32MB partition will (logically) result in one 65,536 sectors long: one more sector than SpartaDOS X requires.
- You can insert (finally) "external" FAT partition references with Partition->Make External (or the "X" key). FDISK will pick up any (primary) FAT partitions on the disk and present them in a list. Just select the one you want, give it a drive number, and make sure the partition is formatted (via the PC) with the appropriate file system.
- Initial media set-up has been redesigned. You can still only specify one FAT, but gone is the succession of pop-up windows and "Y/N" prompts. It's all done from one dialogue box.
- Validation checking is fairly loose at the moment. You might be able to screw things up (and I'm sure some will be trying hard) by typing in nonsense values. I'll be tightening this stuff up, though, since although this should be a set-it-and-forget it application, it's pretty mission-critical stuff so I want it as robust as possible.
- You can't type in fractional MB values in the Disk Initialisation dialogue (where you set up the APT and FAT) yet. I'll fix this soon.
- Free sector count might seem misleading: this is because there's a one sector overhead for meta-data ahead of each partition. That's not to mention the sectors consumed by extended partition table entries, so it's difficult to come up with an accurate free sector reporting scheme without confounding the user with unwanted information.
- I want to add a properties panel to the top-level menu, which will report the partition geometry of the chosen device (i.e. report the sizes of all the primary FAT partitions, as well as the APT).
On the advice of Candle, I used the information provided in the Microsoft EFI FAT32 Specification to write the code which detects whether a file system is FAT12, FAT16 or FAT32. FDISK does it EXACTLY the way Microsoft tells us to do it (using the same algorithm), and detection is based purely on the number of data clusters. Trouble is, this isn't reliable if you format a small partition with FAT32... the Microsoft method then doesn't work, unless you add a few lines of code to discern FAT32 on the basis of certain unambiguous fields which are empty when the file system is FAT32. Seems to work (the program can distinguish between FAT16 and FAT32 when the partitions are the same size), but this is something which will need stress-testing, even if it is only a cosmetic concern at the end of the day.
Speaking of FAT: I'm only checking for partition type $0C at the moment, so I'll add the other IDs later for completeness. Also note that extended MBR partitions (i.e. EPRs) of any kind aren't supported at the moment. I don't think this is an issue, since I can't see us needing more than three FATs plus an APT on a Compact Flash card.
Anyway: don't be surprised if stuff's broken. If it's anything not covered above, I'd be interested to hear about it. Also suggestions on extra features (such as augmentation to the split / divide function).
PS: You can use this program with S_VBXE and RC_GR8 (under SpartaDOS X), but you'll have to start it with "X" if using RC_GR8.SYS (otherwise there's not enough RAM for the GR.8 display). Note also that FDISK should run under any DOS.
Edited by flashjazzcat, Thu Sep 26, 2013 4:08 PM.