Jump to content

Photo

APT Hard Disk Preparation and Utilities

APT Hard Disk Ultimate 1MB SIDE Incognito

351 replies to this topic

#26 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Mon Aug 5, 2013 1:07 PM

Slow progress, but I think this is more user-friendly than before:

FDISK3.png

Won't let you make more than one FAT partition at the moment, but you can leave space for more and create them using a partition editor on the PC. FDISK will then pick up these pre-existing multiple FAT partitions and allow you to attach them as "external" APT partitions.

Quite fun doing the dialogue boxes (as a pre-cursor to the GUI). If you de-select "MBR" and "FAT" is on, FAT turns off... likewise if you turn on "FAT" and "MBR" is off, MBR turns on (since you can't have a FAT without an MBR container).

Of course, if "FAT" is off, the FAT size box should be inaccessible - which comes next. :)

Edited by flashjazzcat, Mon Aug 5, 2013 1:10 PM.


#27 twh/f2 OFFLINE  

twh/f2

    Dragonstomper

  • 648 posts
  • Location:Fractalus

Posted Mon Aug 5, 2013 1:37 PM

Looks awesome.

Is that kind of UI abstraction in textmode somehow reusable for the graphical GUI?

#28 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Mon Aug 5, 2013 1:58 PM

Looks awesome.

Is that kind of UI abstraction in textmode somehow reusable for the graphical GUI?


Thanks! Yeah - it should be very re-usable, and it's given me a good insight into how to handle dialogues. The text mode version uses callbacks for "events", but I'll probably confine things to message-passing in the GUI, since the callback mechanism can get a bit hairy, despite the fact this dialogue manager's completely re-entrant. With a little alteration, though, the text mode version could be used with a mouse. The GUI's dialogue manager will require completely different rendering routines, of course, but I'd say the text-mode version constitutes about 50 per cent of the basic work.

Here's a little something else as well:

DSCF2989.JPG

This is FDISK's device selector running on the 1200XL, which has an internal IDEa interface (with custom APT BIOS) as well as SIDE/U1MB PBI. I've changed the device IDs to accurately reflect KMK's "hierarchical" scheme as described in the DEVINFO / DISKINFO docs (pertaining to IDE Plus), as well as in the APT tech docs on my website. Those numbers which almost look like IP addresses represent the device ID hierarchy. In this case, the first one is the master device on PBI controller 0 (IDEa), while the second one is the master device on PBI controller 6 (U1MB PBI - although the U1MB BIOS numbers the PBI IDs 1-8 instead of 0-7).

The format is BUS_ID . Controller_ID . Device_ID:

The Bus ID is an arbitrary number identifying the I/O bus the device is physically attached to.
$00 represents the Serial Bus (SIO), $01 the parallel bus, and $02 the SpartaDOS X internal
LSIO interface. SIDE returns $02 here.

The Controller ID is a number identifying the controller attached to the bus. SIO devices
should return $00 here. For PBI devices the PBI device ID is returned here; in fact this is the
number of the bit in the PBI enable register that activates the device. The value for PBI
devices is thus ranged from 0 to 7.

The Device ID is a number identifying the physical device itself. For IDE/ATA this will be $01
for the master drive and $02 for the slave drive. Floppies return unit number, and if a disk
drive contains more than one physical drive, the same DEVICE ID should be returned for all
of them.


Edited by flashjazzcat, Mon Aug 5, 2013 2:12 PM.


#29 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Wed Aug 7, 2013 6:46 AM

Getting closer now:

external_partition.png

