Jump to content
IGNORED

SpartaDOS File System question


Recommended Posts

OK, this question is going out to anybody who knows anything about details of the SpartaDOS file system. I'm using the information posted at: http://atari.kensclassics.org/dos.htm#sparta. I've determined that there seems to be a mistake in the information posted, and I'm trying to fill in the gap.

 

Specifically, the info on that page says that bytes 9 & 10 of the boot sector contain the "First sector of sector map for main directory" but I have determined that they actually point to the first sector of the directory itself, not the sector map.

 

Now I need to figure out how to determine the sector map for the main directory. Or, maybe the main directory is a fixed size and doesn't use a sector map. I dunno... anybody who has a clue about this, please let me know.

 

If you're asking yourself what a "sector map" is in this context, you're probably not the one with the answer to my question, but I'll try to explain.

 

With Atari DOS, and most of the other variants that are compatible, the directory entry for each file specifies the first sector used by the file. The last 3 bytes of each sector specify either that this is the last sector of the file, or the number of the next sector in the file.

 

SpartaDOS does it a bit differently. For each file or directory, there is a sector map which indicates which sectors are used. A sector map is one or more sectors which contain a list of sector numbers that belong to the file.

 

Link to comment
Share on other sites

The filesystem is described starting at page 151 in the manual: http://sdx.atari8.info/sdx_files/4.47/sdx_4-47_user_guide.pdf

Sector maps and directories are explained.

 

Thanks for the link. Oddly, the file system is not explained in the programmer's guide, which I already had.

 

Unfortunately, it looks like this manual is the source of the information on the webpage I was working from. The manual includes the same error, and doesn't say anything further about the main directory's sector map.

Link to comment
Share on other sites

The manual is correct -- bytes 9 and 10 point to the main directory's sector map and not the directory itself. This is the boot sector from a freshly formatted SD disk:

000: 00 03 00 30 E0 07 4C 80-30 05 00 D0 02 CA 02 01 |...0..L.0.......|
010: 04 00 25 00 07 00 20 20-20 20 20 20 20 20 28 80 |..%...        (.|
020: 21 80 00 3E 00 01 00 F2-00 00 00 00 00 00 00 00 |!..>............|
030: 00 00 00 00 45 72 72 6F-72 3A 20 4E 6F 20 44 4F |....Error: No DO|
040: 53 9B AD 28 30 8D 0A 03-AD 29 30 8D 0B 03 A9 00 |S..(0....)0.....|
050: A2 2F 20 F1 30 AD 00 2F-8D 28 30 AD 01 2F 8D 29 |./ .0../.(0../.)|
060: 30 A0 04 84 91 A4 91 CC-1F 30 F0 D6 B9 00 2F 8D |0........0..../.|
070: 0A 03 B9 01 2F 8D 0B 03-C8 C8 84 91 60 6C E2 02 |..../.......`l..|

Bytes 9 and 10 point to sector 5:

000: 00 00 00 00 06 00 00 00-00 00 00 00 00 00 00 00 |................|
010: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
020: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
030: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
040: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
050: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
060: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
070: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|

...Which in turn points to sector 6:

000: 28 00 00 17 00 00 4D 41-49 4E 20 20 20 20 20 20 |(.....MAIN      |
010: 20 19 01 06 14 0E 30 00-00 00 00 00 00 00 00 00 | .....0.........|
020: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
030: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
040: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
050: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
060: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
070: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|

Which in turn holds the main directory with the volume label.

 

  • Like 3
Link to comment
Share on other sites

Did the very ancient versions of SpartaDOS not put the root directory at a fixed location, prior to the disk format being revised? I may have imagined that (EDIT: Yes, I did imagine it)... but best to use Sparta 3.2 and up anyway. The documentation is definitely 100 per cent correct regarding current incarnations of SDFS.

Edited by flashjazzcat
  • Like 1
Link to comment
Share on other sites

SpartaDOS 1.1 doesn't seem to differ:

Altirra> .diskdumpsec -d 2 1
Sector 1 / $1 (128 bytes):
000: 00 03 00 40 00 00 4C 80-40 05 00 D0 02 B7 02 01 |...@..L.@.......|
010: 04 00 25 00 07 00 46 4F-4F 20 20 20 20 20 28 80 |..%...FOO     (.|
020: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
030: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
040: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
050: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
060: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
070: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
Altirra> .diskdumpsec -d 2 5
Sector 5 / $5 (128 bytes):
000: 00 00 00 00 06 00 00 00-00 00 00 00 00 00 00 00 |................|
010: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
020: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
030: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
040: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
050: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
060: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
070: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
Altirra> .diskdumpsec -d 2 6
Sector 6 / $6 (128 bytes):
000: 28 00 00 2E 00 00 4D 41-49 4E 20 20 20 20 20 20 |(.....MAIN      |
010: 20 00 00 00 00 00 00 08-20 00 5D 02 00 43 4F 4E | ....... .]..CON|
020: 46 49 47 20 20 44 4F 43-15 01 56 0A 05 12 00 00 |FIG  DOC..V.....|
030: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
040: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
050: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
060: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|
070: 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 |................|

Link to comment
Share on other sites

If the OP is using a Hex editor to read an atr He might be confusing the header of the ATR.

Not an ATR. It's XFD, no header.

 

Did the very ancient versions of SpartaDOS not put the root directory at a fixed location, prior to the disk format being revised? I may have imagined that (EDIT: Yes, I did imagine it)... but best to use Sparta 3.2 and up anyway. The documentation is definitely 100 per cent correct regarding current incarnations of SDFS.

I'm writing code that reads existing disks. Don't really have the option of specifying a particular version.

 

Could there be some doubt over sector numbering clouding the issue here? Logical sectors on the A8 are numbered starting at $01, not $00. Numbering them from $00 onwards would explain the misconception completely.

 

Good idea, but it seems to me more than coincidental that if you number the sectors from 0, the value in the boot sector points straight at the main directory's first data sector.

I will double check that idea later when I'm not on my iPad. However, the sector preceding the directory info didn't appear to be a sector map, so there's still that.
Link to comment
Share on other sites

First, FlashJazzCat, you were right about me counting from 0 instead of 1. However, it turns out that sector 5 on my disk image was corrupted, which is why it didn't make sense as a sector map.

 

I started looking at the rest of the disk, which is mostly ACTION! source code, and found a few sectors that have garbage intermingled with the expected ATASCII text. This got me wondering, so I dug out an archive CD-R which had all my old 8-bit stuff on it. When I looked at that version of the same file I discovered they didn't match. Somewhere along the way, things got messed up.

 

So now I'm starting over with new image files, freshly formatted.

 

Thanks for your time, everybody!

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