Subject: Re: Simplest (practical) file system?

From: Megan <[email-masked]>
Date: Sun Jul 27 16:15:01 2003

>When a file is deleted, its directory entry is changed to indicate that 
>the file no longer exists, If a shorter file is then stored on the disk, 
>then the directory entry is changed again for the new file. THis then 
>leaves some unused blocks on the disk which can't be used becuase there's 
>no way to create a directory entry in the right place in the directory.

RT handles this by adding a directory entry to describe the unallocated 
portion of the previous free space.  This might mean having to move 
directory entries in a segment, and may require a segment split.

                                        Megan Gentry
                                        Former RT-11 Developer

+--------------------------------+-------------------------------------+
| Megan Gentry, EMT/B, PP-ASEL   | email: mbg at world.std.com         |
| Member of Technical Staff      |        megan at savaje.com          |
| SavaJe Technologies, Inc.      |             (s/ at /@/)             |
| 100 Apollo Drive               | URL:     http://world.std.com/~mbg/ |
| Chelmsford, MA 01460           | "pdp-11 programmer - some assembler |
| (978) 256 6521   (DEC '77-'98) |  required." - mbg            KB1FCA |
+--------------------------------+-------------------------------------+

---

From: "Dwight K. Elvey" <[email-masked]>
Date: Mon Jul 28 12:00:01 2003

>From: "ben franchuk" <[email-masked]>
>
>Bob Shannon wrote:
>> What is the simplest usable disk file system to implement?
>> 
>> More specifically, if your going to write a disk file system from 
>> scratch, what would be the easiest way to implement
>> some basic file system functionality?
>> 
>> How did some of the very early DOS systems allocate disk space in the 
>> days before FAT tables, etc?
>> 
>> Just how simply can this be done?
>> 
>> 
>
>Use the whole disk ... block by block ...  FIG FORTH worked this way.
>

Hi
 On one of my Forth setups, I wrote a word that would
take the first number on a line of text in some block and
then use that number as the next block to bring up. This
way I'll edit a number of blocks as an index of the rest
of the text/code on the disk. I could then pass this number
on to words like LOAD, INDEX or EDIT. This made a simple
directory setup with a method for accessing portions
of the disk as different types of data. I'd place this
word as a single key stroke in my editor so that I could
use this word or just maintain the directory. I made it
a rule to put both the starting block and the last block
in the directory entry. This directory would look something
like:

10 25 EDIT comments
26 29 ASSEMBLER
2A 2B PROGRAMMER

 Although, it kept the block numbers in ASCII, the time
to convert to machine numbers is a small portion of the
overall access time. Keeping the numbers as HEX values
means that the conversion routines can be optimized
for simpler processor and still be in a human readable
format.
 I'd intended to add words that would maintain disk space
but so far, I've just maintained things by hand. Still,
one can see that with just a few extra words added, one can
do a reasonable OS without the need for a true FAT. Adding
words like a DELETE and a GARBAGE collector would make
a reasonable disk OS.
 I did add a search words to my directory setup. This way
I could find the EDITor fast if it was on some other
block of my simple directory.
 The advantage of just starting with simple blocks is that
one can expand it over time to even deal with sequential
files ( what most consider random length streamy file ).
 At first, one can keep even the editor simple by having
fixed length text lines, as a Forth block system does.
A block is 1024 bytes. When displayed as text, it is
a fixed chunk of 16 lines of 64 characters.
Dwight

---

From: "Dwight K. Elvey" <[email-masked]>
Date: Mon Jul 28 12:16:00 2003

>From: "Bob Shannon" <[email-masked]>
>
>ben franchuk wrote:
>
>>
>Very tempting, as I'm adding a file system to a threaded interpreter 
>(not FORTH).
>
>But a basic block system is just too primative.  Named files at a minimum.
>

Hi Bob
 As I've shown in my previous mail, you can use it as
a starting place. I also have some code that I wrote to
maintain files on a DOS disk. It is bassed on the original
block system. Although, I didn't expand it to include
sub-directories, this could be added with a small additional
amount of code. The main thing is to get something working
and keep things open enough that you can expand later.
 I wrote the DOS stuff so that I could more easily transfer
things between my PC and my block system. Start simple and
work towards a later complete system.
Dwight