Operating Systems (2020/2021)

Course code
Graziano Pravadelli
Academic sector
Language of instruction
Teaching is organised as follows:
Activity Credits Period Academic staff Timetable
Teoria 10 II semestre, I semestre Florenc Demrozi, Graziano Pravadelli

Go to lesson schedule

Laboratorio [Laboratorio 1] 2 II semestre, I semestre Florenc Demrozi

Go to lesson schedule

Laboratorio [Laboratorio 2] 2 II semestre, I semestre Alberto Castellini

Go to lesson schedule

Learning outcomes

The course aims to provide an introduction to the principles and design of operating systems, with particular regard to the concepts related to the software architectures of an operating system, the management and synchronization of processes and the management of the resources of the system. At the end of the course, the student will have acquired knowledge and skills related to the internal organization, operation and services of an operating system. In particular, the student will have learned: - the main functionalities of an operating system with respect to users and application programs; - the strategies adopted by an operating system to manage the resources of a computer; - the techniques used to implement the different components of an operating system. Furthermore, the student will be able to apply the acquired knowledge and will have adequate comprehension skills for: - develop programs with the awareness of how the operating system manages the resulting processes; - develop applications that use the primitives (system calls) provided by the operating system; - develop and modify components of an operating system. Finally, the student will be able to: - autonomously evaluate the advantages and disadvantages of different design choices within the services offered by an operating system; - carry out a laboratory project and present the relative results motivating the choices with language appropriateness; - develop the necessary skills to continue the study related to operating systems, addressing advanced issues related to the scenarios of distributed, real time and embedded systems.


* Introduction: Evolution and role of the operating system. Architectural concepts. Organization and functionality of an operating system.

* Process Management: Processes. Process status. Context switch. Process creation and termination. Thread. User-level threads and kernel-level threads. Process cooperation and communication: shared memory, messagges. Direct and indirect communication.

* Scheduling: CPU and I/O burst model. Long term, short term and medium term scheduling. Preemption. Scheduling criteria. Scheduling algorithm: FCFS, SJF, priority-based, RR, HRRN, multiple queues with and without feedback. Algorithm evaluation: deterministic and probabilistic models, simulation.

* Process synchronization: data coherency, atomic operations. Critical sections. SW approaches for mutual exclusion: Peterson and Dekker's algorithms, baker's algorithm. HW for mutual exclusion: test and set, swap. Synchronization constructs: semaphores, mutex, monitor.

* Deadlock: Deadlock conditions. Resource allocation graph. Deadlock prevention. Deadlock avoidance. Banker's algorithm. Deadlock detection e recovery.

* Memory management: Main memory. Logical and physical addressing. Relocation, address binding. Swapping. Memory allocation. Internal and external fragmentation. Paging. HW for paging: TLB. Page table. Multi-level paging. Segmentation. Segment table. Segmentation with paging.

* Virtual memory: Paging on demand. Page fault management. Page substitution algorithms: FIFO, optimal, LRU, LRU approximations. Page buffering. Frame allocation: local and global allocation. Thrashing. Working set model. Page fault frequency.

* Secondary memory. Logical and physical structure of disks. Latency time. Disk scheduling algorithms: FCFS, SSTF, SCAN, C-SCAN, LOOK, C-LOOK. RAID.

*File System: file, attributes and related operation. File types. Sequential and direct access. Directory structure. Access permissions and modes. Consistency semantics. File system structure. File system mounting. Allocation techniques: adjacent, linked, indexed. Free space management: bit vector, lists. Directory implementation: linear list, hash table.

* I/O subsystem: I/O Hardware. I/O techniques: programmed I/O, interrupt, DMA. Device driver and application interface. I/O kernel services: scheduling, buffering, caching, spooling.

- System calls for management of the file system
- System calls for management of processes
- System calls for management of signals and pipes
- System calls for management of fifo and message queues
- System calls for management of semaphores and shared memory
- Scheduling and memory management in MentOS

Assessment methods and criteria

The exam is composed of two parts: theory and laboratory.
To pass the exam, the student must show
- they have understood the principles related to how an operating system works
- they are able to describe the concepts in a clear and exhaustive way without digressions
- they are able to apply the acquired knowledge to solve application scenarios described by means of exercises, questions and projects.

The final exam consists of a written test containing questions and exercises. In case of restrictions due to the Coronavirus, there could be changes in the exam modality.

The final exam consists in developing and delivering a laboratory project according to the specifications provided by the professors. The project will then be discussed in an oral exam. In case of restrictions due to Coronavirus, the examination modalities could change.

Total grade
The total grade (thery+laboratory) is given by:
theory_grade*0.5 + laboratory_grade*0.5.