XML

kent logo

CO527 Anonymous Questions and Answers

This page lists the various questions and answers. To submit a question, use the anonymous questions page. You may find the keyword index and/or top-level index useful for locating past questions and answers.

We have taken the liberty of making some minor typographical corrections to some of the questions as originally put. Although most of the questions here will have been submitted anonymously, this page also serves to answer some questions of general interest to those on the course.


Question 41:

Submission reference: IN806

Ok here is my solution:

  [snip code]

Any suggestions for improvement?

Answer 41:

Please don't use the anonymous questions for this! I'll look at whole solutions when I come to mark them.

Keywords: coursework


Question 42:

Submission reference: IN808

I just received this e-mail from 'The UKC CS Submission Control System ' at around 11:05 AM:

-----

"The following assessment has been closed:

    Module: co527
    Assessment: assess2

No files appear to have been submitted for this assessment.
If this is incorrect, please contact the member of staff responsible for
this assessment."

-----

On the assessment page it clearly states that the deadline is 11PM (23:00 ?):

  The deadline for submission is 11pm on Tuesday 6th February.

Could you please clarify this? Thanks.

Answer 42:

That was our fault, apologies for that. I sent out an email to all saying to ignore that automated email. The deadline is indeed 11pm (23:00) - tonight!. The submission directories have been re-opened and will be properly closed after 11pm.

Keywords: coursework


Question 43:

Submission reference: IN810

Hi Fred. I have completed the courseowork, but have a couple of questions regarding the correct behaviour of the program. Currently I have the program return -1 if the magic value is not deadbeef, and if it is then the first part of the assessment (the printing) is executed and 0 is returned. Is this the correct behaviour?

Also, the inode lengths all appear to be one. Should the "Inode tables at:" part of the print out just be (2-1) (3-1) (4-1)... etc, or should I use the length to calculate the end of the inode table, so that the output is (2-2) (3-3) (4-4)... etc as it is on the description page? Thanks.

Answer 43:

For your first question, yes, if the magic value is not as expected the method should return -1 (and maybe print a helpful error message - optional). If the magic value is as expected, then yes, normal printing of the superblock contents (as per the sample output) and return 0.

For your second question, the lengths are indeed all 1 (that's just by chance on the 1 MB test image), but the program should print them out as (start - end), rather than (start - length). So you should get the same output as the sample output. See also the answers to Question 27 (2006) and Question 8 (2006).

Keywords: coursework


Question 44:

Submission reference: IN811

the link to the assess3-code-20070206.zip file on the new assesment page does not work and the zip file is not in the directory on raptor either...

Answer 44:

I thought I made that fairly clear on the assessment page -- and definitely mentioned it in the lecture today (hint: attend lectures). The assessment 3 code template contains the solution to assessment 2, so I'm not going to release it until after the deadline (or for anyone with an extension, after that). At the latest, end of Wednesday..


Question 45:

Submission reference: IN813

Hey, I thought I'd try my assessment on the disk images you spoke about today but from raptor I got;

  raptor$ java Harness /courses/co527/disks/large.dsk
  Exception in thread "main" java.lang.RuntimeException: VDDev::VDDev():
  failed to open [/courses/co527/disks/large.dsk] for read/write:
  /courses/co527/disks/large.dsk (Permission denied)
    at VDDev.(VDDev.java:207)
    at Harness.main(Harness.java:38)

could you change the permissions on the files?

Answer 45:

.. and make them writable by the world? (nope!). The problem is that the VDDev class is trying to open the file read/write (with the intention of maybe writing to it sometime). It should be safe to open the file read-only, although I've not tried this. To do that, find the line in 'VDDev.java' which reads:

  randfile = new RandomAccessFile (file, "rw");

and change it to:

  randfile = new RandomAccessFile (file, "r");

Alternatively, copy the image to "/tmp/abc12-large.dsk" or your home-dir on raptor (quota permitting) and use it from there read/write.

Keywords: coursework

Referrers: Question 70 (2006)


Question 46:

Submission reference: IN814

is this the right output for the large disk image?

  [snip output]

Answer 46:

Not quite; sample outputs for those images are given on the assessment 3 description page.

Keywords: coursework


Question 47:

Submission reference: IN816

Ok here is my solution:

  public int initFS (DiskScheduler dsched)
    {
      // Read the superblock into a byte array
      byte[] superblock 

Answer 47:

You probably need a bit more code than that ;-).

Keywords: coursework


Question 48:

Regarding the 'large.dsk' image, how can you store data about 25600 blocks in one block of bitmap? The max amount of data that 1 block of bitmap can store is for 16384 blocks, so is the data for the remainder of blocks stored in an additional two blocks of bitmap somwhere? But if that's so then why on the sample printout on the webpage says that the bitmap offset is at block 1 (only)? Shed some light please.

Answer 48:

This disk image has two block bitmaps, starting at block 1. That is, it occupies blocks 1 and 2. The block bitmaps will occupy as many consecutive blocks as they need.

Keywords: coursework

Referrers: Question 56 (2006) , Question 57 (2006)


Question 49:

Submission reference: IN818

Hi, I am a bit confused with with how to begin the second programming assignment. I know how to report the status of a block, but I am unsure as how I can get this data. There doesn't seem to be an array of any kind, which could be queried. I would appreciate any pointers you could give. Thanks.

Answer 49:

This information (regarding block usage) is stored in the block-bitmap. Essentially it's just one large array of bit-pairs. The assessment description gives some information; the header file sfstypes.h contains the technical details.

Keywords: coursework

Referrers: Question 54 (2006)


Question 50:

Submission reference: IN819

Could you please update the module page with a link to the assessment? Cheers.

Answer 50:

Yep, done.

Keywords: coursework


Question 51:

Submission reference: IN820

Should we start the third assessment with your SmallFS.java, or should we use our own if we're confident it works?

Answer 51:

You can use your own if you like, but I'll only be considering the contents of the "fsBlockSummary()" method, mostly.. (the modified "SmallFS.java" contains various class attributes which "initFS()" sets, and which "fsBlockSummary" can use).

Keywords: coursework


Question 52:

Submission reference: IN821

I am about to make a start on the 3rd assessment. I would just like some clarification that I am approaching it in the correct way. You say the results should be retrieved from querying the block bitmap. Am I therefore correct in thinking that querying the block bitmap can be done using something such as:

   BM.read_uint8 (sblk, 1);

?

Answer 52:

The code you have there reads a byte out of the superblock (which in this case, should be the second magic byte, 0xad). Reading the block bitmap will require reading the disk block which contains it (which is indicated by the superblock field 'bitmap_offset').

Keywords: coursework

Referrers: Question 54 (2006) , Question 57 (2006)


Question 53:

Submission reference: IN822

When we query the block bitmap, should we get a result in the form of '00' or '01' indicating its status ?

Answer 53:

Pretty much, yes. The 4 values (00,01,10,11) are specified in binary (not decimal or hexadecimal). For instance, if you had the byte value 0xCE, that could be written in binary as 11001101 (most significant bit first). Therefore, two blocks have status 11, one has 00 and another has 01.

Keywords: coursework


Question 54:

Submission reference: IN823

Hi, I've just read through the details for Assessment 3 and I'd like some clarification on the following:

1. When the output mentions "Sample output at: 1", does the 1 mean the first block on the DiskScheduler, or that it is located in the superblock at the offset 1?

2. How do you determine whether a block is used, unused, reserved or invalid?

Thanks :)

