Contents

  1. Features Of The Mountable File Systems
  2. Implementing Your Own External File System
  3. Running The Example.

1. Features Of The Mountable File Systems

Once a file system has been mounted, there should appear to be no difference between a file that resides on the local file system and one that is external. All interactions with files should occur through the standard java.io classes and the com.dalsemi.fs.DSFile class.

The driver interface has been written such that a variety of systems can be implemented. The developer has the freedom to handle files in whatever way is appropriate for their design. Possibilities include a Network File System (NFS) implementation, a FTP file system where files are written to and read from an FTP server, or an IDE hard drive connected to TINI.

Here are the basics:


2. Implementing Your Own External File System

There are three steps to implementing your own mountable file system.

First, you must implement the com.dalsemi.fs.FileSystemDriver interface. This class may use a native library, rely on a server running elsewhere (like the included example), or any number of other options.

Second, you must make the class (or classes) available to your process. This can be done by placing a copy of the classes in TINI's classpath or by including them in the TINIConvertor step.

Finally, the file system needs to be mounted. You can either call the com.dalsemi.fs.DSFile.mount(*) method from inside your application, or you can use the mount command in slush. There is also an unmount method in the same package and an unmount slush command.

NOTE: The mount and unmount command are not included in the slush binary, but the source is available in the OptionalSlushCommandsSrc.jar file. See Section 3.2 of this readme for an easy way to add them without rebuilding slush.


3. Running The Example.

An example is included that uses sockets to transmit file information from a server to TINI's file system. This is only an example, and could probably use some hardening (especially some error checking/handling) before attempting to use it in a real world application. There is certainly enough there, however, for a solid demonstration of what can be accomplished.

To run the example, complete the following steps:

  1. Install TINIOS 1.10 Beta 2.

  2. Include the mount and unmount commands in slush. To do this, first extract and compile the source files from the OptionalSlushCommandsSrc.jar file. Then ftp the class files into the /tiniext/com/dalsemi/slush/command directory. Run the following commands at the slush prompt:

           addc com.dalsemi.slush.command.MountCommand mount
           addc com.dalsemi.slush.command.UnmountCommand unmount
  3. Compile the two source files included (NetworkFileSystemDriver.java and NetworkFileSystemHost.java) using the following commands:

           javac -bootclasspath <TINI1.1b2>\bin\tiniclasses.jar NetworkFileSystemDriver.java
           javac NetworkFileSystemHost.java
    where <TINI1.1b2> is your TINI1.1 installation directory.

  4. FTP the NetworkFileSystemDriver.class file into your tiniext directory.

  5. Start the server with the following command:

           java NetworkFileSystemHost <startDir>
    where <startDir> is the directory you want visible to your TINI.

  6. In slush, mount the file system with the following command:

           mount mnt NetworkFileSystemDriver <host ip> 3453
    where <host ip> is the ip address of the machine where the server is running.

That's it. Play around at the slush prompt a while and see what you can do. You should see a directory in the root of TINI's file system called "mnt". If you cd into it you will see files from the server. Try cat'ing one of the text files. Put a HelloWorld.class file in that directory and run it from the slush command line. You should be able to make and remove directories, rearrange files, etc. Have fun. Questions and comments can be directed to the TINI user group.

NOTE: The first time you access the mounted directory, there will be a delay while the driver class is dynamically loaded. Subsequent operations should then be faster.