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.
Submission reference: IN5120
For question 4 about the date of creation for VIMRC, i'm having trouble understanding Bob's explanation of how to interpret the date. I'm not quite sure how the one value at 0x18/0x19 can be converted or read to retrieve a date.
You need to write down all 16 bits. The most significant 7 bits indicate the year, the next 4 bits indicate the month, and the least significant 5 bits indicate the day.
Keywords: assess5-1516
Submission reference: IN5119
I'm on question 8 and following the tutorial and I keep getting sent to an empty block. Could you please tell me where I am going wrong. [... description of an attempt to solve question 8 ...]
You hit the one relevant difference between FAT16 and FAT12.
Given cluster x, FAT[x] gives the number of the cluster coming after x. So, if a file starts at cluster x, then its clusters are x, FAT[x], FAT[FAT[x]], ..., and so on until a special value indicating the end is hit (-1 in two's complement).
For the above paragraph to make sense, you need to see FAT as an array. For that, you need to know where it starts (which you did), and you need to know how big are its elements (how many bits they occupy). For FAT16, an element takes two bytes (which is why you start with multiplying x by 2); For FAT12, it takes 12 bits, so you don't multiply x by 2. Instead search for "Since 12 bits is not an integral number of bytes" on this page, and use that description.
(In your description, there's also a minor misunderstanding of why Bob divides 2x by the size of a block: the point is to figure out in which block to look and where, so you care about quotient and reminder, not about a real value.)
Keywords: assess5-1516
Referrers: Question 76 (2015) , Question 83 (2015) , Question 83 (2015) , Question 83 (2015)
Submission reference: IN5117
Am I right in thinking that we should be following "The Starting Cluster Number" section on the preliminaries to find the number contained in the file 'SECRET'? Thank you
Yes. See also section 'Example 4 - find the data blocks for a file' of the tutorial.
Keywords: assess5-1516
Submission reference: IN5115
I have followed the tutorial to do question 3 but it does not seem right. [Removed an attempt at solving question 3. It includes something like 0x09 * 2 == 0x18, which is incorrect.]
Your arithmetic is incorrect. You may want to convert all numbers to decimal before doing any additions/multiplications, to avoid mistakes.
For example, instead of (0x09 * 2 == 0x12), you may want to work with (9 * 2 == 18), which is a form you may be more familiar with.
Keywords: assess5-1516
Referrers: Question 78 (2015) , Question 80 (2015)
Submission reference: IN5114
Is XXXX blocks the right answer for question 1 or have I gone in the wrong direction about the whole thing?
At this point, I can't comment on what the right answer is.
Keywords: assess5-1516
Submission reference: IN5113
In the brief explanations do I need to talk about some of the calculations I have used or is that going too much in to detail?
It is up to you to decide what is important and what is not important in how you found an answer. A calculation may or may not be important.
Keywords: assess5-1516
Submission reference: IN5112
Could you please tell me if my methodology is right for converting from FAT16 to FAT12 If the 16 bit number is 0x0013 (19 in decimal) divide it by 1.5 to make it the 12 bit number 0x000d (12.66 and then round it up to 13 in decimal) and then go to that block to find the correct directory. Thank you
Would you just follow the tutorial? You don't need to convert any numbers. (But see Question 68 (2015).)
FAT is a file system format, not a number format. So, "to convert a number from FAT16 to FAT12 you divide by 1.5" is not right or wrong: it is an ill-formed sentence.
Keywords: assess5-1516
Submission reference: IN5111
So in Bob Eager's tutorial he uses FAT16 where as we are using FAT12. When working out the root directory or working out how many blocks are there, it does not make a difference so I am not sure at what point does it make a difference whether it is a FAT16 OR FAT12
A FAT entry takes 12 bits on FAT 12, not 16 bits. So, when you read in the tutorial that a FAT entry takes 16 bits (two bytes), replace that by 12 bits.
Keywords: assess5-1516
Referrers: Question 69 (2015)
Submission reference: IN5110
How detailed should our brief descriptions for assessment 5 be?
Quite brief.
Keywords: assess5-1516
Submission reference: IN5109
For assessment 5 are meant to just extract the file dump and view it in notepad? It looks like a mess, just want to make sure i'm viewing it properly.
The file dump.txt should contain a hex dump that looks like the examples in Bob's tutorial: example.
You may want to use a better text editor than Notepad, though.
Keywords: assess5-1516
Submission reference: IN5089
What would be an reasonable number of columns and rows for out animated philosophers assessment to make use of? Thanks.
Wrong module, but see the existing Q+A for CO545 (80x25).
Submission reference: IN5066
I just had a quick question about the file system assignment, I know that the tavi webpage provided goes through FAT16 file system, I was wondering are we meant to go by the tables that are provided in the tavi for the FAT16 or look at the documentation for FAT12 as they have different lookup values for certain aspects e.g. the FAT16 for date create is located at 0x18 but in the FAT12 documentation it is located at 0x10
The file system in dump.txt is FAT12, as mentioned in the assignment and as you can see in Block 0. Hence, you should of course use the format specs for FAT12 to interpret its content.
That said, the only difference in the formats FAT12 and FAT16 that you care about is the one mentioned in the assignment: FAT entries take 12 bits in FAT12, and 16 bits in FAT16.
In particular, the date is at indices 0x18 and 0x19 in both FAT12 and FAT16. Either the documentation you use for FAT12 is rubbish, or you are not reading it properly. Here's another place were all FAT versions are documented: The FAT filesystem.
Keywords: assess5-1516
Submission reference: IN5063
When will the file systems assignment be released?
It is released now. See Moodle.
Keywords: assess5-1516
Submission reference: IN5062
It seems if I run the online tests for one version of the code, I get the following results: (better score but cannot run requests-big.txt)
Test 1: okay: ... (a bit better than SSTF, within 2 percent) Test 2: okay: ... (better than SSTF, by more than 2 percent) Test 3: okay: ... (a bit better than SSTF, within 2 percent) Test 4: failed at run-time Test 5: failed at run-time
For a different version (worse score on requests.txt but can run requests-big.txt):
Test 1: okay: ... (worse than SSTF, by more than 2 percent, same or better than FIFO) Test 2: okay: ... (worse than SSTF, by more than 2 percent, same or better than FIFO) Test 3: okay: ... (worse than SSTF, by more than 2 percent, same or better than FIFO) Test 4: okay: ... (worse than SSTF, by more than 2 percent, same or better than FIFO) Test 5: failed at run-time
Which one would you advise sticking with? If either?
Probably the one you think is most correct. In terms of failed tests and other results, they're probably both somewhere between 30% and 50%, so likely I'll be looking at the code to see where the problem lies.
Keywords: assess4-1516
Submission reference: IN5061
In regards to Question 60 (2015), I had made those changes after I sent the question and it made no difference. I've been stuck on this for 3 hours and I don't know what to do.
java.lang.NullPointerException at DiskSim.disk_readblock(DiskSim.java:821) at DSched.readcomplete(DSched.java:118)
I reintroduced the readqueue_size and added readqueue_num which acts like the header. I have no tails. Does this clear any of this up?
It'll still be the same kind of problem. It's at this point that you need to start debugging your code: add print statements so you can see what's going into the request-queue and what's being dispatched to the disk, and also what's being looked at during the search. Some aspect of this will (should) point you in the right direction to where the problem lies (it's obviously not in the backtrace from the null-pointer exception).
Keywords: assess4-1516
Submission reference: IN5060
[snip code] for (int i=0; i<readqueue.length; i++) { ... stuff }
I'm trying to find the lowest block that I will use in my c-scan and for some reason this gives me a -1 and I don't think this is correct. Also I get:
java.lang.NullPointerException at DiskSim.disk_readblock(DiskSim.java:821) at DSched.readcomplete(DSched.java:116) ...
I saw your earlier answer (Question 51 (2015)) about it but could there be any other cause as I have inspected my work thoroughly and nothing seems out of bounds. I even tried the -1 on a lot of things just for testing sakes and it didn't make a difference.
The main problem is that you're searching through invalid requests. The length of the request-queue is fixed: at MAXREQUESTS. How many actual valid requests there are varies; specifically it's the readqueue_size variable that was in the original code. So although the array index is not out-of-bounds, it is looking at invalid requests.
Keywords: assess4-1516
Referrers: Question 61 (2015)
Submission reference: IN5059
I've only managed to pass the first two tests with a bubble-sort and C-scan attempt. I couldn't manage the SSTF and the bubble sort is, according to the test-rig, faster than my c-scan.
Bubble sort:
Test 1: okay: ... (a bit better than SSTF, within 2 percent) Test 2: okay: ... (worse than SSTF, by more than 2 percent, same or better than FIFO) Test 3: failed at run-time Test 4: failed at run-time Test 5: failed at run-time
C-scan:
Test 1: okay: ... (worse than SSTF, by more than 2 percent, same or better than FIFO) Test 2: okay: ... (worse than SSTF, by more than 2 percent, same or better than FIFO) Test 3: failed with logic errors Test 4: failed with logic errors Test 5: failed with logic errors
Which should I submit if I can't improve the c-scan before the deadline? And does the reason for test failure matter?
The bubble sort is not a typical disk-scheduling algorithm in my experience. It might form part of one, but as other answers here suggest, sorting is not actually necessary: it might simplify some aspects, but at the cost of just moving complexities elsewhere. Real (actual OS) implementations might actually want to use proper sorting algorithms; because the simulator framework doesn't measure wall-clock time, run-time efficiency isn't a big issue. I'd suggest submitting the C-scan version, on the grounds that I know what that should probably be doing.
The fact three of the five tests fail is a big problem: it means there's something wrong with your code, both versions of it. The first lot are probably caused by the program throwing exceptions (test it on your own machine first, probably with the larger request file). The second lot are problems involving incorrect blocks being returned to the high-level (typically). Again, test locally.
Keywords: assess4-1516
Submission reference: IN5058
In reference to Question 52 (2015), I looked at the question you'd linked, my algorithm performs much better than the last version. Is it even worth using it and referencing the code? I understand how it works and how it affects the original algorithm but I'd rather not use it if I'd get into trouble for it.
I don't think the code nor the understanding of how to iterate around a circular queue, nor how such a thing works, can be claimed really. It's elementary algorithm stuff (or at least it should be), but it would always be sensible to reference where you got the idea/background from if in doubt (no-one has gotten into trouble for actually referencing properly as far as I'm aware!). But for the purposes of this assessment, the objective is to perform well in a disk-scheduling simulation — how you go about it I'm less bothered about (unless I have to look at the code).
Keywords: referencing , assess4-1516
Submission reference: IN5057
How do I get a block's track number?
As explained in the comments in the file (!) you call DiskSim.block_to_track (..)". Read and understand the code, don't just hack away at it blindly!
Keywords: assess4-1516
Submission reference: IN5056
Hi there, I've been trying to implement C-scan but I can't seem to get any improvements on the score compared to SSTF and FIFO.
[snip code]
This is not the right place to ask these questions: I am not a debugger :-).
Glancing at the code, the scan() method looks broken, in the sense that it's not doing the right thing. Another issue is where/how you use currentTrack.
Keywords: assess4-1516
Maintained by Fred Barnes, last modified Wed May 25 15:07:19 2016 |