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: IN2970
Is it recommended to periodically take requests from the request queue/stack and place them in another temporary queue/stack to be serviced? It seems like taking requests in waves is the only way to ensure no starvation happens.
That's probably a sensible way of dealing with starvation, in cases where you know it's happening.
Keywords: assess5-1314
Submission reference: IN2971
I'm confused as to what we are actually trying to compare. I'm using linked lists to implement the C-Scan. I start at the head and move down towards the end of the disk, as I'm moving down the disk, I'm going to be servicing requests as it goes down. But in this instance what is a "request", am I meant to be looking for blocks or tracks?
The system (high-level) requests blocks — as you previously learned, some sort of logical numbering applied to "block devices" (starts from 0 and goes up to the size of the device divided by the size of a block, minus one). These blocks reside on particular tracks, the mapping from the former to the latter computed by DiskSim.block_to_track(). When a request is given to the disk, it is given as a block number (and returned as such) but the disk must first move the heads to the correct track for that particular block (i.e. some code in there, that in reality would probably the disk's firmware, also calls this to find out which track needs to be selected). The scheduling algorithm, whose job is (partly) to minimise track-to-track seek times, thus should be comparing tracks of those particular blocks. Note that it wouldn't make sense to define a request as a "track", since any particular track contains a whole bunch of blocks (in all sectors on that track and across all heads).
Keywords: assess5-1314
Submission reference: IN2973
What value should I expect to get for a C-look implementation on requests-big.txt? I'm currently getting:
[snip] Score value: 2936
and for requests.txt:
[snip] Score value: 1762
For the large request file, the score looks sensible: better than SSTF anyway. But for the smaller request file, 1762 seems slow: FIFO manages a score of around 1400. I've not looked hard at what is precisely meant by "c-look" (and it may depend on whose definition you use) but my own C-SCAN implementation (not sophisticated by any means) gets a score value of around 670 on the small request file, and around 2340 on the big request file. On that basis, I'd query whether your algorithm is implemented correctly: based on the fact it's worse than FIFO in one instance.
Keywords: assess5-1314
Submission reference: IN2974
How would I find the top track?
Look at the code! Near the start of DiskSim.java is a constant that specifies this; it's publically visible name so you can use it in your own code if you must. But note that strictly speaking your code doesn't need to know this outright: the top track is the biggest one in the request queue as far as it needs to be (or should be) concerned.
Keywords: assess5-1314
Submission reference: IN2976
Is there any reason I would get a NullPointerException at "req.time_read = timenow;" in DiskSim.java?
Most likely your code is calling disk_readblock() with a NULL parameter: the second parameter should be the BRequest structure (object) that accompanied the request originally.
Keywords: assess5-1314
Submission reference: IN2975
I have written a loop:
for (int i=readqueue_tail; i < (readqueue_tail+readqueue_size); i++) ...
like that, but I am getting an ArrayIndexOutOfBoundsException?
As I've said elsewhere, you cannot iterate over a circular queue like this: in fact, what you get by adding the queue tail pointer to the queue head pointer doesn't necessarily make sense. In short, don't try and do this, unless you understand fully what's going on: draw a diagram and work through it by hand! Instead, start with the LIFO version of the code. It's performance as LIFO is extremely bad, but the code is perhaps a simpler starting point for other algorithms (where whether it's implemented as a stack or queue is irrelevant, since it's not treated as either necessarily).
Keywords: assess5-1314
Submission reference: IN2978
Probably a bit late to ask this but thought I'd try...when writing a C-SCAN implementation, will the simulator take the shortest (circular) route from a high sector to a low sector or not? If not will I have to get it to "move" to the very last sector before it will make the jump to the first one again?
The simulator will work as it's programmed to do :-). There is only one way the active sector changes, and that's as the disk spins. So in terms of longest or shortest route, there isn't a choice: disks spin one way only.
Keywords: assess5-1314
Submission reference: IN2979
In regards to the disk scheduling assignment for CO527 I first implemented LOOK and then C-LOOK, but LOOK scores better for me (even on files I made myself, with the exception of the largest one). However, C-LOOK scores better using the dynamic option. My concern is that if the assessment is marked based on the score of some file(s) LOOK may end up scoring better despite its bias. What option would be best to go with?
Your call! See Question 99 (2013) perhaps — dynamic mode is basically overload, but that may be detectable and as a result you could use a different strategy in scheduling. Such things are going to be complicated, but if you can get it to work, it'll likely score well overall. Bear in mind that the best student submission will score 100%, so scoring is relative to your peers in that sense.
Keywords: assess5-1314
Submission reference: IN2980
Will 703 and 2937 for the small and large request files get me a good mark?
That will probably score somewhere between 50% and 60%, so reasonable. It's comparable with various SSTF implementations, at least for those two request files.
Keywords: assess5-1314
Submission reference: IN2981
I noticed that after the initial idle call (-1 blk value for readcomplete), there isn't any other idle phase, with these files at least. Do we have to take this into consideration? Or will you just be using our scores from these two (requests and requests-big) for marking?
From the assessment description: "Your submission will be tested on an unseen request data file, so you should focus on an appropriate generalised algorithm, not one that is targeted to the provided data-sets.". Technically, you need to handle the idle case at any time, not just at the beginning. Whether or not your solution encounters this will depend mostly on how fast your solution processes the requests it's got (i.e. if there is idle time before subsequent requests are made by the system).
Keywords: assess5-1314
Submission reference: IN2972
Is there a possibility for an OS&A revision session like the one for Functional and Concurrent Programming?
You're the first to ask I think! I'll try and get something timetabled that's compatible with most.
Submission reference: IN2982
My C-Look implementation scores 773 for the small file, and 2397 for the large file. "-d 32" runs score between 2500 and 3000. Is this reasonable?
Please see various other anonymous questions on this: there's enough information on the pages now for you to make an informed judgement on your own work!
Keywords: assess5-1314
Submission reference: IN2988
Would it be possible to access the two quizzes from assessments 1 and 2 for revision purposes?
I've re-enabled these two quizzes in "revision mode", so you should be able to see what you get right and wrong. The value in the first quiz may be limited as this was largely to test your prerequisite knowledge/understanding, but it's there anyway! Run the quizzes in the same way as you did for the assessments, i.e.:
/usr/l/frmb/co527/assess1/aqwrapper /usr/l/frmb/co527/assess2/aqwrapper
Keywords: revision
Submission reference: IN2991
In the exam will we have to write assembly code?
No [1]. I would expect you to be able to read and understand simple assembler programs however (as per the mock architecture questions).
[1] If we were to ask this sort of question, it would be very "light" (as in, here's some slightly broken code, fix it). But that's extremely unlikely.
Keywords: exam
Submission reference: IN2992
In assembler if you have:
ld r16, Y
What does this do? Because the "Y" value is 16-bits long and r16 is only 8?
"Y" is not a value as such, it's an address. I.e. the 8-bits of data at that 16-bit address in SRAM (or potentially other addressable things — see memory-map) are loaded into r16.
Keywords: assembly
Submission reference: IN2993
In the exam could there be questions related to electricity?
No. Neither is the material on building logic gates, flip-flops, adders, etc. out of transistors, but I would expect you to understand what these things are and what they do (e.g. as part of a diagram).
Keywords: exam
Submission reference: IN2994
Will the 8-bit timer/ USART device be examined, as they seem to be things more relevant to the AVR than a general understanding of the architecture. And if so, will we need to know specifics or would a general understanding of them be acceptable?
I'm not going to ask questions such as "describe the function and purpose of the UBRH I/O register", but would expect a general understanding of UARTs or timers in general (broadly, the sorts of hardware units you're likely to find in microcontroller). Things like this fall into both categories though: architecture and operating-systems (the latter of which has to provide some software interface to these sorts of things through device-drivers and similar).
Keywords: exam
Submission reference: IN2995
Yesterday in the revision session, it was said that without absolute jumping you would not be able to go to addresses within -1023 — +1024 of the address, or up to 2048 from the address. Does this mean that the bootstrap wouldn't work as the code for the bootstrap is executed based on a known address?
Not necessarily: when powered on, presumably there is some initial PC value, so execution starts somewhere which will be known. The assembler (software that turns assembly source into binary blobs) knows where things are — it's creating a memory-image for the FLASH basically — and that starting-point can be specified using an ".org" directive.
The values you have aren't quite right though: the example in the revision session (from the mock architecture questions) takes 12-bits of address from the (presumably jump or call) instruction, bits 0-11 inclusive. 12-bits gives you 4096 distinct values, so when interpreted as a signed (2's complement) value, that gives -2047 through 2048 (still 4096 distinct values).
Keywords: architecture
Submission reference: IN2997
Am I right in saying, lecture 1 (Introduction, Electricity and Semiconductors) is not examinable, and everything after is?
Yes, rather the material on those things though, as there may have been other things in that lecture. Similarly there's some semiconductor stuff in lecture 2 which isn't examinable either.
Keywords: exam
Referrers: Question 121 (2013)
Submission reference: IN2998
When you're looking up some memory using segmentation, you find the physical address by using the segment number and the offset. Is this the physical address of the memory you want or is it the address of the start of the segment?
The physical address of the memory you were after (assuming the mapping is valid and that memory exists). The start of the segment is the same thing but without the offset added/or'd in.
Keywords: segmentation
Maintained by Fred Barnes, last modified Wed May 25 15:07:20 2016 |