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.
Just wondering at what point over the word limit will we be penalised? is the 1300 mark alright? or can we even push it up to 1500? Hello. How loose is the "approx 1000 words" rule in the essay description? I.e. do we lose marks for going over too much or being under too much?
I really don't want it going much over 1000. Part of the point of this is to see how well you can sum up the material.
When we start the essay are you expecting a definition of what an operating system is, what system memory is and what a CPU is or just what an operating system is?
I'm really just concerned about the answer to the question, which probably doesn't (in the words allowed) require too much in the way of definitions.
When is the third (postponed) fun lecture going to take place?
I think I will leave it until slightly later in the term (say halfway or so) so that some of the Stage I students will be able to come. I will publish details when the time comes.
In the essay would you like us to use 1.5 line spacing?
As long as it's readable, I'm not too bothered.
I don't want to sound like I want to have more assessments, but when is assessment 3 going to be set ?
Today (only a day later than advertised!). I'll post to the course newsgroup soon.
Keywords: moss2004
I have just been looking at the assessment and I have chosen to do option number 1. It does not specify though what type of files we should be expecting to copy, (I mean text or binary). If it is text files then I could use filewriters readers etc with a buffer to copy the files across, or a streamwriter to copy binary files. Which type should I expect to copy?
Is there a command in MOSS that will return the current directory path ?
MOSS does not distinguish between text and binary files -- they're just files to it (a bit like UNIX). To access files (open/close, read/write) you need to use the methods in MPosixIf. E.g. "MPosixIf.open()" will return an integer file-descriptor which you should use with subsequent file operations (read/write/close).
As for current working directories, nope, I haven't programmed these into MOSS yet. Thus any reference to a file or directory must be absolute (e.g. starts with "/").
Keywords: moss2004 , moss2004-1
Referrers: Question 47 (2004) , Question 55 (2004) , Question 66 (2004) , Question 92 (2004)
A couple of questions regarding file-copy utility:
I am going to implement the file copy utility. When you do a file copy from file1 to file2 are you also expecting us to be able to copy directories as a whole ?
Also, can you do open a directory through "cd" in MOSS or do you have to type the whole directory to access a file every time?
Finally, do we need to make the prompt interactive to a copy command or do we just type "/bin/copy" ?
Nope, the given source (file1) should always be a file (probably worth checking this and reporting an error if not).
Nope, as mentioned Question 46 (2004), MOSS processes have no concept of a current working directory; so every file (or directory) name passed into the kernel must be absolute. As long as you don't start creating massively long directory and file-names you should be ok!
The user will always run the program with "/bin/copy". The interactive-ness refers to what happens when the destination file already exists. For example:
MOSS# /bin/mkdir /tmp MOSS# /bin/copy -i /etc/console /tmp MOSS# /bin/copy -i /etc/console /tmp /bin/copy: /tmp/console already exists, overwrite (y/n) ?: n MOSS#
Keywords: moss2004 , moss2004-1
Referrers: Question 112 (2004)
In light of the fact that CSE students have never needed, been required, or told how to use UNIX, as opposed to the pure computer science students, and where taught Java entirely using the BlueJ evironment, wouldn't you say it was a tad mean to give them a very complicated assignment, which they have to do using unfamilier software ?
It's bad enough trying to get somthing working when your using tools you are comfortable with, let alone when you told you have to use a completly new toolset. Although fans of UNIX will try to force it upon people, a complicated assignment is not the time to do it. The networking course work was designed in such a way that students could use whatever methods they were used to, why could this assignment not be designed in the same way?
Or is UNIX a module we didn't know about ?
Hi, the majority of pure CS students have not been taught UNIX either. The only explicit UNIX teaching that there has been was a short "value-lite" course run by the CS department at the end of the first year. I understand that this was very successful (run by the systems group), but only had a small number of students. You will get no argument from me about having a full UNIX course open to all students.. (in fact, any operating-system..).
If you look at the learning outcomes for this assessment, "... demonstrate a basic familiarity with UNIX (e.g. for compiling and running programs)." -- this is why there is a small bit of UNIX here. It's an operating-system; this is an operating-systems course; reasonable logic there I think... You don't need to know much UNIX, however:
That doesn't look complicated..! Sure, it might take half an hour or so to get going, but I'm not asking for a lot here..
For editing (and to some extent, compiling) you can use BlueJ fine, as talked about in the the assignment description. But running MOSS from within BlueJ does not work right, nor in the way you'd expect (e.g. to interact with bits of MOSS via BlueJ's object inspector). The high levels of concurrency in MOSS appear to cause problems with BlueJ, however. You can try and run it from there (there's even a "BlueMOSS" class that's supposed to help a bit here), but my experience is that things didn't work right (and the object inspector was perhaps not the most useful in the way it's currently presented -- a large full-screen tree of objects and references would be more useful for software of this size).
Or you could use something like Eclipse for editing -- whatever editor you prefer really :-). Since your raptor filestore is visible from the Windows network, there shouldn't be any problems with this.
Keywords: coursework
I'm working on the MOSS assessment on the unlink question. I think I have implemented a partial solution to the problem, however there seems to be an interesting issue with executable programs..
If I unlink a file then "ls" no longer shows it, and "cat" can no longer display it etc. However, if I unlink an executable file ("/bin/pipetest" for an example) it doesn't stop me executing the program. Could you tell me if this a quirk in MOSS (that I dont need to worry about) or a problem with my unlinking code.
The only way that should happen is if you ran the executable program before unlinking it -- and this is a sort of a quirk (bug might be a better term). Running an executable causes the class containined in a file to be loaded and executed, but since there's no way to forcefully unload a class, the same class can't be loaded again (causes some strange run-time errors relating to the partitioning of the JVM -- caused by class-loaders). So, when you run a program, MOSS remembers incase you run it again. At the moment it seems there isn't a portable solution to this (Java) problem..
Keywords: moss2004 , moss2004-2
Is there a reading list anywhere? The link on the webpage has nothing in it. Thanks
Yes, look in the module description.
Keywords: reading-list
Hello; I'm having major problems with starting this new assignment. Are we supposed to create a new class or edit current classes (i.e. the "MiniOSSim" class) also, could you give us tips on how to get started. So far I have read the lecture slides, read the MOSS page and some anon Q+As. By the way are "moss2004" and "moss" somehow the same keyword for the same coursework ? or did it change over time ?
In all cases you will be editing existing classes -- for the first (a file copy utility) only a basic skeleton is present. The other options involve editing classes that are mostly there already. You'll probably want (or need) to add methods to existing classes though. A good place to start is to make sure you can run MOSS if you haven't already done so, and spend a bit of time playing with it (e.g. "ll /proc", "cat /proc/cpuinfo", etc.).
The files that you'll need to edit are given in the "what to submit" bits in the assignment description; you may want to look at some of the files mentioned here before choosing a particular option.
The "moss" keyword was for a related (but different) assignment last year. I added "moss2004" to avoid confusion (easier than renaming "moss" to "moss2003"). MOSS changed quite a lot between then and now (got better basically), so last year's questions (and answers) will be of limited use.
Keywords: moss2004
For the assesment are we allowed to import any Java classes we like ?
It depends what you use them for.. can you be more specific about which classes you want to import ?
Keywords: moss2004
On average how long is it supposed to take a student to finish this assignment ? 20 hours ? 10 ?
It says in the assignment description. But you can work it out for yourself: the module description states that there are 24 hours for coursework. This assignment is worth 50% of the coursework mark, thus I'd expect the "average" student to spent around 12 hours on this. But that's not a necessarily a guideline..
Keywords: moss2004
Hello - I think I will implement the "UCopy" option (1). Is there any way you can also order the question options like you have done in the past with the moss questions (i.e mailbox, pipe etc) so we can just clik on the relevant keyword for the question options in "moss2004" were looking for ?
Also you say in the assignment description:
"/bin/copy file1 file2" will copy the contents of file1 into file2, creating file2 as necessary.
If file two already exists I'm asuming it prompts the user whether it should overwrite it ? or else it creates a new file. Does the facility distinguish between extention file names ? Because if I normally save two files in the same folder with the same name, so far they're not of the same type it stays in the same folder for example: "iLoveOS.Java" and "iLoveOS.doc" will save in the same directory. :-D
"/bin/copy file1 directory" will copy the contents of file1 into a file of the same name in directory.
What if the directory doesn't exist - am I supposed to make the system create the directory and copy the file to that directory ?
Thanks.
For your first point, yes, I've just started doing this (in response to your mail). The various new keywords are just "moss2004" appended with "-1", "-2", etc. The way it works means people have to ask questions relating to something before anything will appear in the index -- options 1 and 2 have questions, the others don't (yet).
For copying file-to-file, yes, if the destination file already exists it should be overwritten. This doesn't necessarily mean deleting it and re-creating it though, but it does mean truncating it (unless the "-a" (append) option is given). Truncate can be specified with the "MFileOps.OPEN_TRUNC" flag in the call to "MPosixIf.open()" (see the API).
Filename extensions have no special meaning in MOSS -- it's just part of the filename. If a user (from a hypothetical MOSS application) saves something called "iLoveOS", then they'll get a file called that -- no extra bits for the extension.
When copying a file into a directory, if the directory doesn't exist then an error should be reported; it shouldn't try and create the directory. If you do want to program this in (and it's up to you!) use additional command-line options, e.g. " -p create destination directory/directories", but beware that you might have to create a whole directory tree -- depending on what bits already exist. But this isn't required for the assignment (doing it will produce "bonus" marks, added to any already accrued up to a maximum of 100).
Keywords: moss2004 , moss2004-1
Is the "UCopy" utility supposed to copy all files of all types or only txt files...?
See the answer to Question 46 (2004)
Keywords: moss2004 , moss2004-1
I don't quite understant how to access information from "stat". I looked at "MPosixIf.stat()" but I need to provide some "MInode" object. How do I access information about it been a directory ?
If you need an "MInode", just create one! Looking at the documentation (and code) for "MInode" should tell you all..
Keywords: moss2004 , moss2004-1
Do you have a link to that OS written in Haskell ?
Sure, it's called hOp, at: http://www.macs.hw.ac.uk/~sebc/hOp/ and http://etudiants.insia.org/~jbobbio/hOp/
If file extensions have no meaning, how is a distinction made between a file and a directory ? Surely passing the argument "/tmp/testfile" would appear the same as "/tmp/testdirectory" when given to "/bin/copy" as the destination ?
The distinction is made from the type (or mode) of the file. The operations for files and directories are slightly different -- as seen in the "MPosixIf" interface (e.g. "open()" for files vs. "opendir()" for directories). If you try to open a file or directory as the other type it produces an error (e.g. "-MSystem.EISDIR" or "-MSystem.ENOTDIR"). However, for this assessment, you don't need to worry about "opendir()" -- since you won't be reading directory contents.
If a destination of "/tmp/testdirectory" is given, and it is a directory; and the source is "/proc/cpuinfo"; then the output would go into "/tmp/testdirectory/cpuinfo". If "/tmp/testdirectory" did not already exist, or was a file, then the output should go into that (as a file, despite the slightly daft name).
Keywords: moss2004 , moss2004-1
I'm doing the copy function for the assesment. Is there any way of testing "/bin/copy -a" to see if i have done it correctly ?
Just copy some standard file (e.g. "/proc/mounts") to somewhere, do it again with the "-a" flag, then check that the file contains two lots of information (e.g. with "cat" and doubling of the file-size).
Keywords: moss2004 , moss2004-1
I am implementing the file copy in MOSS but can't seem to be able to truncate the file. I have used this:
fd = MPosixIf.open(fileToOverwrite, MFileOps.OPEN_TRUNC | MFileOps.OPEN_WRITE);
but neither seems to truncate the file, what am I doing wrong ?
Specifying the "OPEN_TRUNC" flag will truncate the file; I just tested it in the wfln utility and it works. However, it will only work on the "object file-system". The host file-system does not support "OPEN_TRUNC" (option 4 involves implementing this), so if you try it there it won't do anything.
If you need to debug this, I'd suggest plumbing the "MPosixIf.open()" method with some print statements (e.g. "MKernel.log_msg ("hello world :)");") to see if the flag is actually there.
Keywords: moss2004 , moss2004-1
Referrers: Question 62 (2004) , Question 69 (2004) , Question 79 (2004) , Question 82 (2004)
Maintained by Fred Barnes, last modified Thu May 8 12:58:04 2014 |