XFS Interface Usage Specification



XFS Interface (eXperimental File System Interface) is an external interface to access the eXpFS filesystem of the eXpOS "from the host (UNIX) system". The filesystem is simulated on a binary file called disk.xfs. The interface can format the disk, dump the disk data structures, load/remove files, list files, transfer data and executable files between eXpFS filesystem and the host (UNIX) file system and copy specified blocks of the XFS disk to a UNIX file.

Within your xfs-interface directory, use the following command to run the interface

  •       ./xfs-interface

Note : XFS interface must not be run while the XSM simulator is run concurrently as it might leave the file system in inconsistent state.

You can also run a single command in the xfs-interface by

./xfs-interface < command >

The various commands available in XFS Interface are discussed below.

  • Help

    • Syntax : help
    • Semantics : It displays the general syntax and function of all the commands.
  • Disk Formatting

    • Syntax : fdisk
    • Semantics : It is used to create the disk (”disk.xfs”) or to format the disk if already created. On a newly created/formatted disk default entries for the Disk Free List, Inode Table, Root File and User Table are initialized according to the XFS implementation for the XSM machine. These include entries for the root file in the Inode table, entry for the root file itself in the root file, entry for the special users "root" and "system" in the user table etc.
  • Loading Files

    The command load is used to load files from the UNIX filesystem to the XFS disk. The type of the file that is loaded is specified by the first argument. The second argument <pathname> is the path to the UNIX file which is to be loaded to the filesystem.

    The command checks the size of the executable/data file, allocates the required number of blocks for the file, updates the disk free list and creates the corresponding inode table and root file entries for the file. xfs-interface recognizes the disk blocks designated for the timer, console and disk interrupt handlers, the exception handler, idle process, the shell code, OS modules and the OS startup code by the eXpOS implementation on the XSM machine and loads these modules to the appropriate places.

    The various load commands are listed below :

      1. Syntax : load --exec <pathname>
        Semantics : Loads an executable file to XFS disk after allocating sufficient disk blocks and creating inode table and root file entries.
      2. Syntax : load --data <pathname>
        Semantics : Loads a data file to XFS disk after allocating sufficient disk blocks and creating inode table and root file entries.
      3. Syntax : load --init <pathname>
        Semantics : Loads INIT/Login code to the recognised XFS disk blocks.
        Note: Login code will be the INIT code in Multi User mode implementation of eXpOS.
      4. Syntax : load --os <pathname>
        Semantics : Loads OS startup code to the recognised XFS disk blocks.
      5. Syntax : load --idle <pathname>
        Semantics : Loads Idle code to the recognised XFS disk blocks.
      6. Syntax : load --shell <pathname>
        Semantics : Loads Shell code to the recognised XFS disk blocks.
      7. Syntax : load --library <pathname>
        Semantics : Loads Library to the recognised XFS disk blocks .
      8. Syntax : load --int=timer <pathname>
        Semantics : Loads Timer Interrupt routine to the recognised XFS disk blocks.
      9. Syntax : load --int=disk <pathname>
        Semantics : Loads Disk Interrupt routine to the recognised XFS disk blocks.
      10. Syntax : load --int=console <pathname>
        Semantics : Loads Console Interrupt routine to the recognised XFS disk blocks.
      11. Syntax : load --int=[4-18] <pathname>
        Semantics : Loads the specified Interrupt routine to the recognised XFS disk blocks.
      12. Syntax : load --exhandler <pathname>
        Semantics : Loads exception handler routine to the recognised XFS disk blocks.
      13. Syntax : load --module [0-7] <pathname>
        Semantics : Loads a module to the the recognised XFS disk blocks.
  • Exporting Files

    The command export is used to export data files from the XFS disk to the UNIX filesystem. The argument <xfs_filename> specifies the file which is to be exported and the argument <pathname> specifies the UNIX file to which it is to be exported.

    The command searches the inode table entries for the data file and copies all the blocks corresponding to the file to the UNIX file specified. Note that if the argument <pathname> is not given the file will be stored at $HOME/myexpos/xfs-interface/ and named as <xfs_filename>.

      1. Syntax : export <xfs_filename> <pathname>
        Semantics : Exports a data file from XFS disk to UNIX file system.
  • Removing Files

    The command rm is used to remove files from the XFS disk. The argument <xfs_filename> specifies the file which is to be removed.

    The command searches the inode table entries for the file (executable/data file) and clears the blocks corresponding to the file, updates the disk free list and removes root file and inode table entries. Only data and executable files can be removed.

      1. Syntax : rm <xfs_filename>
        Semantics : Removes an executable/data file from XFS disk.
  • Listing Files

    • Syntax : ls
    • Semantics : It lists all the files which are loaded into the filesystem. The size of the file is also displayed in number of words. This is done by traversing through the inode table entries.
  • Display Disk Free List

    • Syntax : df
    • Semantics : It displays the Disk Free List. It also displays the total number of blocks and the number of free blocks.
  • Display File Contents

    • Syntax : cat <xfs_filename>
    • Semantics : It displays the contents of a file in the filesystem. The inode table entries are searched to get the blocks corresponding to the file and then the blocks are displayed.
  • Copying Disk Blocks to a UNIX File

    • Syntax : copy <start_block> <end_block> <unix_filename>
    • Semantics : It copies the contents of specified block(s) in the filesystem to an external UNIX file and the file will be stored at $HOME/myexpos/xfs-interface/ directory. The arguments <start_block> and <end_block> denotes the range of blocks to be copied (including both). <unix_filename> specifies the destination UNIX file to which the contents are copied.
  • Dumping Disk Data Structures to a UNIX File

    The command dump is used to dump/export the disk data structures (inode table and root file) to the predefined UNIX files as follows. The files are dumped to $HOME/myexpos/xfs-interface/ directory.

    • Syntax : dump --inodeusertable
    • Semantics : It copies the contents of inode table and user table to an external UNIX file named inodeusertable.txt.
    • Syntax : dump --rootfile
    • Semantics : It copies the contents of root file to an external UNIX file named rootfile.txt.
  • Batch Mode Execution of Instructions

    • Syntax : run <pathname>
    • Semantics : It executes the set of xfs-interface commands specified in the <pathname>, sequentially. Note that, the set of commands in the file should be separated by a new line. For example, a batch file that loads timer, disk and console interrupt handlers might appear appear as below:

      load --int=timer $HOME/myexpos/spl/spl_programs/timer.xsm
      load --int=disk $HOME/myexpos/spl/spl_programs/disk.xsm
      load --int=console $HOME/myexpos/spl/spl_programs/console.xsm
  • Exit Interface

    • Syntax : exit
    • Semantics : It quits the interface.