Author Topic: VFS Notes  (Read 1738 times)

0 Members and 1 Guest are viewing this topic.

Offline Warrior

  • supreme mac daddy of trolls
  • Hero Member
  • *****
  • Posts: 7507
  • One for a Dime two for a Quarter!
    • View Profile
VFS Notes
« on: February 10, 2006, 10:37:30 PM »
In an attempt to respark interest in this forum I'm going to post this.
NOTE: It may seem like I'm talking to myself in these notes (I actually am) mostly ideas.


Main FS:
The main FS of the HD will be ext2
All files will be stored on there

VFS Notes:

The VFS will be the "Backbone" of the entire FS structure type

You will have the Option to do something like
vfsCreateVirtualFolder("/devices", FLAGS_HERE);
Examples of virtual created folders:
   /devices
   /consoles
   /processes

Then most likely you'd be able to do something like

if (!vfsInVirt("/devices", "fd0");
{
   vfsAddtoVirt("/devices", "fd0");
}

Perhaps we invoke a "Virtual Handler" for each one of these and I include
consoles and processes when I say this

----------------------------------------------------------------

A good thing to think about would be implementation of a "Mount"
like feature for FSes.

DRAFT:


FSINFO *myFS;
FSRESULT fsResult;

myFS->Name = "Test Filesystem";
myFS->OpenFunc = thisFSOpen;
myFS->CloseFunc = thisFSClose;
myFS->MountFunc = thisFSMount;
myFS->UnmountFunc = thisFSUnmount;
myFS->ReadFunc = thisFSRead;
myFS->WriteFunc = thisFSWrite;
/* ... etc ... */

fsResult = vfsRegisterFS(myFS);
if (fsResult == NULL)
{
   osReport("FS: myFS failed to register with the VFS");
}
---------------------------------------------------------------

Things vfsOpen("myfile.txt") need to consider,

Check if the file has a absolute path on it (/bin/ls)
   If it doesn't
      Check if the file is in the folder
         If it is
            Execute
         Else
            Raise an error
   If it does
      Ask the VFS which FS is mounted in the folder
      It will either return a root FS mounted or whatever special FS is mounted.
      Then we just invoke that specific FS handler

TODO:
Should the Filesystem be part of the Device Driver Interface? I'm considering having
vfsRegisterFS() add it to the driver list itself.

More thinking: How will drivers be stored on system shutdown? Do we detect all drivers on system boot?
I'm thinking only detect things like PnP and PCI Devices.

Well actually most drivers are on the PCI and if not they are PnP.
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling