Starman Posted January 3, 2022 Share Posted January 3, 2022 (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 January 3, 2022 by Starman Quote Link to comment Share on other sites More sharing options...
drac030 Posted January 3, 2022 Share Posted January 3, 2022 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. Quote Link to comment Share on other sites More sharing options...
Rybags Posted January 4, 2022 Share Posted January 4, 2022 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. Quote Link to comment Share on other sites More sharing options...
stepho Posted January 6, 2022 Share Posted January 6, 2022 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 Quote Link to comment Share on other sites More sharing options...
Starman Posted January 6, 2022 Author Share Posted January 6, 2022 @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 And then right after I started reading the DOS book, I found that FAT is being implemented already. 1 Quote Link to comment Share on other sites More sharing options...
+David_P Posted January 7, 2022 Share Posted January 7, 2022 You may also want to look at the SpartaDOS X ongoing development work; they have a very detailed programming guide. http://sdx.atari8.info/index.php http://sdx.atari8.info/sdx_files/4.49/SDX449_Programming_Guide_EN.pdf 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.