Introduction
XFS or eXperimental File System is a file system architecture designed for XOS (eXperimental Operating System).
XFS is a simple filesystem which has no directory structure.
XFS spans the entire disk in XSM (eXperimental String Machine).
The disk consists of a linear sequence of 512 blocks.
The basic unit of storage in XSM is a block.
The size of the block is equal to that of page in memory (512 words).
The total capacity of the disk is 512 * 512 = 262144 words.
Any particular block in the disk is addressed by the corresponding number in the sequence 0 to 511 known as the block number.
File
A file is a collection of blocks identified by a name.
Every file in the disk has a Basic Block and several Data Blocks.
They are defined as follows:
Basic Block: It consists of information about the data in a file.
Data Blocks: These blocks contain the actual data of a file.
The structure of the basic block is given below.
Index | 0--255 | 256--511 |
Content | Block List | Header |
- Block List: It contains block addresses of all data blocks in the file.
- The block list consists of 256 entries.
- Each entry is of size one word.
- The value contained in an entry of the block list gives the block number of the corresponding data block in the disk.
All invalid entries are marked with -1.
- Header: The header contains meta information related to the file. The header field is 256 words long. It can be used to store details like permissions, ownership, etc related to a file, similar to inode in Linux and UNIX operating systems. However, XOS does not use the header field.
Example
Consider the example illustrated by figure 3. From the figure, we infer the following:
- The zeroth data block of the file resides in the disk in block number 240
- The first data block of the file resides in the disk in block number 420. The second data block of the file resides in the disk in block number 101. The third data block of the file resides in the disk in block number 315
- There are no more data blocks for the file. So rest of the entries of the basic block are marked as -1.
File Types
There are two types of files in the XSM architecture. They are:
Data files
These files contain data or information that is used by the programs. They can occupy a maximum of 257 blocks (1 basic block + maximum 256 data blocks). Data files have an extension .dat in the filename.
Executable files
These contain programs that the user wishes to run on the machine. They occupy 4 blocks (1 basic block + 3 data blocks) of the disk. Executable files have an extension .xsm in the filename.