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: 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: Sounds tough? It is indeed. But it's also realistic. Consider the following not-at-all-hypothetical scenario:

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:

  1. 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.

  2. We then write the value 2 at byte offset 30, followed by two read operations as offsets 0 and 30.

  3. 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.

  4. 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: 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