Jump to content
flashjazzcat

APT Hard Disk Preparation and Utilities

Recommended Posts

FJC you're my atari hero and I owe you at least a beer for all you've done so far. This is really great and definitely super useful thing. I've created Fat32 partition for side loader, fat16 partition for fatfs.sys and I can get rid of sio2pc. It works without any issues. Copying data to SDX partitions has never been so easy. Thank you!

  • Like 1

Share this post


Link to post
Share on other sites

FJC you're my atari hero and I owe you at least a beer for all you've done so far. This is really great and definitely super useful thing. I've created Fat32 partition for side loader, fat16 partition for fatfs.sys and I can get rid of sio2pc. It works without any issues. Copying data to SDX partitions has never been so easy. Thank you!

 

Thanks man - that kind of feedback means a lot! I'm glad you find the software useful. Makes all the effort worthwhile. :)

Share this post


Link to post
Share on other sites

Proper download link, pending inclusion in the new APT Toolkit:

 

http://atari8.co.uk/apt/tools/index.html#fdisk4

I just now got around to checking the new Fdisk program on my version 1 SIDE cartridge. This SIDE cartridge only Boots to my boot partition about 1 in 5 boots, so mostly I use the side.sys file get to my partitions. Well running and opening an existing CF partitioned (previously fdisked) I get Two(2) ids 0.2.1 and 0.1.1 opening each independently proves both to pointing to the same partitions. Disk Properties for each different IDs show the corresponding numbers 0.2.1 and 0.1.1. Just thought IT was interesting enough to comment on as it doesn't seem to be a bug.

Share this post


Link to post
Share on other sites

Sounds like a bug Roy: 0.2.1 is the master disk on the SIDE soft driver (2). You're sure you don't have U1MB with PBI active at the same time? 0.1.1 is the PBI handler. Maybe a bug, anyway: I'll test on real hardware later. ;)

Share this post


Link to post
Share on other sites

I just now got around to checking the new Fdisk program on my version 1 SIDE cartridge. This SIDE cartridge only Boots to my boot partition about 1 in 5 boots, so mostly I use the side.sys file get to my partitions. Well running and opening an existing CF partitioned (previously fdisked) I get Two(2) ids 0.2.1 and 0.1.1 opening each independently proves both to pointing to the same partitions. Disk Properties for each different IDs show the corresponding numbers 0.2.1 and 0.1.1. Just thought IT was interesting enough to comment on as it doesn't seem to be a bug.

 

This is what I get in Altirra with SIDE2 running under the SDX soft-driver:

 

post-21964-0-29839900-1380548520_thumb.png

 

post-21964-0-28549300-1380548521_thumb.png

 

I'll test it on the 1200XL with IDEa (APT) and the soft-driver running simultaneously too. Seems to me like you might have a PBI handler simultaneously active on the same device.

 

EDIT: This is what you see if you turn the PBI on in the U1MB BIOS, then (needlessly) install the soft-driver on top of it:

 

post-21964-0-06685900-1380550660_thumb.png

Edited by flashjazzcat

Share this post


Link to post
Share on other sites

Yes this is true but my Side version 1 only boots thru the Bios about 1 in 8 times so when the soft driver is used the PBI-UMBIOS and soft driver Is probably visible to your Fdisk driver. But this is only evident during CF setup.

Edited by rdea6

Share this post


Link to post
Share on other sites

I don't really understand what you're saying, and there's still no conceivable reason to have the soft driver and PBI operational at the same time.

Share this post


Link to post
Share on other sites

A: SIDE version one will not boot without the soft-driver even if the Ultimate PBI version is available.

B: SIDE version one does BOOT 1 in 8 times without the soft-driver.

C: So I always use the soft-driver to prevent frustration at not going straight to boot sequence.

D: The few times that the Ultimate PBI driver does kick in it does bypass the soft-driver.

E: I am always a Happy Computer User.

Share this post


Link to post
Share on other sites

A: SIDE version one will not boot without the soft-driver even if the Ultimate PBI version is available.

B: SIDE version one does BOOT 1 in 8 times without the soft-driver.

C: So I always use the soft-driver to prevent frustration at not going straight to boot sequence.

D: The few times that the Ultimate PBI driver does kick in it does bypass the soft-driver.

E: I am always a Happy Computer User.

 

A, B and C: Sound like a hardware stability issue, so sadly outside the scope of the software/driver.

D: Yes - because PBI gets precedence over SIO.

E: Good!

Share this post


Link to post
Share on other sites

Here's something pretty cool I dreamed up today:

 

atrmnt.zip

 

