Professional Documents
Culture Documents
1 Introduction
Lab notes
Course lectured by Prof. Gabriel Kuper Lab assist. Ilya Zaihrayeu http://www.dit.unitn.it/~ilya/os.htm
Operating System Operating System: a program that acts as an intermediary between a user of a computer and the computer hardware Q: What are the two main functions of an operating system? A:
Make user work with the hardware convenient Efficient operation of the computer system
Ilya Zaihrayeu Operating Systems Course
Process Management
Q: What are the five major activities of an operating system in regard to process management?
A process is a program in execution. A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task
A:
Creation and deletion of both user and system processes Suspension and resumption of processes Provision of mechanisms for process synchronization Provision of mechanisms for process communication Provision of mechanisms for deadlock handling
Ilya Zaihrayeu
Main-memory Management
Q: What are the three major activities of an operating system in regard to main-memory management?
Memory is a large array of words or bytes, each with its own address. It is a repository of quickly accessible data shared by the CPU and I/O devices. Main memory is a volatile storage device. It loses its contents in the case of system failure
A:
Keep track of which parts of memory are currently being used and by whom Decide which processes to load when memory space becomes available Allocate and deallocate memory space as needed
Ilya Zaihrayeu Operating Systems Course
File Management
Q: What are the five major activities of an operating system in regard to file management?
A file is a collection of related information defined by its creator. Commonly, files represent programs (both source and object forms) and data
A:
File creation and deletion Directory creation and deletion Support of primitives for manipulating files and directories Mapping files onto secondary storage File backup on stable (nonvolatile) storage media
Ilya Zaihrayeu Operating Systems Course
Secondary-storage Management
Q: What are the three major activities of an operating system in regard to secondary-storage management?
Since main memory (primary storage) is volatile and too small to accommodate all data and programs permanently, the computer system must provide secondary storage to back up main memory. Most modern computer systems use disks as the principle on-line storage medium, for both programs and data
A:
Free space management Storage allocation Disk scheduling
Ilya Zaihrayeu Operating Systems Course
Personal Computers vs. Mainframes Q: List some differences between personal computer operating systems and mainframe operating systems
Mainframe is a very large and expensive computer capable of supporting hundreds, or even thousands, of users simultaneously. In the hierarchy that starts with a simple microprocessor (in watches, for example) at the bottom and moves to supercomputers at the top, mainframes are just below supercomputers
Ilya Zaihrayeu Operating Systems Course
10
11
Layered System Design Q: What is the main advantage and disadvantage of the layered approach to system design?
In the levered approach the operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface. With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers
Ilya Zaihrayeu Operating Systems Course
12
13
Ilya Zaihrayeu
14
15
A:
The prime reason for multi-programming is to give the CPU something to do while waiting for I/O to complete. If there is no DMA, the CPU is fully occupied doing I/O, so there is nothing to be gained (at least in terms of CPU utilisation) by multi-programming. No matter how much I/O a program does, the CPU will be 100 percent busy
Ilya Zaihrayeu
16
17
18
19
20
Kernel Mode
Q: Which of the following instructions should be allowed only in
kernel mode? a) Disable all interrupts b) Read the time-of-day clock c) Set the time-of-day clock d) Change the memory map
a)
A:
Yes. If CPU allows user processes to disable all interrupts, chaos will occur. Say one user process disables all interrupts and never re-enables it. No other processes, not even OS itself, can work since there will be no clock interrupt to allow OS to switch from one process to another No. It is not critical enough Yes. Clock is very important and should be allowed to change by only kernel Yes. Memory mapping should be reserved only for the kernel
Ilya Zaihrayeu Operating Systems Course
b) c) d)
21
Client-server Model
Q: The client-server model is popular in distributed systems. Can it also be used in a single-computer system? If it can, then how? Client/server describes the relationship between two computer programs in which one program, the client, makes a service request from another program, the server, which fulfills the request. In a network, the client/server model provides a convenient way to interconnect programs that are distributed efficiently across different locations A: Yes. All that is required is a multiprogramming system; allow one process to be the server and another to be the client
Ilya Zaihrayeu Operating Systems Course
22
References Andrew S. Tanenbaum, Modern Operating Systems Silberschatz Galvin, Operating System Concepts
Ilya Zaihrayeu
23