CSCI 3323 (Principles of Operating Systems), Fall 2020:
Homework 5a
- Credit:
- 20 points.
Be sure you have read, or at least skimmed, Chapter 4.
Answer the following questions. You may write out your answers by
hand and scan them, or you may use a word processor
or other program, but please submit a PDF or plain text
via e-mail to my TMail address.
(No links to shared files on Google Drive please.)
Please use a subject line that mentions the course and
the assignment (e.g.,
“csci 3323 hw 5a” or
“O/S hw 5a”).
- (5 points)
Consider a digital camera that records photographs
in some non-volatile storage medium (e.g., flash memory).
Photographs are recorded in sequence until the medium
is full;
at that point, the photographs are transferred
to a hard disk and the camera's storage is cleared.
If you were implementing a file system for the camera's
storage,
what strategy would you use for file allocation
(contiguous, linked-list, etc.) and why?
Note that this camera does not have the ability to
delete photographs from its storage one at a time,
so your file system does not need to support that.
(It's probably best to think of this as a somewhat
hypothetical problem, using only the description supplied,
rather than trying to extrapolate from any experience
you have with actual cameras.)
- (5 points)
The textbook describes more than one strategy
for keeping track of free blocks in a file system
(free blocks, bitmaps, and FATs).
All of these strategies rely on information that is kept
both on disk and in memory,
sometimes with the most-current information only in memory.
What would happen if the copy on disk of
whatever data structure is used to
keep track of free blocks was lost or damaged
because of a system crash --
is there a way to recover,
or do you have to just reformat the disk and hope you
backed up any really important files?
Answer separately for systems using a FAT (such as MS-DOS FAT-16)
and systems using i-nodes and a free list or bitmap
(such as UNIX V7).
- (5 points)
Linux includes code to access several types of Windows filesystems,
including FAT-32.
So on a system where one of the disk partitions holds a
FAT-32 filesystem,
one can configure Linux to access
this filesystem, through pathname /windows/fat
for example.
However, all the files in
/windows/fat appear to be owned by user root,
and attempts to change their ownership
(with the chown command) fail with an error message
“Operation not permitted”.
This happens even when the user trying the command is
root (a.k.a. the superuser).
What's wrong?
- (5 points)
Section 4.5.2 describes a UNIX filesystem
in which each i-node contains
10 direct entries,
one single indirect entry,
one double indirect entry, and
one triple indirect entry.
If a block is 1KB (1024 bytes)
and a disk address is 4 bytes,
what is the maximum file size, in KB?
(Hint: Use the blocksize and size of disk addresses
to determine how many entries each indirect block contain.)
Include the Honor Code pledge or just the word “pledged”,
plus at least one of the following about
collaboration and help (as many as apply).1Text in italics is explanatory or something for you to
fill in.
For programming assignments, this should go in the body of the e-mail
or in a plain-text file pledge.txt (no word-processor files
please).
- This assignment is entirely my own work.
(Here, “entirely my own work” means that it's
your own work except for anything you got from the
assignment itself -- some programming assignments
include “starter code”, for example -- or
from the course Web site.
In particular, for programming assignments you can
copy freely from anything on the “sample programs page”.)
- I worked with names of other students on this
assignment.
- I got help with this assignment from
source of help -- ACM
tutoring, another student in the course, the instructor, etc.
(Here, “help” means significant help,
beyond a little assistance with tools or compiler errors.)
- I got help from outside source --
a book other than the textbook (give title and author),
a Web site (give its URL), etc..
(Here too, you only need to mention significant help --
you don't need to tell me that you
looked up an error message on the Web, but if you found
an algorithm or a code sketch, tell me about that.)
- I provided help to names of students on this
assignment.
(And here too, you only need to tell me about
significant help.)
Include a brief essay (a sentence or two is fine, though you can write
as much as you like) telling me what if anything you think
you learned from the assignment, and what if anything you found
found interesting, difficult, or otherwise noteworthy.
For programming assignments, it should go in the body of the e-mail
or in a plain-text file essay.txt (no word-processor files
please).
Footnotes
- ... apply).1
-
Credit where credit is due:
I based the wording of this list on a posting to a SIGCSE mailing list.
SIGCSE is the ACM's Special Interest Group on CS Education.
2020-12-03