Vous êtes sur la page 1sur 1

Alexandria University Homework 1

Faculty of Engineering CS333: Operating Systems


Electrical Engineering Assigned: Feb 25, 2017
Spring 2017 Due: March 11, 2017

Homework 1: Computer System Overview, Operating


System Overview
1. What are the main functions of an operating system?

2. What are the three main purposes of an operating system?

3. What is an interrupt? system call?

4. (T/F, Justify) Two devices can each generate interrupts at the same time.

5. What is the difference between a multiprocessor and a multicore system?

6. Consider the following code:

for (i = 0; i < 20; i++)


for (j = 0; j < 10; j++)
a[i] = a[i] * j

(a) Give one example of the spatial locality in the code.


(b) Give one example of the temporal locality in the code.

7. A computer has a cache and main memory. 20 ns are required to reference a word that is in the
cache. If the word is in main memory but not in the cache, 60 ns are needed to load it into the
cache (this includes the time to originally check the cache), and then the reference is started again.
If the word is not in main memory, 10 ms are required to fetch the word from disk, followed by
60 ns to copy it to the cache, and then the reference is started again. The cache hit ratio is 0.9 and
the main memory hit ratio is 0.99. What is the average time in ns required to access a referenced
word on this system?

8. Which of the following instructions should be allowed only in kernel mode?


(a) Set value of timer.
(b) Read the clock.
(c) Clear memory.
(d) Disable interrupts.
(e) Access I/O device.

9. What is the difference between kernel and user mode?

10. What is the purpose of system calls, and how do system calls relate to the OS and to the concept
of dual-mode (kernel-mode and user-mode) operation?

1 of 1

Vous aimerez peut-être aussi