Jump to content
IGNORED

Detecting a SpartaDOS disk


Recommended Posts

Back in the mid 80's... I wrote my own SpartaDOS disk directory sorting utility out of sheer necessity having some fairly large drives and dirs on my BBS system.

While playing with this program the other night, I accidentally sorted a DOS 2 disk... oops.  My brute force sorter trashed the disk as I suspected it would. 

 

So I need to be able to detect a SpartaDOS disk before sorting.

 

I know the SDFS version is stored at offset $20 in sector 1 of the Sparta disk.  This would be easy enough to check but I feel I need something additional.

 

It looks like offset 8 in sector 1 = $80 on the SpartaDOS disk but I am not sure if this is definitive enough.  I have checked a few different disks and so far I have only seen $80 in offset 8 on the Sparta disks.

 

Any other ideas?? 

Link to comment
Share on other sites

Offset 8 should help a lot if not suffice completely. Altirra detects SDFS by the JMP instruction there, which will be to $xx80 for a SD/ED/DD disk and $xx40 for a DD 512 disk. On a DOS 2 or MyDOS disk it will jump around the BCB to a low $07xx address. You could also cross-check the first few bytes after that since they have defined meaning for both SDFS and DOS 2 disks.

 

Link to comment
Share on other sites

32 minutes ago, bf2k+ said:

Sounds good.  I've been using the old DISKRX to sniff around in these disks but it won't touch a DD 512 disk.  What's out there these days to do that?

There's a utility on the SDX toolkit called EDDY.  It's a really nice hex editor for partitions, disks, and even single files.  Requires an 80 column driver of some sort, but the SDX software 80 column works fine with it.

Link to comment
Share on other sites

  • 4 weeks later...

Another question along these lines... As I understand, the DD512 disk format has 512 bytes in secs 1, 2, 3 and all the rest.  This is unlike other 128byte and 256byte formats.

 

If I want to detect a DD512 disk and am using SpartaDOS 4.4x, what's the best way to proceed?

 

.  First attempt to read sector 1 at 128 bytes?

.  Trap the resulting error and then attempt to read sector 1 at 512 bytes?

 

Or is there some shortcut I am missing?

Link to comment
Share on other sites

On 4/2/2021 at 8:26 PM, bf2k+ said:

While playing with this program the other night, I accidentally sorted a DOS 2 disk... oops.  My brute force sorter trashed the disk as I suspected it would. 

What is wrong with the built-in command SORTDIR?

 

19 hours ago, bf2k+ said:

Or is there some shortcut I am missing?

I guess so: XIO 47 aka GET DISK INFO or CHKDSK, section 6.3.17 of the SpartaDOS X User's Manual has some description.

  • Like 1
Link to comment
Share on other sites

And to answer your other question...  I wrote mine out of necessity in 1985... before SDX even existed. 

 

Now it is a hobby (and much fun) to make it work properly with the new stuff you have so graciously given us.  Thank you.

 

Link to comment
Share on other sites

SORTDIR is a tool written by ICD in 80s (and yup, current SORTDIR is the same - quite slow - code exactly). Anyway, a directory sorting utility does not need to know the size of bootsectors, or the size of any sectors for that matter, because in SpartaDOS you can open a directory read/write the same way you open a file with binary contents. Then you read it all out to the memory, sort, do SEEK to the beginning, write back, then close.

Link to comment
Share on other sites

I was wondering about SORTDIR... Keith wrote that one (I think before he started working at ICD).  But he helped me get mine started back then by encouraging me to read the command line for parameters which I did.  I have some of his ICD SpartaDOS Con set books with his notes in them. 

  • Like 1
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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