![]() |
CEG 433/633: Operating SystemsP1: Links and Medium Size Files |
This is Part 1 of the project for this term. This part deals with only one file volume at a time. We still do not have subdirectories. No mounting is involved. Our goals in this part of the project is to (i) add the ability to store and retrieve medium files, and (ii) to add hard and soft links in a file volume built on the simulated disk of P0. Large files are not necessary in this part.
You are expected to build on your own work of P0. Do not use source code files of others or even those of mine but from prior terms. The Project Expectations are all still applicable.
Be Considerate. Do make sure that you are not using up too much space (say
> 10 MB) in your home directory. The following will show your disk space usage: du -s ~
We define medium files as those using an i-node's (i) direct block number entries, and (ii) requiring single-indirect blocks.
Large files are those using an i-node's (i) direct block number entries, and (ii) requiring single-indirect blocks, and (iii) requiring double-indirect blocks For bonus points, implement large files also.
From the lectures, you should know the definitions of hard and soft links. Resolve any missing detail in the semantics of links so that it matches with that in Unix. (E.g., if you cd via a soft-link to directory D, where should you be after a cd .. ?)
DO's and DONT's:
Implement the commands described below. All the commands of the project so
far should be working as they did before, but now
also should work for links and medium files; so only the additional
elements are described below. In your testscript.txt,
demonstrate that each new command and all the old commands work with links and
medium files. Note that the addition of medium files does not bring in any "new"
commands.
fs33% mkfs disknm disknm.dsk. Note that the i-node height now includes not only the fileSize
field, but also the link count.
fs33% findfs disknm disknm.dsk.
All files etc. that were created in previous sessions on this volume remain intact. The file volume so
re-constructed is the current file volume as used in later commands. If disknm.dsk is not already
created, do so now, making this then equivalent to mkfs disknm.
npnm as a new hard link to opnm, and prints its i-node number. It creates
nothing new and returns 0 in the following "abnormal" cases: a) opnm is a directory; b) no ordinary file with
opnm as its path name exists; c) npnm already exists; d) npnm is an invalid pathname.opnm in the current directory and prints its i-node
number. Abnormal cases similar to the above apply. For bonus points, add the flexibility that this command may omit the dot.npnm as a soft link to opnm, and prints its i-node number. It creates nothing new
and returns 0 in the following "abnormal" cases: a) opnm does not exist; b) npnm already exists; c)
npnm is an invalid pathname.pnm, which may or may not be a link, and prints the resulting link count.Compile, link and make P1 as implied by a decent extension of the Makefile
given in P0.tbz. As you make P1, collect the following information in a
file called answers.txt.
shell.cpp. And,
for each imported symbol, note which source code file is exporting the
corresponding item.size on the
object code files, and P1. Explain why the sum of corresponding
numbers of individual files do/do-not equal those of P1 as given by
size.All submissions must be done in the OSIS Lab using the turnin
program. We will be running your programs on the machines in OSIS Lab only.
The command to use for this part looks like this:
/home/ceg433/ceg43300/bin/turnin P1 names-of-files-you-wish-to-submit
![]() |
Grading Sheet for P1: Links and Medium Size Files
Instructor = Prabhaker Mateti;
|
| Extra credit points are awarded in recognition of good work and extra work, in addition to the max possible points. Quality is subjectively judged. Merely turning in a file will not receive full score. Some items have a cascading effect. | |
| Student | OSIS Login ID | Bonus | Points |
| Item description | Max | Points |
Your testscript.txt should be
designed so that all the P0-functionality
in the context of the new links and medium sized files
can be demonstrated, including robustness. |
5 | |
Your P1 successfully navigates your own testscript.txt.
( If yours is too simple, we may run it through our script that you
will get to see only after the due date.) |
5 | |
cp works with medium size files |
10 | |
mv works with medium size files |
10 | |
rm works with medium size files |
10 | |
ln opnm npnm |
10 | |
ln opnm . (dot at the end) |
5 | |
ln -s opnm npnm |
5 | |
cp hard-link-pnm pnm |
5 | |
cp soft-link-pnm pnm |
5 | |
rm hard-or-soft-link-pnm |
5 | |
mv soft-link-pnm pnm |
5 | |
mv hard-link-pnm pnm |
5 | |
inode updated to show all i-node fields |
5 | |
answers.txt |
10 | |
ln opnm no-dot (bonus points) |
B10 | |
| Large files (bonus points) | B50 | |
| Late submission: minus 2% per day late; Not accepted at all after 4 days | -8 | |
Files were not submitted using turnin program = minus 10
points |
-10 | |
| Total | 100 |
| Copyright © 2009 pmateti@wright.edu |