This shows an "external" partition (the first entry) which points to the FAT area on the CF card. The sector numbers look a bit out of context (since they're by definition outside of the APT partition space), and there'll be no "free space" gaps around them, but you can set the drive number and access flags. Position, size and density are obviously pre-populated for FAT partitions and cannot be changed. You'll be able to use these partitions with Drac030's beta FAT drivers for SDX.

#30 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Wed Aug 7, 2013 1:30 PM

Hmmm... unfortunately FATFS.SYS won't recognize this FAT16 boot sector:

bootsecrtor.PNG

Will have to look into it tomorrow. SDX simply reads sector 63 (this one) and reports "Unknown disk format".

Edited by flashjazzcat, Wed Aug 7, 2013 1:30 PM.


#31 twh/f2 OFFLINE  

twh/f2

    Dragonstomper

  • 648 posts
  • Location:Fractalus

Posted Wed Aug 7, 2013 2:02 PM

In what way must the FAT16 partition be created?
Do I have to say windows right after the FDISK / APT initialization to format the reserved partition space in FAT16?

Edited by twh/f2, Wed Aug 7, 2013 2:50 PM.


#32 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Wed Aug 7, 2013 4:16 PM

The idea is that you prep the FAT/APT structure in FDISK, format the FAT partition using Windows, then it's job done. SDX is reading the correct boot sector here, but - unlike previous hand-coded experiments - it's not recognizing the FAT16 file system.

#33 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Thu Aug 8, 2013 3:12 PM

I see what I did here... after following the rule RTFM. FAT partition should be no more than 32MB in size... ;)

External FAT16 partition working perfectly now. :D

Edited by flashjazzcat, Thu Aug 8, 2013 3:18 PM.


#34 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Sat Aug 10, 2013 5:00 AM



#35 lemiel OFFLINE  

lemiel

    Moonsweeper

  • 279 posts
  • Location:Tychy, Poland

Posted Sat Aug 10, 2013 5:13 AM

Where FATFS.SYS keeps data of number of free sectors on FAT16(FAT32 too) partition? It is not to much space?
Is it updated after saving something new?

#36 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Sat Aug 10, 2013 5:37 AM

FAT16 doesn't keep a running free sector count in the boot record, so the driver needs to scan the FAT every time there's been a change to the filesystem. FAT32 does keep a record, however, so naturally we look forward to that driver very much. Not sure how (or if) the current FATFS driver will sense that the free sector count needs recalculation following a hot-swap - haven't tested that yet. It should be obvious how handy this will all be, though, especially when the drivers are write-capable. ;)

Edited by flashjazzcat, Sat Aug 10, 2013 5:38 AM.


#37 greblus ONLINE  

greblus

    Moonsweeper

  • 270 posts

Posted Sat Aug 10, 2013 5:41 AM

Looks great!

Hmm, release often, release early? I'd be volountarily happy to trash my CF card today :). BTW, for the Side loader I'd have to create separate fat32 partition?

#38 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Sat Aug 10, 2013 9:50 AM

Well - everything you need is already available, apart from the FDISK program which inserts "external" partitions into the APT. And that'll be released in beta shortly.

Yes - you currently need to create a separate FAT32 partition (AFAIK). This is just one reason I'm anxious to see a FAT32 filesystem driver for SDX.

#39 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Thu Aug 15, 2013 12:54 PM

Speaking of RTFM, I reformatted the FAT16 partition with the largest possible cluster size (4096 bytes or 8 sectors is the best Windows would manage), and - as Drac030 points out in the WHATSNEW.TXT accompanying the FAT drivers - this speeds up the initial free sector scan significantly. He recommends 8KB clusters.

Edited by flashjazzcat, Thu Aug 15, 2013 12:54 PM.


#40 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Mon Sep 23, 2013 6:26 AM

Decided to ditch the free/used space model previously employed in the editor:

 

 

A few obvious bugs, but it'll be ready soon. Previously, when creating lots of (i.e. more than sixteen) partitions, the additional sectors required for the chain-linked extended partition table records would tend to get bunched up together in the first available free space: typically at the very end of the disk. This was hardly in keeping with the original APT design ethos. So this editor shuffles the partitions around every time an edit occurs, and slots those partition table records in, right ahead of the group of partitions they actually describe. This "floating partition" approach is completely in keeping with similar editors on the ST (ICD Pro, HDDriver, CBHD, etc). More often than not, the only edits you want to perform on the partition table involve adding extra partitions to the end of the table, and this remains a non-destructive operation. The editor code (and consequently the application) is smaller and easier to debug, and I've been able to add useful stuff like split/divide, so you can ask the program to split the available space into a number of equal-sized partitions, or set up n partitions of a specified size.

 

While researching ST partition editors, I found use of the Pasti ACSI emulator for Steem extremely useful.


Edited by flashjazzcat, Mon Sep 23, 2013 6:28 AM.


#41 atari8warez OFFLINE  

atari8warez

    River Patroller

  • 2,724 posts
  • Location:Canada

Posted Tue Sep 24, 2013 5:27 PM

