Jump to content
Sign in to follow this  
Starman

How to make custom directory layouts w/1050 (incl. time stamp)

Recommended Posts

Posted (edited)

I've been doing a lot of reading about the file structures of different disk types (SS/SD, etc.) but I can't find anything that states how a disk is formatted and what creates the directory structure. It's more like "Here's your XIO command to do it", but I can't find documentation as to what controls how the work is done.

 

For example, in De Re Atari chapter 9, there's a description of a file's directory entry, and there's no room for any attributes or time stamps beyond what's already there. So how is it done with other OSs? Do they have a custom directory structure, and if so, how? Do they keep an invisible file? Some kind of mini-FAT16? And how deep into the system do you have to go to say, if it's even possible, "I would like to add a timestamp to this disk's directory structure"?

 

Anyone work on things like this? Thanks.

Edited by Starman

Share this post


Link to post
Share on other sites

The low level formatting is being done by the disk drive's firmware. The floppy is divided into tracks and sectors. After that, the disk is empty (all sectors contain zeros).

 

The directory structure is created and written to the disk by the DOS. It is its internal fuction. XIO 255 and friends usually do both things, i.e. send a command requesting physical formatting to the drive, then write out bootsectors, directory sectors, VTOC and other things if applicable.

 

The logical disk structure (directory, VTOC etc.) is completely up to the DOS.

Share this post


Link to post
Share on other sites

Other DOSes with extra info - can be either extensible (downward compatible) or just use an entirely different data structure.

Atari DOS is somewhat weak though other 8-bit machines were as bad or worse.

No folder structure, no timestamping, and the sector links + bitmap allocation table is sort of OK for the sizes used at the time but useless for large disks.  But in it's defence it requires little in the way of buffering so good for low memory systems.

Share this post


Link to post
Share on other sites

Get a copy of "Inside Atari DOS".

Mr Google will point you to online copies or you buy a paper copy off ebay/craigslist/etc.
This book explains the why's in great detail.
It also adds in the actual code for how DOS 2.0S was implemented.
If you really want to write your own DOS then stare at this code until you understand it - and then do your own version.
Stepping through it with a debugger will also help.

Adding subdirectories can get a bit hairy in the code.
You need to add setCurrentDirect and getCurrentDirect routines.
And every file open and directory list command needs to know about absolute addresses (eg /d1/d2/filename) vs relative filenames.
eg filename (really ./filename), ../../../filename, ../d3/filename, etc
Not really that hard but you need to dot all the i's and cross all the t's.

An example for implementing the FAT filesystem for PC's (with subdirectories, timestamps and optional long filenames) has open source code available from http://elm-chan.org/fsw/ff/00index_e.html

Share this post


Link to post
Share on other sites

@stepho - I found a copy of that right after my post, and I got a much better idea as to how the system works. I can easily do it, but of course, trying to make it backwards compatible is the trick. I'm not trying to make anything serious, I'm just doing this for my own curiosity since I've wanted to do this since 1984 :D 

 

And then right after I started reading the DOS book, I found that FAT is being implemented already. 

  • Like 1

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.
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...