It occurred to me that since we now have the FATFS driver for SDX, we can get at the cluster number for a given file by simply reading the raw directory data on a FAT16 volume. And indeed the 16-bit cluster number is returned at offset +1 in DIRBUF, and we can feed this straight to the Ultimate 1MB PBI BIOS to mount an ATR in the FAT16 partition (yes - the U1MB BIOS supports FAT16 as well as FAT32).

 

The necessary information in the SDX programming manual hasn't yet been published in translated form by KMK, so I ran the docs through Google Translate and came up with the following if anyone's interested:

 

SDX FFIRST and FNEXT.txt

 

Only the first couple of paragraphs have been sanitised by me, and indeed those are the only ones relevant to the task. I've left the rest in for interest.

 

So - the upshot of this is that by putting a FAT16 entry in your APT (using the latest APT FDISK with Ultimate 1MB/SIDE), putting an ATR inside that FAT16 partition and then installing the FATFS driver, you can mount an ATR file on drive 1 by typing:

 

ATRMNT name.atr

 

Later I'll add code to auto-append the "ATR" extension if none is supplied, and allow for mounting of the ATR on different drive numbers, listing all currently mounted volumes by name, etc (the last can be achieved by iterating through the entire FAT directory structure looking for cluster numbers which match those in the APT mount table). The caveat here is that - when we have FAT write support - deleting the ATR file and then writing to the mounted ATR will have disastrous consequences for the integrity of the FAT volume (since the PBI driver has no way of tracking deletion of the ATR).

 

Anyway, here's the source code:

;
;	FAT U1MB/SIDE ATR Mounting Utility for SpartaDOS X
;	Requires installation of FATFS.SYS driver and FAT16 partition of 32MB or less on CF card

	icl 'sdx_equ.inc'
	icl 'side_equ.inc'
	
	blk reloc main
	
start
	jsr u_getpar
	beq NoParameter
	mva #$80 fatr1 ; ignore directories
	jsr ffirst
	bmi Error
;	jsr printf
;	.byte '%d %11s',155,0
;	.word dirbuf+1,dirbuf+6
	jsr MountImage
	bmi Error
	jsr printf
	.byte 'Disk image successfully mounted',155,0
	jsr fclose
	rts

Error
	jsr fclose
	jsr printf
	.byte 'Error mounting disk image',155,0
	rts

	
NoParameter
	jsr printf
	.byte 'No parameter',155,0
	rts


	.local MountImage
	mva #1 MountBlock[0].Flags
	mva #1 MountBlock[0].Drive ; drive number - we need to let user specify this
	mwa dirbuf+1 MountBlock[0].Partition ; low 16 bits of cluster number
	mwa #0 MountBlock[0].Partition+2 ; high 16 bits of cluster number (this will change when we get FAT32 driver)
	mva #$A0 ddevic ; physical disk handler, with XDCB
	mva #1 dunit ; master/slave (assume master for now)
	mva #$c0 dstats ; read/write operation
	mva #$06 dtimlo
	mwa MountBlock_p dbuflo
	mva #'M' dcomnd
	jmp siov
	.endl
	
MountBlock_p
	.word MountBlock

MountBlock dta mcb [0] ( \
	0, \		; flags
	0, \		; drive #
	0 \		; partition #
	)

	blk update address
	blk update symbols

	end

This is extremely rough, but it took me some fifteen minutes - not including debugging. ;) It just goes to show how easy it is to write functional command line applications using SpartaDOS X.

 

NB: If the Ultimate 1MB BIOS doesn't pick up the FAT16 partition, this is likely because it has MBR partition type code $04 (defined as a FAT16 partition of less than 65535 sectors). I need to update the PBI BIOS to recognize this partition type, but in the meantime you can hack the partition type to $06 to make it work. ;)

Edited by flashjazzcat
  • Like 1

Share this post


Link to post
Share on other sites
And indeed the 16-bit cluster number is returned at offset +1 in DIRBUF

 

I hope it will become clearer now, why supporting FAT16 is much easier than supporting FAT32 in SDX :) FAT32 has 32-bit cluster numbers, so writing a suitable driver first of all needs structural changes inside SDX itself. But this needs to be done some day anyway :)

Share this post


Link to post
Share on other sites

 

I hope it will become clearer now, why supporting FAT16 is much easier than supporting FAT32 in SDX :) FAT32 has 32-bit cluster numbers, so writing a suitable driver first of all needs structural changes inside SDX itself. But this needs to be done some day anyway :)

 

It's been apparent to me all the while for these obvious reasons, and I must say that having used 32MB partitions for a couple of years, the quest for larger capacities has diminished somewhat in importance. But - as you infer - we never know what the future may bring. :)

 

