Briefly explain two important functions of the VFS layer used to isolate the basic system call functionality from the implementation details for integration of multiple types of file systems into a directory structure.
Answer
VFS(Virtual File Systems) is a way to abstract out the implementation details of file systems and reach at a common skeleton for implementing a system call across various file systems. VFS defines a set of abstract objects(like files, directories,superblocks,etc)and operations(that can be performed on each of these objects). Two important function of VFS layer to isolate basic system call functioanlity from the implementation details are:
1)Each and every file system that can be accessed through Virtual File System must have data structures equivalent to the abstract objects. Hence it must implement the functions defined by VFS on the objects and must register a pointer to these functions with the VFS subsystem. Thus whenever a system call is made, VFS translates it into a set of function calls on the abstract objects and invokes the registered file system functions accordingly.
2)It permits the per process per user configuration hence it is very easy to add new drivers which will help in integration of file systems.The ability to uniquely identify a file across the network helps in accessing the file easily throughout the network.
Explain the sequence of events that happens when a page-fault occurs.
When the OS(Operating System) cannot load the desired page into memory,
a page-fault occurs. First, the memory reference is checked for validity.
the program will be terminated,when request is invalid. If the
request was valid, a free frame is located. A disk operation is then
scheduled to read the page into the frame just found, update the page
table, restart the instruction that was interrupted because of the page
fault, and use the page accordingly.