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.
Is it possible to establish whether two paths refer to the same file by comparing values within their MInodes, as obtained via "MPosixIf.stat()" ? The lecture slides imply to me that UNIX inodes could function as a 'primary key' of sorts, but the description of fields such as "ino" is rather vague, so I'm not sure if this is possible in MOSS.
It's simpler to compare paths (e.g. as Strings). Each unique file has a unique inode number within the device, so yes, it'd be possible to compare with this. But this might not work for all file-systems (e.g. very virtual file-systems that generate inode numbers on the fly).
Keywords: moss2004
Concerning the MOSS assessment option 1. When you open "moss/modules/UCopy.java" and read the comments a bit there says:
--help to produce some on-line help
on-line help - does it mean website help or similar helps like "UCat.java" and "UWfln.java".
Like UCat and friends, produce some help on the screen (assuming the program's output is connected to a terminal, of course). On-line here means "not on paper", not "on a web-site".
Keywords: moss2004 , moss2004-1
I'm trying to use "MPosixIf.lseek()" and I'm pretty sure my code for using it is ok, but the only prob being the compiler doesn't seem to think the method "lseek()" exists and I can't find it in the documentation for "MPosixIf" either... am I missing something obvious?
See the answer to Question 77 (2004).
Keywords: moss2004 , moss2004-1
Hi, when I try to use the "MPosixIf.lseek()" function:
int temp = MPosixIf.lseek(tg, 0, MFileOps.LSEEK_END);
It always said "cannot resolve symbol method - lseek(int, int, int)". Could you tell me what have I done wrong please :(
More of something that I did wrong -- see the answer to Question 77 (2004).
Keywords: moss2004 , moss2004-1
What the heck is this:
run_queue.prev.next = p; p.prev = run_queue.prev; p.next = run_queue; run_queue.prev = p;
from "MKernel.java", supposedly meant to put a new process "p" into an existing run-queue "run_queue" right ? I don't get it!
Yes, it attaches the process "p" to the list of runnable processes "run_queue". This is a doubly-linked circular list, but the list is made out of the "MProcess" objects themselves, not "hanging-off" a separate list structure -- and there are good reasons for doing it this way. This code runs in the case where the list is not empty (i.e. it contains one or more processes). First, the process "p" is attached to the next link of the "last" process in the run-queue (since it's a doubly-linked list, "run_queue.prev" is the last node). Then, "p"s previous and next fields are linked to the end and start of the run-queue, finally, "run_queue.prev" is updated to point to "p". The effect of this code is to add "p" to the end of the list. Adding it to the start would be simpler, but is slightly wrong (we want to keep the run-queue fair).
Keywords: moss2004 , moss2004-5
What is more important, having a solution that implements the flags but with a lot of repeated code, or one that only say implements one of the flags, but with tidy code ? I'm guessing that I only have time to do one or the other, which is the better option ?
It would be better to have more "functional" code -- i.e. supporting all the flags. If the code is repeated verbatim, you could move it into a newly created local method fairly easily..
Keywords: moss2004 , moss2004-1
Hi, what do you consider a sensible buffer size to use when copying files ?
1k or 4k would be fairly normal (i.e. 1024 or 4096 bytes). Considerations include how much data the underlying system is able to shovel in one go, and the size being a multiple of a disk sector size (although this is fairly irrelevant for MOSS, but good for OS's in general).
Keywords: moss2004 , moss2004-1
Hi, I have tried to use the following to go to the end of the file:
int temp = MPosixIf.lseek (fd, 0, MfileOps.LSEEK_END);
I have copied the newer version of MPosixIf.java into my MOSS folder but still keep coming up with the same error again and again:
cannot resolve symbol method - lseek (int, int, int)
I have looked into the ".java" file of the newer version of MPosixIf and can see the method lseek in the file but still cannot get the compiler to accept this call. I have also looked at all the questions regarding this problem and the only solution is to copy the newer version in, but still no luck.
What am I doing wrong ?
The reason this is probably happening is that the (old) MPosixIf.class file has a newer timestamp than MPosixIf.java, thus Java (and make) won't recompile it. Easiest solution is to delete the stale "MPosixIf.class" file -- then "make" will recompile it.
Keywords: moss2004 , moss2004-1
Can I ask why the assessments tend to be hard and somewhat unrelated to the lecture notes?
The essay required a lot of research and the title was vague and this one we've had to learn a new operating system to run some java. Ok I appreciate these are themed and do actually match with the course (the arguement with the current one being its an OS course so we should learn about different OS's e.g. UNIX and MOSS) but why are they so hard? Its taken me several hours to figure out the code and what we're exactly meant to do.
The work is hard, because if it were easy you wouldn't learn anything! Likewise, if it were simple regurgitation of the lecture notes, it wouldn't demonstrate anything additional to what you might demonstrate in the examination.
The essay did require research; that was the point of it. The title was vague, to give you scope to do it the way you wanted, within reason.
I'm afraid operating systems are hard! But it gets easier!
Bob, out of interested how many computers do you have at home, what are they generally used for and how are they connected? When you mention your home network in lectures it sounds like you have some serious hardware.
It's difficult to give a precise answer. I should start by saying that I do not run very fast computers on my network; the fastest is a Celeron 450, which is for the Windows machine! None of the other systems need a great deal of grunt.
Computers in normal service (i.e. switched on all the time) are:
Machines that are used frequently or occasionally:
There are also a number of vintage IBM machines of various sorts, including an early 'luggable' with a 9 inch CRT screen, and a later one with an orange plasma screen...probably about 15 in total.
The network is currently 10Mb/s, but that will change over Easter to 100Mb/s when I get the rack to install a new switch. All rooms have network connections, even the kitchen. The ADSL is 2Mb/s, with two blocks of static IP addresses (24 in total). There is also ISDN (BRI) backup. Critical machines are fed via two separate UPS systems.
Needless to say, I also have a sophisticated security system!
Well, you did ask!
Referrers: Question 156 (2004)
Hi, what text size should this essay be in? Basically, are we allowed to make the text size 6 to make sure we don't go over a page and length, and hence get penalized?
I wouldn't call it an essay - report, perhaps. I would expect 'normal' (i.e. 10 or 12 point) text; my eyesight isn't that good, so if you want me to actually read it....!
In regards to the Operating system research assignment, should we be keeping a note of the websites that we use for research (or books etc) and submitting these with the research?
It would be nice to do so, and I guess I wouldn't mind if that bit didn't fit on the page.
In your answer to question 150, you say that every room in your house has a network connection. Does this include the bathroom?!
Since I don't have a self powered machine at present, and mains electricity in bathrooms is strictly controlled by the IEE Wiring Regulations, no. My bathroom isn't big enough to allow a suitable 'safety zone' as per the regulations.
Since I'm a member of the IEE, I really ought to get this right!
For the research assignment, should we have one line spacing after each line of text. In that way, one page would approximately make up 3-400 words while not having one line spacing will make up abt 500 or more words in a page.
Can you please specify the maximum word limit.
Single spacing is fine. As far as an actual word limit...just make it a page.
Out of interest, what is your favorite operating system and why?
My favorite has to amiga Workbench/OS as its fast, simply and stable.
Mine (Bob's) would vary depending on what I want to do. My everyday desktop system is OS/2, and it's also what I use for servers. But I use FreeBSD quite a bit too.
I use OS/2 because it's fast, reliable and I like the user interface. I use FreeBSD because it's not an upstart UNIX wannabe like L***x!
If you really don't need to be anonymous, please ask in the newsgroups as it's easier for others to join in, and easier for us to reply too.
Mine (Fred's) would probably be Linux. I gave up on windows about 9 years ago, and haven't looked back since. Also I've contributed code to the Linux kernel, so should perhaps advocate it for that reason alone! For other operating-systems, hmmm, well, DOS wasn't too bad (beefed up with a bit of QEMM386), and NT 3.51 (written mostly by Digital Equipment Corp.) also worked. The BIOS in the ZX-Spectrum +2 also was pretty functional, though terribly basic [cough]. Systems that I wouldn't touch with a barge-pole include HP-UX, VMS, Novell-NetWare, and a borderline Irix.
In response to Question 150 (2004): Fred, out of interested how many computers do you have at home, what are they generally used for and how are they connected ?
A various assortment, but not quite as geeky/cool as Bob's setup ;-). There are two of us in this house, both fairly techy, so the arrangement of computers is a kind of blend. In the middle of everything is a nice'n'cheap 8-port netgear 10/100 switch. There's also a buffalo wireless wotsit that does the wireless and also acts as another 4 10/100 ethernet ports. Machines include, my "main/desktop" machine (used for developing KRoC, writing lecture slides, music-ing, that sort of thing) which is a P3-800 running Linux 2.4. There's one machine running IPCop that does the firewalling and has the PCI ADSL card in it, which is a P2-266. Another machine (P3-550 running Linux 2.4) does things like mail, DNS, web (internal and external), web-cache and ad-filter, security-cam motion tracking, "household devices" monitoring (interfaces with a network of RS422 based devices that do temperature monitoring, provide scrolly text displays, and will soon read the electricity and gas meters), current home-brew hardware in the parallel-port to measure electricity and gas usage, and probably some other things too. One other machine is responsible for VPN end-pointing (a Pentium-133 that's nearly dead, one of the disks has stopped already, running Linux 2.4); and another machine (P2-400) that does the file-server bit, has a few CD-ROMs in it. There's also various other machines, e.g. SGI Indy, Acorn RISC-PC, T9000 transputer, RMoX dev-boxen, free-range motherboards and PSUs, but not always on, etc. The SGI may get reinstated as the "kitchen-term" at some point (running Linux). The wiring is exclusively CAT5, except for the RS422 bus, which is standard TP cabling (only running that at 9600 baud at the moment).
I've got the big old book you recommended, "Applied Operating System Concepts", and it seems to me that we may not need to learn everything that's in it. Would it be possible for you to just list the chapters we have to learn. This would be a great help for my revision, cheers matey.
For my (Fred's) lectures, I've put reference to book chapters at the end of each lecture. For Bob's lectures, look at the lecture slides then look at the index in the back of the book -- which is how I got the references out for my lectures mostly.
Keywords: exams
Is the page/swap file stored on the disk?
Generally, yes it is. Ask yourself the question: where else might such a file live ? Non-standard cases might include diskless (network-boot) machines, that could have swap-space available over the network. Or maybe there's some peculiar architecture that doesn't have a disk, but has some big-and-slow memory somewhere, that could be used as swap-space (assuming you don't want to execute normal programs there).
Keywords: virtual-memory
Could you explain I/O ports (w.r.t. device addressing) in a little more detail ? I've googled around, but still don't quite get how it works.
A good reference is probably the PC. This makes some distinction between memory-addresses and I/O addresses. The distinction is usually so that devices are not treated as memory -- e.g. caching device reads and writes in the processor would not be useful. On the PC, the same physical bus is used (i.e. the one everything is plugged into, typically ISA or PCI), but you get an extra wire that says "I/O cycle" or "memory cycle", so devices can deal with them differently. PCI actually hides away some of this stuff, allowing certain devices to be memory-mapped as well as being I/O mapped (memory-mapped hardware can be treated like regular memory to a certain extent, e.g. accessing some configuration space in the device). On the PC for example, I/O ports (addresses) 0x000 to 0x01f access registers in the DMA controller. The similar memory addresses are (semi-) real memory, belonging to the start of the interrupt-vector table.
Keywords: input-output
I was looking at the lecture notes page and I noticed that "Part L: Multiprocessing" were not put up. Was this lecture cancelled or is the material just not available online? If it can be assessed during the exams could you give a brief overview of what we need to know?
As mentioned in the lecture and on the course news-group, this part was folded into the lecture on "miscellaneous system topics". Yes, it is examinable, similar to anything else presented in the lectures. This is why it's important to attend lectures; some things may be mentioned in lectures that come up in the exam but aren't in the notes.
Keywords: notes
Maintained by Fred Barnes, last modified Thu May 8 12:58:04 2014 |