BTW: It's rather a shame no reserved bytes were built into the SDX directory entry format, since that will clearly have to be enlarged to cater for 32-bit or even 24-bit cluster numbers. So presumably two different standards will have to be supported so as not to wreck compatibility with older software... an interesting challenge, no doubt.

Edited by flashjazzcat

Share this post


Link to post
Share on other sites

I am not sure whether this issue has already been addressed but when I was trying to utilize the small remaining free space on the CF card FDISK4 freezes. I wasn't really testing, I was using the program to format my IDE Plus 2 card, so the issue came up by coincidence. Attached video shows the circumstances where the problem occurs. Video quality isn't the best but clear enough to show the situation.

 

Edited by atari8warez

Share this post


Link to post
Share on other sites

Also if you don't have access to your CF card through a PC, creating 16 APT partitions and booting SDX will leave you staring at 16 empty disk drives with no files on it. (I've realized that the hard way - LOL). You will have no access to your Atari files even with a SIO2PC as all drives will be assigned to PBI, you would then need a PC with a card reader to erase the CF card so that you can redo the partitions, leaving one drive available for SIO so that you can copy your atari files from your PC.

For people who prefer to use their PC to populate the FAT partition on the CF, I must note that the Hitachi Micro Drive Filter driver suggested by FJC at the beginning of this thread does not install on PCs with Windows 7 64 bit. There are however alternative filter drivers available. I haven't tried those yet so I can't confirm whether they work as intended or successfuly install, but the page on the link provides a good insight to people who are not familiar with filter drivers.

 

Share this post


Link to post
Share on other sites

Did anybody successfully implement a FAT16 partition and use SDX FATFS.SYS driver (v0.6) to access the files on that partition with IDE Plus?

 

I followed FJC's video tutorial and created a 32MB FAT partition along with a 32MB APT partition on the card, assigned drive letters and also used Make External command to create a reference to the FAT partition. I assigned drive letter H to that external reference. I then formatted the FAT partition on my PC (FAT16, 4kb cluster size) and copied a few Atari files to it. When I reinsert the card to my IDE Plus, reboot the Atari with SDX (fatfs.sys loaded) and do a DIR H: I get a "148 Unknown file system" error message. Am I missing a step or some other detail?

 

Also I noticed that a newer version of fatfs.sys (v0.7) exists but not in the SDX v4.46 toolkit, has that version ever been released or is it a test version still being worked on?

Share this post


Link to post
Share on other sites

Small but critical update:

 

http://atari8.co.uk/apt/tools/fdisk4_test4_081113.zip

 

I was messing with FDISK 4 this evening and noticed that sometimes it was impossible to edit partition sizes. There was also a (cosmetic) bug in the partition name editing routine. I don't have time to add the other things on the to-do list at the moment, but I thought the editing bug important enough to fix.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for also partially fixing the freezing problem which occurred while editing APT entries. There are however still circumstances that may create incorrect entries and freeze FDISK during partition editing. The following video shows how it can be duplicated.

 

Also I am still trying to figure out how to create and use a FAT16 partition with SDX FATFS.SYS. I followed your video tutorial but all i get is a "148 Unknown file system" error message when I try to access the FAT partition. Does the external partition created by the FDISK Make External command need to be formatted in SDX (when I try that all I get is an empty directory list even though the FAT partition actually contains Atari files from the PC) so it looks like the partition that has been made external has no link to the actual FAT partition or the FAT driver somehow does not work.

 

This is how I created the partitions with FDISK4

post-15627-0-30667800-1383950064_thumb.jpg

 

 

VIDEO

Edited by atari8warez
  • Like 2

Share this post


Link to post
Share on other sites

why you so nervous? :D

 

Does the pounding sound of the keyboard make you say that, well frustrated yes, nervous no.. LOL, Frustrated mainly I can not get the FAT partition thing to work, freezing FDISK does not help either, but I understand it is a beta software so certain difficulties are normal.

  • Like 1

Share this post


Link to post
Share on other sites

Steve Carden has been kind enough to offer to give FDISK 4 a good workout this weekend, so this seemed a good time to address a few bugs. Firstly the new build:

 

fdisk4_beta5_091113.zip

 

Changes/Bug Fixes

  • Erasing all partitions or doing a split/divide now properly resets the window view. Previously, the selection bar could be left stranded if it wasn't at the top of the partition list, causing the program to become unresponsive.
  • Some problems with garbage appearing following bounds-corrected partition size entries have been addressed.
  • The program now won't allow you to create a new partition entry if there isn't a minimal amount of free space left.
  • Split/divide has been revised with better input validation and bounds-checking.
  • Dialog boxes now won't repeatedly block on illegal input if you're trying to press Escape to cancel the dialog.

