VFS Article

All about the OSDev Wiki. Discussions about the organization and general structure of articles and how to use the wiki. Request changes here if you don't know how to use the wiki.
Post Reply
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

VFS Article

Post by thepowersgang »

I have just created an article on VFS. It is rather barebones but has some information. I would like it if someone would read over it and fix any errors/omissions.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

Hi,

As you say, it is quite barebones but is a good start. I don't know enough background for fact checking, but a quick proof-read didn't show up any problems!

I know it's meant to be an article rather than a tutorial, but it may be useful to define how the VFS fits in with on-disk FS's and things like the device file system. I don't necessary mean code - just a diagram or something?

Cheers,
Adam
z180
Member
Member
Posts: 32
Joined: Tue Mar 04, 2008 12:32 pm

Post by z180 »

I used for my VFS work a paper from Sun that tells about the VFS
from SunOS 2.0 that was later 1990 integrated into 4.3BSD-Reno
and System V 4.0 and some less known systems(uwisc 4.3 from unix archive).Also I found papers on stacking VFS on the net.
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Post by thepowersgang »

Thanks AJ
I will try to get some diagrams and integrate a more thourough definition into the next version.

z180: Can you point me to those documents. The content on the current article comes from a tutorial by JamesM and my own personal experience.

EDIT:
Could someone please read JamesM's tutorial (See the bottom of the Wiki Article for link) and find out how his model defines mountpoints? I can see how they are stored but I cannot see how the flag and information are set.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

thepowersgang wrote:Thanks AJ
I will try to get some diagrams and integrate a more thourough definition into the next version.

z180: Can you point me to those documents. The content on the current article comes from a tutorial by JamesM and my own personal experience.

EDIT:
Could someone please read JamesM's tutorial (See the bottom of the Wiki Article for link) and find out how his model defines mountpoints? I can see how they are stored but I cannot see how the flag and information are set.
I've read that tutorial. What exactly don't you see how's set? (wow that could have been phrased better but I'm pretty drunk right now)

I haven't actually covered using the VFS to mount stuff as yet (will be in a later tutorial) but the basic gist of it is that you take a directory node and add the "mountpoint" flag. This then makes the symlink pointer (pointer to another VFS node) active, which points to the root directory node of the mounted FS.
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Post by thepowersgang »

The idea I don't get is how the flag is saved, is it stored on the file system or does the VFS hack it in somehow.
From what I can see there is only one node that is permanently stored in memory: the root node. So how does the mount flag get to be persistent?
User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Post by Jeko »

I have a document on VFS handling. But it's pdf and I can't upload this here. I can send it to you if you want
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Post by thepowersgang »

that would be quite useful, can you please send it to the address in my profile?
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

thepowersgang wrote:The idea I don't get is how the flag is saved, is it stored on the file system or does the VFS hack it in somehow.
From what I can see there is only one node that is permanently stored in memory: the root node. So how does the mount flag get to be persistent?
All nodes are stored in memory. Just the only node you have a permanent pointer to is the root node. From the root node you can traverse to any part of the VFS tree.

A node is a mountpoint if the following is true:

Code: Select all

(node->flags & FS_DIRECTORY) && (node->flags & FS_MOUNTPOINT)
And if the node is a mountpoint (if the above statement is true), the node_t* member of the node is used to find the root node of the mounted filesystem.

As for "persistent", I don't understand what you mean - do you mean persistent over reboots? In which case it doesn't, just as it doesn't on a linux or bsd system. On every reboot all filesystems are mounted again - mountpoints aren't persistent. (This is the reason for the file /etc/fstab).
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Post by thepowersgang »

Thanks, I thought that the nodes were not stored in memory so that made me confused.
User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Post by Jeko »

thepowersgang wrote:that would be quite useful, can you please send it to the address in my profile?
Ok! No problem.
I send you also some useful links.
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Post by thepowersgang »

I've updated the article with a more complete and a description of a version between a 100% memory resident node model and a mount list only.

I've also fixed the artifacts in the diagram and coloured it in.

Could someone read the article and check for grammatical errors.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Post by bewing »

A few small grammatical and punctuation twists, but a heck of a lot better than most of the wiki. It will do just fine.

Nice graphic! :)
Post Reply