Study the http://siber.cankaya.edu.tr/OperatingSystems/moss/filesys/user_guide.html user guide for ``File System Simulator''.
Follow the steps below for installation of the software
Create a directory in which you wish to install the simulator (e.g., "moss/filesys").
$ mkdir moss
$ cd moss
$ mkdir filesys
$ cd filesys
Download the compressed tar archive (http://siber.cankaya.edu.tr/OperatingSystems/week12l/filesys.tgz filesys.tgz) into the directory.
Expand the compressed tar archive.
$ tar -zxvf filesys.tgz
Export the classpath
$ export CLASSPATH=.
Using File System Simulator;
java mkfs file-name block-size blocks
java mkdir directory-path
java ls path-name ...
java tee file-path
java cp input-file-name output-file-name
java cat file-name
java dump file-name
see the http://siber.cankaya.edu.tr/OperatingSystems/moss/filesys/user_guide.html user guide.
Hint: If you want to compile java codes as given in the manual files, you may be faced with some errors. A suggested solution is that: If there is any import statement that is used for including user-defined class, erase it. (i.e. //import Common;)
Lab work:
Use mkfs to create a file system with a block size of 64 bytes and having a total of 8 blocks. How many index nodes will fit in a block? How many directory entries will fit in a block? Use dump to examine the file system backing file, and note the value in byte 64. What does this value represent? Use mkdir to create a directory (e.g., /usr), and then use dump to examine byte 64 again. What do you notice? Repeat the process of creating a directory (e.g., /bin, /lib, /var, /etc, /home, /mnt, etc.) and examining with dump. How many directories can you create before you fill up the file system? Explain why.
Enhance ls.java to display for each file the uid and gid as decimal numbers, and the 9 low-order bits of mode as a 3-digit octal number (i.e., 000..777).