Answer 54:

For your first question, not quite -- that would be one of the magic bytes (as you should know from assessment 2!). See also Question 52 (2006).

For your second question, see Question 49 (2006).

Keywords: coursework


Question 55:

Submission reference: IN824

I'm currently doing comparisons between data read out the expected values using "[snip code]", I have things to deal with 0x00 through to 0x03 and an "else" clause to catch anything that doesn't match these. Well, annoyingly quite a few of the bits seem to be broken. I added in some debugging info and found the sequence "85, 21, 5" kept appearing where it falls over...any clues as to why this might be would be much appreciated!

Answer 55:

The values you're seeing would be impossible if you're calling BM.read_ubits() correctly. So double-check that you're calling it correctly!

Keywords: coursework


Question 56:

Submission reference: IN832

I can get my code to work on the images that have only one bitmap block, but when I use it on the 100MB file, I get:

Block Summary	    : 11112 unused, 803 reserved, 1 used, 0 invalid

which is partly correct. I'm assuming that to goto the next bitmap location, you just do the current bitmap location + 1. Can you give me any pointers where I'm going wrong? Here's my code:

  [snip code]

Answer 56:

You're correct in assuming that block bitmap continues in consecutive blocks (see Question 48 (2006)). As for why your code doesn't work correctly, I am not a debugger :-). I'd suggest putting in some debugging print statements so you can see what the values of various things are. Also, there's some of that nasty duplicated code stuff in your solution -- try and do it without duplicating chunks of code. My model solution has about 20 actual lines of code, so it is possible to do this relatively cleanly (though I'd expect more than this in student submissions, doing it very neatly involves some thinking).

Keywords: coursework

Referrers: Question 80 (2006)


Question 57:

Submission reference: IN830

I'm possibly being stupid, but where is this block-bitmap? I don't know where it is to be read from :(

Answer 57:

See the answers to Question 52 (2006) and Question 48 (2006)

Keywords: coursework


Question 58:

Submission reference: IN831

If the 100MB image has two blocks of bitmap data, when the initFS method prints out the block bitmap location, why does it just say 1? Shouldnt it say something like '1, 2' because there are 2 block bitmaps?

Answer 58:

Not really; the superblock field refers to "bitmap-offset", i.e. the block at which it starts. The length can always be calculated from the total number of blocks. Maybe the initFS() method should print this information just to be informative, but doing so would indirectly give you a bit of the solution to the 3rd assessment ;-).

Keywords: coursework


Question 59:

Submission reference: IN835

Assuming I am reading the right bit of the block, is this code how I should be checking the blocks?:

  [snip code]

because I don't seem to get the results you shown in the description, where ever I read from.

Answer 59:

That code looks sort of right -- things to check would be that you're actually reading distinct bit-pairs from the bitmap (not overlapping or with gaps). Putting in some debugging print statements to see what you're actually feeding to BM.read_ubits() might be helpful.

Keywords: coursework


Question 60:

Submission reference: IN836

I'm obviously being really stupid here, however: You say the bitmap offset is given in the work for assessment 2 (I presume the bit where we are told "Block bitmap at: 1"). This implies to me, that the offset we start with is '1', and that is also indicated by some of your questions, however you also say this is part of the 'magic' part of the superblock, which also makes sense.

The main part of my code is:

  [snip code]

any help would be great as I'm at a complete dead end at the moment

Answer 60:

You code is reading bits out of the superblock, which is wrong -- it should be reading bits out of the block bitmap. The superblock indicates where the block bitmap is, i.e. starting at block 1 on the disk. You'll probably need to read this data from the disk..

Keywords: coursework

Valid CSS!

Valid XHTML 1.0!

Maintained by Fred Barnes, last modified Thu May 8 12:58:00 2014