Question: You are asked to develop a Minix Disk program that allows users to access a Minix disk locally mounted on a computer. You are expected
You are asked to develop a Minix Disk program that allows users to access a Minix disk locally mounted on a computer. You are expected to use C programming language. In your program, all Minix file IO related operations must use the system calls discussed in our lectures, including open close read lseek and you should not use those library functions, like fopen fclose fread and etc, for doing file IO
In this project, you may assume the block size is bytes.
Required modules:
Minix client environment a minix console: the console interface that allows users to operate on a minix disk by using the following commands:
help points: prints the commands supported in this minix console.
minimount image file points: mount a local minix disk, name as a iminix image file, eg imagefile.img
note: mounting a minix disk is equivalent to open the image.
miniumount points: umount the mounted minix disk.
showsuper points: to list the information of the super block. For example,
minix: showsuper
number of inodes:
number of zones:
number of imapblocks:
number of zmapblocks:
first data zone:
log zone size:
max size:
magic:
state:
zones:
Note: the above numbers should be extracted from the minix disk rather than being hard coded you won't received any credit for the hard coding
traverse l points: list the content in the root directory. Note that you don't have to show the and For example,
minix: traverse points
Acla
Aloopcla
Aloopjav
Aloopcla
Aloopjav
Aloopcla
Aloopjav
Bcla
Condit.cla
Condit.jav
Dcla
Demo.cla
Demo.jav
dir
PolyTest.cla
PolyTest.jav
some.cla
some.java
When switch l is turned on long list all detailed information is shown, including the file type, permission bits, user ID file size in bytes last modified date with year and the filepath name. For example:
minix: traverse l points
rwrwr Sep Acla
rwrr Dec Aloopcla
rwrr Dec Aloopjav
rwrr Dec Aloopcla
rwrr Dec Aloopjav
rwrr Dec Aloopcla
rwrr Dec Aloopjav
rwrwr Sep Bcla
rwrr Dec Condit.cla
rwrr Dec Condit.jav
rwrwr Sep Dcla
rwrr Dec Demo.cla
rwrr Dec Demo.jav
drwx Oct dir
rwrwr Sep PolyTest.cla
rwrwr Sep PolyTest.jav
rwrr Dec some.cla
rwrr Dec some.java
Hint: the mode field a byte unsigned integer in inode struct uses the following flags:
SIFMT bit mask for the file type bit fields
SIFSOCK socket
SIFLNK symbolic link
SIFREG regular file
SIFBLK block device
SIFDIR directory
SIFCHR character device
SIFIFO FIFO
SISUID setuserID bit
SISGID setgroupID bit see below
SISVTX sticky bit see below
SIRWXU mask for file owner permissions
SIRUSR owner has read permission
SIWUSR owner has write permission
SIXUSR owner has execute permission
SIRWXG mask for group permissions
SIRGRP group has read permission
SIWGRP group has write permission
SIXGRP group has execute permission
SIRWXO mask for permissions for others not in group
SIROTH others have read permission
SIWOTH others have write permission
SIXOTH others have execute permission
showzone zone number points: show the ASCII content of the specified zone number bytes for each zone If the value is not ASCII, just print the spaces instead. Tip: the library function isprint can be used to determine whether the given byte is an ASCII. Obviously, this command is actually a very useful debugging tool. For example,
minix: showzone
a b c d e f
A c l a
A l o o p c l a
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