That new split/divide function is a great help in creating many partitions fast!.. One question though, from the video, I noticed the function creates 8 equal sized partitions when you enter the common partition size (65535) but leave the Partitions number blank. Why did you decide to make it 8? Also, would it be too much to ask to pre-fill the drive id's (optionally). This would make it even faster to create the partitions.

 

In any case, great effort, FDISK is getting more useful and user friendly by the day :thumbsup:

 

P.S: I also love the integration of the APT and FAT...



#42 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Wed Sep 25, 2013 7:36 AM

Added toggle to show partition size by sectors or MB:

 

FDISK_MB_View.png

 

The 32MB partitions are actually 65,535 sectors long, hence 31.99MB. It was quite interesting converting 32-bit integers to pseudo-FP representation without using the OS FP library. It'll work the other way, too, so you can type in the partition sizes in MB in this view.

 

Partition count fixed. Note that there are eight partitions here because only seven 32MB partitions will fit into the available space. Partition 1 is actually an external FAT32 partition (255MB long), so isn't counted towards the total space usage. The auto-fill allows either even division of the available space into a specified number of partitions, or filling the space with as many partitions of a specified size which will fit.


Edited by flashjazzcat, Wed Sep 25, 2013 7:41 AM.


#43 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Thu Sep 26, 2013 4:00 PM

Here's a reasonably functional build of the new partition editor:

 

Attached File  fdisk260913.zip   11.73KB   176 downloads

 

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.

 

Known Issues:

 

  • 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.


#44 rdea6 OFFLINE  

rdea6

    River Patroller

  • 2,797 posts
  • Location:Arizona USA

Posted Thu Sep 26, 2013 8:13 PM

Everything went well but not able to create partitions with Altirra [EMU].   No key presses registered during sizing phase.  Emulated CF card did not show proper size of CF image.

 

EDIT: This was with the IDE+20.ROM.  I also did a 256 MB CF card on real hardware and it is working with Ultimate and Incognito.


Edited by rdea6, Thu Sep 26, 2013 8:49 PM.


#45 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Fri Sep 27, 2013 2:28 AM

Hmmm... Better dig out my IDE Plus.

#46 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Fri Sep 27, 2013 6:13 AM

Right - thanks for spotting that Roy: it was a bug. IDE Plus evidently (and quite properly) checks the first byte of the partition table, which contains the number of drive mapping slots, less fifteen. If it finds a nonsense value, it obviously rejects the partition table. There was a bug which caused the APT signature to overwrite the mapping entry count, making the partition table invalid to the IDE Plus BIOS.

 

Attached File  fdisk270913.zip   11.72KB   171 downloads

 

Fixed that, and just tested it in Altirra and it seems fine. Wasn't able to reproduce any issues with partition size reporting yet. I also changed the initialization routine so that if you select a FAT16 partition, partition type $06 gets created, instead of type $0C.



#47 w1k OFFLINE  

w1k

    Stargunner

  • 1,669 posts
  • Location:martin, slovakia

Posted Fri Sep 27, 2013 6:42 AM

on real HW works fine :)


Edited by w1k, Fri Sep 27, 2013 6:57 AM.


#48 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Fri Sep 27, 2013 12:05 PM

on real HW works fine :)

 

Great - thanks!

 

Just realized what Roy was talking about with the disk size: misreported (always 512MB) at the top of the initialization dialogue. Fixed now:

 

Attached File  fdisk_test3_260913.zip   11.75KB   169 downloads



#49 flashjazzcat ONLINE  

flashjazzcat

    Quadrunner

  • Topic Starter
  • 14,426 posts
  • Location:United Kingdom

Posted Fri Sep 27, 2013 12:49 PM

First attempt at a tutorial video:

 

 

Made the disastrous mistake of leaving the keyclick and IO noise on full-blast. Sorry about that. I'll redo it later when my sense of disappointment has eased. :)


Edited by flashjazzcat, Fri Sep 27, 2013 12:50 PM.


#50 bf2k+ OFFLINE  

bf2k+

    Stargunner

  • 1,773 posts
  • Location:Boot Factory BBS 2k+

Posted Fri Sep 27, 2013 2:18 PM

Very nice...







Also tagged with one or more of these keywords: APT, Hard Disk, Ultimate 1MB, SIDE, Incognito

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users