Jump to content
IGNORED

Dos 2.0-type Directory Decode?


Larry

Recommended Posts

Before I spend time writing a Basic program to decode the information of a Dos 2.0-type directory, I would think that this has been done many times before.  Yet, I haven't found one in my library.  Is anyone aware of one?  I'd like for it to be Basic so that I can easily modify it, and able to handle SD or DD.

Thanks,

Larry

Link to comment
Share on other sites

I remember doing a shorthand quick/dirty one in the days before i had Dos 2.5XL (which is a hack that allows DUP and MEMSAV to be had in the Ram under the OS).

 

In immediate mode:

 


O.#1,6,0,"D:*.*":F.A=1TO99999:GET#1,D:PUT#16,D:N.A

 

You get Error 136 and the file remains open but it doesn't really matter - type END so the file gets closed if you want.

 

Inside a basic program it's sort of the same.  You can use INPUT # to get entire file entries into a string.  You should use TRAP so the end of file doesn't get you, though in theory you could probably test for the "FREE SECTORS" text.

Link to comment
Share on other sites

Not quite sure on which level you want to understand this. On a pure basic level, it is just a matter of opening "D:*.*" with AUX1=6 and read lines until an EOF. But this is probably not what you need. If you need to decode the raw (binary) version of a directory, then an entry consists of one byte of flags, two bytes of the size in sectors, two bytes of the start sector, 8 bytes for the file name, and 3 bytes for the extender. This makes 16 bytes per entry. For the precise layout, I need to check, but the MSB of the flags identify whether an entry in the directory is deleted or not (and if deleted, it is not shown and the entry can be recycled). If the flags is 0, then this ends the directory. Bit 5 is (if I recall correctly) the "I am write protected" flag, and bit 2 is always set to identify that the file is in Dos 2 layout (as compared to Dos 1 which has a different sector link). Then, some "invalid" combinations have been allocated by Dos 2.5 to indicate "I am outside of the 720 VTOC", and by Dos 2.++/Dos 2.XL to indicate "I am a headline".

  • Like 1
Link to comment
Share on other sites

Thanks for the replies.  Inside Atari Dos does have a nice diagram that shows the parts that I want.  I'll look at Roy's program, and I just now  remembered that David Small wrote a program for Creative Computing (in Atari Microsoft Basic) that I converted to TBXL and expanded to include, IIRC, the features I'm needing. Probably not for DD, though. Anyway, I'll dig it out, and take a look. Offhand, I don't remember its name, but I'll find it.

 

Edit: Found it. It is "Disk Checker" by David Small in Creative Computing (and The Creative Atari which is posted at the Internet Archive).  Also found my slightly enhanced TBXL version, DSKCHK3.TBS.  Need to add a few features to make it do exactly what I'm looking for.  When I get it tuned up a bit, I'll post it here.

 

 

Link to comment
Share on other sites

Unsure about other Doses and I suspect they don't supply it, but normal CIO commands won't return stuff like start sector.

In theory you could open every file then do a NOTE but that'd take a lot of time, plus some Doses base their NOTE/POINT values on relative file position rather than absolute sector.

 

I've done a few programs that read the directory sectors and pull the info out, can put one up if you want.

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