CSCI 4534 - Operating Systems
Assignment 4 Requirements
Operating system presentation
[50 points] This is not an individual task. You are
expected to join a project team comprising a total of exactly 4
students. Your joint task is to present the inner workings of an
operating system:
- one team will cover Windows 2000 (Mr. Dinh Lan, Mr. Doan Thanh,
Mr. Do Hai, Mr. Le Tuan),
- the other will cover Linux (Mr. Vu Dat, Mr. Le Nam, Mr. Nguyen
Tuan, Mr. Nguyen Phuong).
Your team presentation should last at least 1:40 hours and at most 2
hours, with each student presenting for a minimum of 25 and a maximum
of 30 minutes; the specific date and times are posted on the course
syllabus. You are expected to cover the material at the same level of
depth as it is covered in your textbook. The following is a suggested
approach to a successful presentation, containing additional
clarifications on expectations:
- A rough understanding of the full breadth of the operating system
is an essential starting point. So all team members should read
chapter 20 (Linux team) or chapter 21 (Windows 2000 team).
- Assign team members to specific areas of operating system
functionality, such as memory management, file system, etc. Each team
member should reread the portions of chapter 20 or 21 which cover
their assigned area(s). Your team need not cover areas of
functionality which are not part of the overall course syllabus, such
as networking.
- Each team member should then review the corresponding earlier
chapters in the book for their topic. The textbook often presents
information on a specific operating system to illustrate general
concepts, e.g. Windows 2000 Threads are covered in section 5.6.
- Be aware that some information on Windows 2000 is covered in the
book under Windows NT (which is the general family of which Windows
2000 is a recent version). Similarly, some Linux behaviour is
discussed under general UNIX behaviour (since Linux is a UNIX
variant).
- If the book's explanation is insufficient, consult additional
resources: the book's appendix A on FreeBSD (see the course syllabus
for the book's web page), on-line Linux documentation, MSDN, Microsoft
Support and TechNet, newsgroups, friends, peers, etc. You may also
consult members of the other team; this is not a competition.
- The team performance will be assessed as a whole, and every team
member will receive the same number of points for this task. So
stronger team members should assist weaker ones in completing their
tasks. Also, coordinate to ensure that you won't cover a topic more
than once, and that your presentation is cohesive; the order of
presentors is up to you.
- To earn full points, you'll need to present your material with
technical accuracy, sufficient depth, good visual aids and slides,
using excellent English, and within the specified time limits. So, in
addition to understanding the material, leave yourselves time to
prepare a good presentation.
- Try to make the most out of your presentation: invite friends,
mentors, co-workers, old teachers, and others as you see fit. This
will be a chance to show off your depth of knowledge as well as teach
your peers (and your instructor). Use it as an opportunity to
advertise your skills and knowledge.
Sounds tough? It is indeed. But it's also realistic. Consider the
following not-at-all-hypothetical scenario:
- You work for Sun Microsystems and you are about to leave for a
3-month sabbatical in Vietnam in two weeks. Even though you announced
your sabbatical 6 months ago, you are just told that Sun's India team
will be handling bug fixes for your code while you are gone, and you
must prepare a presentation to describe it to them.
- You have to describe 60,000 lines of code you wrote over 3 years,
in 3 hours between 6p-9p because India wakes up around then and at
most 3 hours can fit on the video archive DVD. Your presentation will
be over a slow shared VNC link so you can only rely on slides (no
whiteboard). Audio will travel over a low-quality voice-over-IP, so
you must speak clearly and slowly; your audience speaks English as a
second language and so do you, but they are Indian and you are not, so
your accents are mutually incomprehensible even without the
voice-over-IP compression artifacts.
- Another 40,000 of code you wrote you had passed on to a coworker
two months earlier, but he decided he no longer wanted to work on it
last week (and changed departments within Sun). So you just found out
you have to cover that material, too.
- Another 20,000 of code you wrote you had passed on to a coworker
for the last year, but he abruptly left Sun two weeks ago leaving no
documentation on his activities or information on his whereabouts. You
have to figure out what changes he made over the last year, and cover
all this in your presentation, too.
- Your presentation is in 5 days. Panicking and running away to
Mexico is not an option unless you want your four cats to eat you
alive when you can no longer afford to feed them.
Disk controller
You are given an extensible simulator of a disk controller in
csci4534.controller.MainSimulator
. This simulator keeps
track of a set of simulated disks installed on a simulated system, as
disk operations take place. All disks are managed by a single
controller. For example,
control.bat SimpleController 3 4 5 50 w:0:1 w:30:2 r:0 r:30 d:0:2 r:0 d:1 r:30
simulates disk behaviour for a system with 3 initially identical
disks, where each disk has 4 blocks and each block stores 5 bytes. The
specified simple controller SimpleController
can store a
total of 3*4*5=60 bytes, as this is the total capacity of all
disks combined. But we are requesting an actual capacity of
50 bytes. This controller does nothing with the remaining 10 bytes,
but other controllers can use them as spares or for improved
reliability. Of course, if the requested actual capacity is
incompatible with the controller's management policy (e.g. if we ask
this simple controller for 70 bytes), the controller reports an error
during disk formatting.
In addition to the disk and controller configurations, the above
command-line specifies a series of disk operations:
- We first write the value 1 at byte offset 0; the byte offset is a
number between 0 and 49 since we requested 50 bytes of actual
capacity. Also, the byte value should be specified as an integer
between -128 and 127.
- We then write the value 2 at byte offset 30, followed by two read
operations as offsets 0 and 30.
- We then forcibly damage block 2 of disk 0, thereby rendering it
inaccessible; the block index is a number between 0 and 3 since each
disk has 4 blocks, and similarly the disk index is between 0 and 2
since we have 3 disks. This operation is not done via the disk
controller; instead, we are corrupting the (simulated) disk without
the controller's knowledge. This is a realistic scenario: the
controller only discovers the damage when it tries to access the disk.
- After another read at offset 0, which works fine, we wholly
damage disk 1, as if its power supply had just burnt out: no block of
the disk is any longer accessible. As a result, our subsequent attempt
to read at offset 30, which is stored on disk 1, fails.
For the above input, here is the output we get (after making sure the
simulator is first compiled via make.bat
):
Controller: csci4534.controller.SimpleController
w@0=1
w@30=2
r@0=1
r@30=2
Damaging disk D0, block 2: done
r@0=1
Damaging disk D1: done
r@30=csci4534.controller.BadDiskException: Disk D1 is damaged
D0:[(1,0,0,0,0);(0,0,0,0,0);bad;(0,0,0,0,0)]
D1:bad
D2:[(0,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0)]
You are given the implementation of this simple controller in
csci4534.controller.SimpleController
and its helper
csci4534.controller.SimpleBytePosition
; in general, you
can substitute SimpleController
on the command-line with
any other implementation of the
csci4534.controller.Controller
interface. Study this
interface and those classes, along with the rest of the provided code,
and pay particular attention to the following:
- Read very carefully the fine details in the class comments of the
provided class stubs (the provided partial classes you have to
fully implement).
- Study
csci4534.controller.SpareController
, which is
more complex than SimpleController
. Its helper
csci4534.controller.StripedBytePosition
is something you
have to implement, so the spare controller is not fully functional
even though the majority of its implementation is provided to you.
- Observe that the class hierarchy for the completed simulator is
already provided. The separation of controllers into
csci4534.controller.ControllerBase
subclasses and helpers
into csci4534.controller.BytePosition
subclasses should
help you save time figuring out how to factor out common algorithms.
- Some helper methods are also stubbed out to ease your code design
and hint at the commonalities across controllers. Feel free to ignore
them if they confuse you more than they help you.
- For most classes, it might be convenient to read first the HTML
documentation produced from the code's javadoc comments (by running
jdoc.bat
). The HTML documentation doesn't cover
everything (e.g. it doesn't cover in-line comments or private
methods), but it's more readable, esp. for sections containing math
equations.
After you have finished studying the provided code, carry out the
following tasks:
[5 points] Implement
StripedBytePosition
.
Test your implementation via the provided
SpareController
. Note that this controller remaps disk
blocks to replace inaccessible ones with spares. So, for example, the
disk operation d:0:0
may damage two different physical
blocks at different points in time. And if you run
control.bat SpareController 3 4 5 30 d:0:0 w:0:1 d:0:0 w:0:1 w:0:1
you will get the output
Controller: csci4534.controller.SpareController
Damaging disk D0, block 0: done
w@0=csci4534.controller.BadBlockException: Disk D0, block 0 is damaged
Damaging disk D0, block 0: done
w@0=csci4534.controller.BadBlockException: Disk D0, block 0 is damaged
w@0=1
D0:[(1,0,0,0,0);(0,0,0,0,0);bad;bad]
D1:[(0,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0)]
D2:[(0,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0)]
[5 points] Implement
csci4534.controller.RAID0Controller
. You do not need a
special helper csci4534.controller.RAID0BytePosition
for
this controller: use one of the other helpers. As an example of this
controller's operation, the command-line:
control.bat RAID0Controller 3 4 5 30 w:0:1 w:1:2 w:5:3
should produce the following output:
Controller: csci4534.controller.RAID0Controller
w@0=1
w@1=2
w@5=3
D0:[(1,2,0,0,0);(0,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0)]
D1:[(3,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0)]
D2:[(0,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0)]
[20 points] Implement
csci4534.controller.ParityController
and
csci4534.controller.ParityBytePosition
. Pay particular
attention to the efficiency of parity computations. In our simulator,
all computations are done in memory, but a real disk controller has to
operate on data stored on disk. Because disks have much longer access
times than memory, reads/writes to the simulated disks should be
minimized to provide a more realistic simulation.
[4 points] Implement
csci4534.controller.RAID4Controller
and
csci4534.controller.RAID4BytePosition
. As an example of
this controller's operation, the command-line:
control.bat RAID4Controller 3 4 5 40 w:0:1 w:1:2 w:5:3 w:10:4 w:15:5 w:16:6
should produce the following output:
Controller: csci4534.controller.RAID4Controller
w@0=1
w@1=2
w@5=3
w@10=4
w@15=5
w@16=6
D0:[(1,2,0,0,0);(4,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0)]
D1:[(3,0,0,0,0);(5,6,0,0,0);(0,0,0,0,0);(0,0,0,0,0)]
D2:[(2,2,0,0,0);(1,6,0,0,0);(0,0,0,0,0);(0,0,0,0,0)]
[4 points] Implement
csci4534.controller.RAID5Controller
and
csci4534.controller.RAID5BytePosition
. As an example of
this controller's operation, the command-line:
control.bat RAID5Controller 3 4 5 40 w:0:1 w:1:2 w:5:3 w:10:4 w:15:5 w:16:6
should produce the following output:
Controller: csci4534.controller.RAID5Controller
w@0=1
w@1=2
w@5=3
w@10=4
w@15=5
w@16=6
D0:[(2,2,0,0,0);(4,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0)]
D1:[(1,2,0,0,0);(1,6,0,0,0);(0,0,0,0,0);(0,0,0,0,0)]
D2:[(3,0,0,0,0);(5,6,0,0,0);(0,0,0,0,0);(0,0,0,0,0)]
[10 points] Implement
csci4534.controller.RAID1Controller
and
csci4534.controller.RAID1BytePosition
but
without spare disks. You are still required to implement disk
mirroring since this is a key property of RAID 1.
[10 points] Add support for spare disks to
csci4534.controller.RAID1Controller
. Note that this
controller remaps spare disks to replace damaged ones with spares. So,
for example, the disk operation d:0
may damage two
different disks at different points in time. And if you run
control.bat RAID1Controller 6 4 5 40 w:0:1 d:0 w:0:1 d:0 r:0
you will get the output
Controller: csci4534.controller.RAID1Controller
w@0=1
Damaging disk D0: done
w@0=1
Damaging disk D4: done
r@0=1
D5:[(1,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0)]
D1:[(0,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0)]
D2:[(1,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0)]
D3:[(0,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0);(0,0,0,0,0)]
D0:bad
D4:bad
Make sure all your code is well documented in the same simple,
succinct style that the provided code is documented. As the syllabus
states, points will be deducted for poorly commented code you write
for this or any other programming task in this course.
[1 point] How much time did you spend on this
section?
[1 point] Summarize in a concise list the key
concepts and/or technologies that this assignment helped you
digest. You don't have to explain the listed items; just name them.
© 2004 Apostolos Lerios