University of Helsinki Department of Computer Science
 

Department of Computer Science

Department information

 
Operating Systems I S2004 / PART 1 (13.9-1.10)
Suomeksi
Hardware and Operating System Overview

o GOALS

Key words: instruction cycle, interrupts, system call, hardware support, OS functions

o TEXT IN COURSE BOOK

o SLIDES and OTHER MATERIALS

Other materials: A.S. Tanenbaum: Modern Operating Systems. 2nd ed. 2001. Pages 1-70. Also in Dept. OF CS Library, 2nd floor.

o EXERCISES A-D

Study groups are organised during the first meeting. The groups consist of 4-6 people and the group is working together during the whole course. The study group chooses one of its members as a person in charge who is responsible for delivering the part reports as well as taking care about the communication and timetables.

The section report must be returned on paper latest on Friday 1.10. into the mailbox beside the room D225 (before 12 o'clock). You can also leave the report to the teacher during the small group meeting on Wednesday 29.9.

Before the first meeting: Study the following questions carefully. Think about possible solutions. Write down all your ideas, results, problems, and unclear parts.

1. meeting: In a study group, study the exercises together. Think and discuss about what issues you already know, what items you need to find more information about, what information is needed, etc. You can consult the teacher of the small group session, but he will not solve the problems for you. He can gie you hints and show the right way for solveing the problem, if you are totally lost.

Between the two meetings: You may need to discuss together between the meetings to write your report. These discussion you need to organise yourselves. You may wish to use personal meetings at Exactum or somewhere else, use e-mail, irc, webCT (if you want to use webCT, please contact Tiina Niklander). You are expected to write your report before the second meeting.

2. meeting: Study groups present their solutions and report contents to other groups during the meeting.

After the 2. meeting: If you feel that you need to modify your report, you'll have two days after the meeting to finalise your report. For example, you may want to add/change/correct some items in your report based on the presentations during the meeting. Please notice, that you'll have ONLY two days for this.

o A - EXERCISES

Each Team: Write a report that contains your group's answers to all of the following six exercises. Please notice that there is an additional seventh exercise, which you can use to replace any one of the obligatory six exercises.

The report can be hand written (but clear enough). It does not have to be essay, there can be also lists. Do not forget to explain the details: who is doing (OS / HW), why and when, etc ...

1.1 - PROCESSOR AND INSTRUCTION EXECUTION

This exercise is in a way a summary of the course Computer Organization (Tietokoneen Toiminta). The goal is to refresh into mind the components of a processor and their functionality.

Describe the purpose and usage of the main CPU and explain in details what happens in the units (ALU, CU, MMU, cache...) and registers (PC, IR, PSW...) during the instruction cycle. You should give an answer at least to the following questions:

What is the purpose or mission of each unit? How does the CPU fetch words from memory? How does the CPU know when the bits should be interpreted as an instruction and when as a data? What happens inside CPU during the Execute Cycle? How does the CPU find the operands used in the execution phase? etc.

See figure 1.7 in course book. Why is there a selection "Interrupts disabled / Interrupts enabled"? What does it mean? How does the CPU know if interrupts are disabled / enabled? Why is this feature implemented in the system?

How does the CPU know that it has to start to execute instruction belonging into Operating System?

How does the functionality or architecture change if a cache memory is added? What about the support for virtual memory?

Please feel free to craw pictures to clarify your presentation.

1.2 INTERRUPTS MECHANISM

Describe the interrupt mechanism. You should give answer at least to the following issues:

What is the difference between a trap and an interrupt? Does they have something common? What kind of traps and interrupts may arise during the execution of a process? How and when does the CPU become aware of the interrupt? Describe how the interrupts are processed. What happens aftet the interrupt? What is done by the hardware and what is done by the software? Why?

How does the processor know whether it is executing instructions that are part of an operating system or that are part of an ordinary application? Is this relevant? How can it decide whether it should execute the given instruction or not?

When the interrupt is handled, what is done to get the interrupted process to run again? And what is done if the OS decides to switch a new process to the CPU?

1.3 - SYSTEM CALL

There are some functions that are not allowed for the user process. If the user process needs these functions, it makes a system call and the function is executed by the OS on behalf of the process.

Explain the reasons for this kind of arrangement. Is it necessary to execute all system calls in privileged mode? How do the system calls relate to the concept of dual-mode operation?

A system call is much like a procedure call: one needs to know the name of the service and give the appropriate parameters. The difference between these two is that the system call causes an interrupt and the control goes to the OS software.

Sketch a list of the services that should be available for user level programs via the system calls. For each service, what kind of parameters should be passed in stack (or in register) to the OS before the control is passed to the OS?

Hints: process control, memory management, file system, I/O, protection. See also POSIX system call interface

1.4 - MULTIPROGRAMMING AND THE HARDWARE SUPPORT

In a multiprogramming environment the applications are not allowed to mess each other and they are not allowed to use resources not owned by themselves without given permissions. To implement a multiprogramming operating system certain hardware level features are desirable. Explain what kind of support must be implemented already in the hardware, and explain how does these features guarantee a safe execution environment for the applications.

1.5 - STARTING A NEW PROCESS

A user starts a new application by typing its name into the shell's command line or by clicking an icon in a windowing environment. What kind of OS functions are necessary to get the process ready into memory? How does the OS give eventually the CPU to the new process? When everything about the process creation is done, the OS may finally switch the process to the CPU for running. How does this happen? Please continue you explanation from the beginning until the first instructions of this new process have been executed by the CPU. Hint: Think back your own experience! What are the basic tasks of an OS?

1.6 - SIMULTANEOUS ENTITIES

a) Consider the evolution of an operating system. The first systems where batch systems and they were based on uniprogramming. Currently we have multiuser and multiprogramming systems which are used more and more interactively. What kind of new features must have been implemented either by the hardware or by the software during this evolution? Hint: think about the basic functions of an OS.

