Computer Systems Organization (Tietokoneen toiminta ) Autumn -99

Exercise 7 (7.-10.12. )

Monday December 6th is the Independence Day of Finland and a holiday. New meeting time for the English group is ???.


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.

c) What should the disk driver do if it doesn't get an answer from the controller (due to the latter not being present or not 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. The virtual page size is 1024 words (0 ... 1023). The size of the virtual memory of a program is 10 pages consisting of virtual addresses 0... 10239) and the main memory has 4 page frames with physical addresses 0 ... 4095. The content of the page table at a certain moment is following:
Page number Page frame Presence bit
0 3 P=1
1 0 P=1
2 P=0
3 P=0
4 1 P=1
5 P=0
6 P=0
7 P=0
8 2 P=1
9 P=0

The program refers to virtual addresses 546, 800, 1023, 1024, 2048, 3000, 5000, 8000, 9000. What are the physical (real) addresses corresponding to these virtual addresses. Which of these references cause page fault interrupts?

4. What information does the operating system keep in the PCB (Process Control Block)? Try to figure out for each piece of information in the PCB when and why the operating system needs it. Where is the PCB located?

5. 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?

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/syksy_1999/.