Computer Systems Organization (Tietokoneen toiminta ) Summer -99

Exercise 8 (Friday 20.8. )


1. What information is exchanged (and in which manner) between
a) an application and the device-independent layer of the operating system,
b) the device driver and the device controller when the application is writing into a file byte by bite? You may suppose that the controller is DMA-capable.

What should the disk driver do if it doesn't get an answer from the controller (due to the latter not being present or in the working order)?

2. In UNIX systems, the following file access rights may be granted to the processes owned by individual users or groups of users (note that a directory is also a file):

        r = the right to read the contents of a file,
        w = the right to write a file (i.e. to change its contents),
        x = the right to execute a program or to use a directory in a pathname.

Suppose we have the home directories of users Kalle and Ville under a directory named /usr. Kalle has (at least) the subdirectories called Source and Text, both of which contain a number of files (draw a picture). What rights should Ville at the least have for Kalle's files and the directories along the search path in order to

When does the operating system check for these rights? How does it do it?

3. Let's suppose you are surfing the World-Wide Web using a home computer, a modem and a Web browser like Netscape or Internet Explorer. How does the browser get the WWW-pages from the Web - that is, what layers of protocols are used and why? Give some examples of the protocols.

4. Suppose you suddenly develop an overwhelming desire to design a new RISC machine using the TTK-91 language as the starting point. For starters, you decide to throw away all the unnecessary instructions.

What instructions would you throw away? The implementation of these instructions may take a number of those instructions which you decided to keep in the instruction set; you may need constructions like small loops etc!

What addressing modes could you live without? That is, what modes of addressing could be implemented using the other modes?

5. Revision
a) Write in the TTK-91 assembly language a function called Revision, which gets a parameter X in the stack (activation record) and prints all positive integers which are smaller than X. Revision also adds these integers together into IntegerSum and returns this as its value in the stack.
b) How would you modify Revision if IntegerSum was to be returned to the main program with the help of a variable parameter? (In that case, there wouldn't be any need for Revision to be a function, would there?)
c) Is the first solution better than the second one?

6. Considering the course content, what issues did you find most useful? Give a separate piece of paper to the teacher with three well-argumented suggestions for exam questions. In addition, fill in the course evaluation form at http://www.cs.helsinki.fi/kurssit/kyselyt/kevat_1999/.