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: IN994
How does the SmallFS class handle inodes which span multiple blocks when returned by the getInodeLocation method? I am unsure as to what needs to be returned in this situation (I am having problems with the bigger disk image). I have read Question 121 (2006), but so far am unable to figure out what to do to solve the problem
Individual inodes do not span multiple blocks, whole inode tables may do. But wherever a particular inode lives, getInodeLocation() should return the same same: the block number where it can be found, and a byte offset within that block. This problem isn't entirely unrelated the previous assessment, where the block bitmap itself could span multiple blocks (but an individual block-status bit-pair never would). The rest of the code for SmallFS is there, so you can just read it to see what it does with the data returned from your getInodeLocation method.
Keywords: coursework
Referrers: Question 145 (2006) , Question 147 (2006)
Submission reference: IN1005
Hi, the link to lecture 7's mp3 recording is broke :(
Fixed now — file was there, but had dopey file permissions (presumably from the MP3 recorder and its FAT based file-system).
Keywords: lectures
Submission reference: IN1001
Is there a maximum number of bytes in an inode table?
In theory, yes. Because the inode number encoding can't cope with an offset bigger than (224 - 1), and as each inode is 64 bytes, the maximum size of a single inode table would be approximately 1 gig (or 224 * 26 = 230). In practice they're unlikely to be this big (unless we had really huge terabyte/petabyte file-systems, but then the 32-bit numbers used for file-sizes and block numbers become a problem — max. 16 terabytes for a file-system, and 4 gigabytes for a single file or directory).
In relation to the assessment, the question you probably wanted to ask is, "how many bytes is in a single inode table?". In which case the answer is given in the superblock data.
Keywords: coursework
Referrers: Question 148 (2006) , Question 151 (2006)
Submission reference: IN1000
From Question 140 (2006), the problem was purely the disk image, rather than an issue with Java 1.6 (which I don't have anyway :))
Ah, yes, in which case 128 bytes for the root directory is the correct size (because it has less entries in it than the disk image with extra files on it).
Keywords: coursework
Submission reference: IN999
I'm multiplying the result I'm getting for the offset by 64 like this: [snip code]; as mentioned in Question 134 (2006) and Question 128 (2006). I get the correct output for the test.dsk file, but the bigger and bad files give me ArrayIndexOutOfBoundsExceptions. Could you point me in the right direction please?
You should be able to work this one out for yourself — the JVM will tell you exactly where the error occured, and its path back through the code in SmallFS. I'd imagine it's blowing up inside readInode(), which is where your getInodeLocation() method is called from.
Failing that, see Question 141 (2006) and Question 121 (2006).
Keywords: coursework
Referrers: Question 147 (2006) , Question 153 (2006)
Submission reference: IN1009
Hi, been through the last lecture and as you know, not much was covered in it? Are we going to have to know the parts that weren't mentioned (such as how deadlock is predicted and avoided), or would it just be useful in expanding our ever growing knowledge of operating system functionality? :)
Anything which was covered in a lecture is examinable; anything extra in the notes is for the enthusiastic and curious (which all CS students, and maybe related degrees, should be!). The last lecture got squeezed out a bit because I wanted to concentrate on paging a little more.
Keywords: lectures
Submission reference: IN1013
I've been working on assessment four for a while now and have a semi-working solution. It prints the correct output for test.dsk, but for bigger.dsk it only prints out a select few items, not all of them. This is my code:
[snip code]
outputs:
0x1000000 1856 0 0 . 0x1000000 1856 0 0 .. SmallFS::fsDumpRoot(): failed to read directory entry inode 2 of 29 SmallFS::fsDumpRoot(): failed to read directory entry inode 3 of 29 ... 0x100002c 239274 1000 1000 sched.cI suspect this has something to do with how I'm getting the block number from the superblock, but I'm not too sure. If you could give me any pointers as to where I'm going wrong I'd be most grateful. Thanks.
Something went wrong when you pasted in your code, all the newlines were turned into question-marks; but it's best to try and avoid just pasting in code and asking "what's wrong" — sample output is acceptable however. This is essentially the same problem as some other questions, see Question 141 (2006) and Question 145 (2006).
Keywords: coursework
Submission reference: IN1015
I'm trying to get:
SmallFS::fsDumpRoot(): failed to read directory entry inode 5 of 8
to match up with your sample output for badtest.dsk but at the moment I'm getting:
0xf000040 46 0 0 gen11.c
for that line. Do I need to test for something and return NULL if the test fails? If so, can you point me in the right direction of what I need to test, thanks.
The specification says it should return null if the inode number is invalid. In this case, the inode number 0x0f000040 on badtest.dsk is invalid — it refers to an inode which doesn't exist. See also Question 143 (2006).
Keywords: coursework
Referrers: Question 151 (2006)
Submission reference: IN986
What's going on with this architecture quiz? Is it out yet?
Not quite yet, but we're working on it! The quiz will be available via WebCT.
Submission reference: IN1020
Hi Fred, I'm totally lost on this cw. I see that 0x01000000 is the root inode number in hexadecimal. And I understand what it means about the table number and offset. The code:
String rootInode = BM.tohexbuf (sblk, 28 + (SFS_NTABLES * 8), 16);
produces:
00000001000000000000000000000000
But to get the number into the 0xttoooooo format do we have to do this ourselves or is there somewhere to get this value from?
The value you are printing in hexadecimal there is the root inode, but not in a way that would be helpful. But you don't need to go searching through the superblock for this — it's passed as a parameter to the getInodeLocation() method! And is already in the required format.
The inode number is only 4 bytes long (32-bit integer), so if you printed that out with BM.tohexbuf() you'd get the string "00000001". Yes, this is actually the number 0x01000000; 16 and 32-bit integer values are stored in little endian format, which the various BM.read_uint32() etc. methods cope with. The BM.tohexbuf() method just prints the bytes raw, without consideration for alignment or endianism.
Keywords: coursework
Submission reference: IN1028
I have completed most of the assessment apart from in badtest.dsk I get
0xf000040 46 0 0 gen11.c
instead of
SmallFS::fsDumpRoot(): failed to read directory entry inode 5 of 8
I have read the anonymous question page with the reference to Question 143 (2006) but I'm not sussing it - some help please - I'm guesing that I'm going wrong in the way I'm checking for valid inode from the parameter - at the moment is just if(inode >= SFS_NTABLES) {return null]}, after shifting inode right of course - So what am I missing here??
Also related to Question 148 (2006). The problem is that the check is insufficient, and what you have already looks incorrect. The starts and lengths of the inode tables are given in the superblock. In this particular case, the inode at offset 0x40 in table 15 (0xf) is invalid, because there's only one block for this table, and inode 0x40 is not within it (valid inode offsets for that table would be 0 through 63 inclusive).
Keywords: coursework
Submission reference: IN1025
Hi, I know this is totally last minute but I've been working on this for a while and I'm stumped, it's not because of not understanding how to decode the inode number but in what to return, my code decodes the number and finds that the root inode is in table 1 at offset 0 since table 1 is at block 2, it returns an array {2,0} however this seems to be the wrong thing to return, because I get an error, can you tell me what the first array (for the root node) for test.dsk should return so I can see where I'm going wrong?
Those values {2,0} are correct for the root inode on test.dsk, so something else must be wrong! See what error is displayed, find it in the code, and work backwards from there.
Keywords: coursework
Submission reference: IN1030
Hi, I have managed to get the right output for the test.dsk, but when I run the badtest.dsk I get the an error on the BM class's read_uint32() method and says ArrayIndexBoundofException...Can you please tell me what might be wrong? thanks..
See Question 145 (2006). Chances are it's because your method is returning a byte offset outside the range of a single block of data.
Keywords: coursework
Submission reference: IN1033
Once you've decoded the inode number and retrieved the inode table offset, how do you get the block number and offset? Because it is unclear in your assignment description.
Well, yes — you have to figure that part out for yourself. However, there's a whole plethora of relevant information on these anonymous Q+A pages :-).
Keywords: coursework
Submission reference: IN1035
The assessment pages don't validate! It is outrageous...
They do now, there were only a few errors :-).
Submission reference: IN1044
Are we going to be examined on Unix?
You may be examined on anything presented in the lectures — and this may not be exactly what is in the notes (some bits may have been skipped, or extra nuggets added). [hence the value of attending lectures and taking notes! — note-taking is an effective learning tool, going to sleep or otherwise 'switching off' is not]
I can say for certain that I won't ask questions along the lines of "Give an example of a Unix command to delete all the compiled Java class files from your home-directory". However, Unix is an operating-system, and half of the module is about operating-systems, with a number of examples drawn from it. The sort of question you might encounter, e.g. "Briefly describe the structure and operation of a device-driver", would clearly benefit from knowing something about device-drivers, and if you know about or have experience with device-drivers in Unix (or any other operating-system), that would clearly be beneficial.
Keywords: exams
Submission reference: IN1049
What is part4.txt? I only see 3 sections...
Yes, sorry about that, removed now. There were originally 4 parts to this, but I've thinned it down to just 3.
Keywords: coursework
Submission reference: IN1050
Hi, just going through the assessment, how do you get the maximum number of cylinders? Am I right in saying it's done like this: [snip code].
Yes. For the benefit of everyone else, look at the documentation for the DiskDevice class.
Keywords: coursework
Referrers: Question 167 (2006)
Submission reference: IN1053
For the scan algorithm, you have said that the output should be:
Average block service time: 1627.0 (stddev 234.2 , min 1130.0, max 1982.0) Minimum block service time: 100.0 (average 378.5 , stddev 300.4 ) Maximum block service time: 4010.0 (average 3091.9, stddev 679.5 )
But when I run it I get:
Average block service time: 1644.2 (stddev 206.1 , min 1164.6, max 1967.0) Minimum block service time: 100.0 (average 393.3 , stddev 339.5 ) Maximum block service time: 4060.0 (average 3110.4, stddev 641.3 )
Why is that? I didn't change the code of the algorithm. Thanks.
I said the output should be along the lines of, not those exact values. There is an amount of randomness within the system (caused by the scheduling order of threads in the JVM), so each time you run it you should maybe expect to get different values anyway.
Keywords: coursework
Submission reference: IN1056
Can you please explain to me in slightly more detail the difference between the request_queue and the ddev_pending? Thanks
These attributes/fields are defined as:
protected int ddev_pending; // how many requests are currently being // processed in the disk device (max 2) protected DSRequest[] request_queue; // array of queued requests (fixed size of 32) protected int rq_count; // number of requests on the queue
The difference between them should be fairly obvious — request_queue is an array of requests (array of DSRequest types) which have not yet been serviced. The ddev_pending integer indicates how many requests have been dispatched to the underlying device, but have not yet been processed.
The disk device calls the 'completedRequest()' method when it has serviced one of these pending requests. The code in DiskSchedulerFIFO for this callback either immediately dispatches a new request from the request_queue (in which case it means there are still ddev_pending requests pending), or decrements ddev_pending — because there is one less pending now.
Please try and avoid using text-speak when posting questions, there aren't any small text-length limits on the anonymous questions system :-).
Keywords: coursework
Maintained by Fred Barnes, last modified Thu May 8 12:58:00 2014 |