b) Are there any special requirements for OS if the hardware has multiple processors (SMP, symmetric multiprocessing)? What parts can remain quite similar to their counterparts in a uniprocessing system?

c) Are there any special requirements for OS if the machines are connected to each other via the network? Hint: think about our departements network? What are common for all computers? Look at this from the user's perspective.

1.7 - MEMORY ACCESS (optional question. This can be used to replace of the precesing questions 1.1. - 1.6)

A computer has a cache, main memory, and a disk used for virtual memory. If a referenced word is in the cache, 2 ns are required to access it. If it is in main memory but not in cache, 10 ns are needed to load it into cache, and then the reference is started again. If the word is not in main meory, 10 ms are required to fetch the word from the disk, followed by 10 ns to copy it into cache, and then the reference is started again. The cache hit ratio is 0.95 and the main-memory hit ratio is 0.6.

What is the average time in nanoseconds required to access a referenced word on this system? What conclusions can you draw from your calculations. Please explain your results in a way that a student who has not made the calculations can be convinced the numbers are correct,

If a memory fetch would take 1 sec, how long would it take to fetch from disk into the memory? What does the CPU do while the I/O-controller is copying bytes from disk to memory?

o B - SELECT YOUR FAVOURITE REVIEW QUESTIONS

Each team: List five review questions that you consider most relevant for this section, and explain why it is important to understand the answers. A good review question requires understandin a lot about the issue. A question that only asks about some very small details is not a very good review question.

Did you find any special issues or did you have any troubles with this section? If there are areas that would need more detailed explanations, please give a hint. Hint: think about what kind of questios would you like to answer in the course exam

o C - EVALUATION

Each team: Please evaluate your teams work as well as your own work using the following pdf form (in Finnish). The form will be handed to the team in the small group session.

The evaluation has two goals: (1) to collect information about the exercises and study groups, and (2) to help study groups to make their work even better. We appriciate short answers that give the essentials in a compact form. Please try to be open minded. Answer to each question and give also your reasonings.


o Next section

Preparation is human - a well know method when studying.

Page created 06.09.2002, Auvo Häkkinen