In addition, there's now a "Media Properties" sheet accessible from the top-level menu. This is bare-bones at the moment, simply reporting the interface name (although this doesn't appear under IDE Plus, since the BIOS doesn't appear to support the feature yet), media name, PBI ID, total disk capacity, etc. Later I'll add MBR/APT detection so you can get a rough idea of what's actually on a disk before you go ahead and reinitialize it from scratch.

 

Regarding split/divide: just as a reminder, you can specify either/or when it comes to partition sizes and partition counts. You can specify just the number of partitions, and the available space will be divided into n partitions, or you can also specify the size and the program will attempt to create n partitions of the stated size (if the partition table overflows, only as many partitions as will fit will be created). Likewise, specifying partition size with no number of partitions will just cause the available space to be filled with partitions of size n. Note also that the size unit specified in the split/divide dialogue reflects the current setting in the View menu (i.e. MB or Sectors).

 

When initialising a disk from scratch, remember to specify which kind of FAT partition you want at the partition level. There are different MBR partition types for FAT16 and FAT32, although it is possible to "force" Windows to format partitions using FAT sizes discrepant with the MBR partition ID. The U1MB/Incognito PBI drivers (and ensure you have the latest ones) will always attempt to deduce the FAT type from analysis of the file system; likewise FDISK itself attempts to base identification of FAT type from the file system where possible (when creating the list of "external" partitions), although it's possible that "creative" formatting can fool it from time to time.

 

FDISK is only concerned with primary partitions, and (like the PBI drivers) makes no attempt to follow extended MBR partition links. Therefore the maximum number of external FAT partitions is THREE (leaving one primary partition slot for the APT itself).

 

General Usage Notes

  • If you create fifteen partitions and assign them all drive numbers, logically it follows that the PBI HDD partitions will block out all your SIO devices when you boot the hard disk. This is squarely a usage issue, and a prime reason FDISK doesn't automatically assign drive letters when partitions are created using split/divide. Note that SpartaDOS X includes facilities to bypass this issue on a by-drive basis.
  • The safety feature which caused the program to enter super-hibernation mode if a user attempted to create further partitions when there was no space remaining on the disk has been replaced in the latest version with more robust sanity checking of user input.

External FAT Partitions

 

When creating FAT16 partitions for use with KMK's FATFS.SYS driver, take care to ensure that the partitions are absolutely no more than 32MB in size. Note that a 32MB partition generally has 65,535 sectors. To be on the safe side, I generally make the FAT16 partitions (using a PC partition editor) 31.xx MB in size. If the FAT is too large, FATFS.SYS will produce an Unknown File System error, because the SpartaDOS X file system driver cannot currently access more than 65,535 sectors in a given partition, be it FAT or SDFS. Providing the recommended setup procedure is followed, FATFS operation using IDE Plus has been found to work without issue.

 

Compatibility With Older FDISK Versions

 

Something which appears to have caught Steve out was that from version 4 of FDISK onwards, you can't leave empty gaps between APT partitions. This change was made primarily to simplify the editor and the editing process. In old FDISK versions, you could delete a partition near the top of the list and all the subsequent partitions would stay put. This is no longer the case. If you delete a partition, everything after it will move up to close the gap. Similarly, if you enlarge a partition, everything after it will be physically moved forward. A side-effect of this is that if you previously partitioned a disk using an older FDISK version and left gaps between APT partitions, when you save the partition table back in FDISK 4, some partitions will move and any data in them will become invalid. The program does warn you of this if it detects empty space in the partition table when loading it, but clearly this is something which users can't be warned about enough. So... you have been warned.

 

To-Do

 

Aside from the aforementioned enhancements to the media property sheet, there are a couple of UI enhancements Steve has suggested which I'll think about including, such as fast entry of repeated partitions of the same size (although I think split/divide pretty much takes care of this requirement anyway). The ancillary programs such as HDDINFO require complete rewrites since they are distantly out of sync with the current incarnation of FDISK, being written long before the advent of external FAT partitions and SDX FAT drivers. The little ATR mounting program whose source I shared a while back probably warrants completion as well.

 

Steve made another good suggestion: add a "BPS" field to the split/divide dialogue so the density of the partitions can be specified. It's easy to forget there's only one DOS capable of handling 512 byte sectors. ;) I'll also re-emphasise the warning the program spits out about moving partitions (created with old FDISK versions) if the tables have gaps in them.

Edited by flashjazzcat
  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...