Operating Systems A - L

Academic Year 2023/2024 - Teacher: Lucia LO BELLO

Expected Learning Outcomes

Knowledge and understanding

Upon completion of the course, the students will have acquired: knowledge of the basic concepts inherent to the design of operating systems; ability to write programs using the system calls in the Linux / UNIX environment; knowledge of the operating system structure, of the relevant project issues and of the policies for resource (CPU, main memory, mass storage, peripherals) virtualization and management; understanding of the process concept, of the thread concept, and knowledge about their management; knowledge of management techniques of mutually exclusive resources.


Applying knowledge and understanding

At the end of the course the students will be able to develop applications using the Linux system calls for the: creation and management of processes; signal handling; interaction and communication between processes; concurrency on shared resources; creation of multithreaded applications. Moreover, the students will be able to apply the acquired knowledge for the selection of both the SW component and Linux APIs suitable for the problem to be solved.


Making judgements.

On completion of the course, the students will be able to choose a suitable operating system for the design problem to deal with. Moreover, an appropriate software solution based on the Linux API for each of the topics covered in the course. This ability is improved through the exercises carried out during the course and with appropriate programming questions assigned at the final exam.


Communication skills.

On completion of the course, the students will have acquired the operating system technical terminology, and therefore they will be able to make recommendations about the design and use of the operating systems and to explain, in a clear and unambiguous way, to both a specialist and a non-specialist audience the rationale behind the design choices made.


Learning skills.

On completion, the students will be able to improve their operating systems knowledge by studying the reference textbooks and specialized journals. The students will also be able to learn the new functionalities and features developed on Linux operating system by consulting the relevant manuals and official documentation.

Course Structure

The course is essentially based on lectures, which include the development of exercises by the teachers. The proposed exercises are addressed by the teachers through the use of computer connected to the projector. The course also includes practical exercises carried out by the students. These exercises are carried out in the University's multimedia rooms. Each student is assigned a task that must be performed on the computer. The teachers supervise the work of the students by providing the explanations and teaching aids necessary to complete the assigned tasks. The methods of carrying out the teaching described above allow the achievement of the pre-established training objectives, which include the acquisition of knowledge and the ability to apply knowledge.

Should teaching be carried out in mixed mode or remotely, it may be necessary to introduce changes with respect to previous statements, in line with the program planned out in the syllabus.


Required Prerequisites

Requirements necessary to successfully reach the course goals:

-    Basic general knowledge of the computer architecture, in particular: CPU, interrupts, registers, memories, multiprocessor architectures, I /0 devices.

-    Programming skills and knowledge of ANSI C language, with particular reference to:

"use of argc and argv parameters in the main() function", 

"use of pointers, vectors and dynamic allocation", 

"use of structures", 

"use of functions and relative use of parameters by value and by reference".

-    Knowledge of the main data structures: lists, stacks, queues, hash tables, and their implementation in ANSI C language.

Attendance of Lessons

Attendance is not mandatory, but it is strongly recommended.

Detailed Course Content

Asterisks (*) indicate the minimum skills.

Operating Systems Introduction (*)

Operating systems concepts. Kernel. (*)

History and classification of operating systems. GNU/Linux.

Operating systems structures: monolythic, microkernel, hybrid, client/server. (*)

The POSIX standard. (*)

System calls. (*)

Operating systems structure.  (*)

Multiprocessor OS structure.

Virtualization. Virtual machines.  Hypervisors: level 1 and 2.  (*)

Linux shell commands.         (*)

Shell programming (brief hints).

Processes, Threads. (*)

Signals and signal handling.(*)

Thread implementation. POSIX threads. The pthread.h library. (*)

Scheduling. (*)

Real-time systems scheduling. (brief hints) (*)

Linux scheduling. Completely Fair Scheduler. (brief hints)

Concurrency. Critical regions. Race conditions. Mutual exclusion. Busy waiting. Semaphores and Mutexes. Program examples. (*)

Interprocess Communications. Message queues, Shared memory. Classical IPC problems. Program examples. (*)

File Systems. File. Directories.  (*)

Client/server model. Sockets. (*)

Deadlocks. Characterization, detection, prevention, avoidance. (*)

Case Studies

Linux (*)

Textbook Information

1) Theory:

Andrew S. Tanenbaum, H. Bos, “Modern operating systems 5/Ed.", 2023, Pearson, ISBN 9788891931955.

(Alternative option for theory: Abraham Silberschatz, Peter Baer Galvin, Greg Gagne, “Sistemi Operativi, Concetti e esempi”, 10th Edition, Pearson, ISBN 9788891904553), 2019.

2) Programming part:

R. Stones, N. Matthew, “Beginning Linux Programming”, 4th edition, Wrox Press, Wiley Publishing, Inc. 2007. Available online.


AuthorTitlePublisherYearISBN
Andrew S. Tanenbaum, H. BosI moderni sistemi operativi 5/Ed.Pearson20199788891931955
R. Stones, N. MatthewBeginning Linux Programming, 4th editionWrox Press, Wiley Publishing, Inc.2007978-0-470-14762-7

Course Planning

 SubjectsText References
1UNIT 1: INTRODUCTION TO OPERATING SYSTEMS. GNU/LINUX. SYSTEM CALLS. VIRTUALISATION. Operating system concepts. Resource management. User interface. Kernel concept. GNU/Linux. Operating system structure: monolithic, microkernel, hybrid, client/server. System call concept. POSIX System calls.Tanenbaum: Chapt.1. 
(Silbershatz: Chapt.1, 2.)
Lecture notes on STUDIUM, in the course area.
2UNIT 1: INTRODUCTION TO OPERATING SYSTEMS.GNU/LINUX. SYSTEM CALLS. VIRTUALISATION. Free Software and relevant licenses. GPL.Lecture notes on STUDIUM, in the course area.
3UNIT 1: INTRODUCTION TO OPERATING SYSTEMS.GNU/LINUX. SYSTEM CALLS. VIRTUALISATION. Brief notes on UNIX and the POSIX standard.Lecture notes on STUDIUM, in the course area.
4UNIT 1: INTRODUCTION TO OPERATING SYSTEMS.GNU/LINUX. SYSTEM CALLS. VIRTUALISATION. Operating system overview. OSs for multiprocessor architectures. Virtualization. Virtual machines. Level-1 and level-2 hypervisors. Container engine concept.Tanenbaum: Chapt.1, Chapt.8.1.2.
(Silbershatz: Chapt. 2, 16.)
Lecture notes on STUDIUM, in the course area.
5UNIT 2: PROCESSES AND THREADS.  Process concept. Process states. Context switch. HW and SW Interrupts and their management. Process management system call: fork(), exit(), wait(), waitpid(). The exec() function family. Tanenbaum: Chapt.2.1. 
(Silbershatz: Cap.3.)
Beginning Linux Programming: Chapt.11. 
Lecture notes on STUDIUM, in the course area.
6UNIT 2: PROCESSES AND THREADS. Signals and their management. Functions: kill(), signal(), alarm(), sigaction(), pause(). Beginning Linux Programming: Chapt.11. 
Lecture notes on STUDIUM, in the course area.
7UNIT 2: PROCESSES AND THREADS. Thread concept. Thread characteristics. Thread Implementation: user space, kernel space, hybrid (with reference to the main OSs' design choices).Tanenbaum: Chapt. 2.2. 
(Silbershatz: Chapt.4.) 
Beginning Linux Programming: Chapt.12. 
Lecture notes on STUDIUM, in the course area.
8UNIT 2: PROCESSES AND THREADS. The  Pthread library. Functions:pthread_create(), pthread_join(), pthread_exit(), pthread_detach(), pthread_attr_init(). Thread cancellation. Pthread-based program examples.Tanenbaum: Chapt. 2.2.  (Silbershatz: Chap.4.)  Beginning Linux Programming: Chapt.12.  Lecture notes on STUDIUM, in the course area.
9UNIT 2: PROCESSES AND THREADS. Linux. Shell commands. Lecture notes on STUDIUM, in the course area.
10UNIT 3: CONCURRENCY, SYNCHRONIZATION, INTER PROCESS COMMUNICATION, DEADLOCK.  Critical section. Mutual exclusion with busy waiting. Semaphores. The Producer-consumer problem (bounded buffer) and the relevant semaphore-based solution. Mutexes. pthread_mutex functions.Tanenbaum: Chapt.2.3. 
(Silbershatz: Chapt.3, Chapt.5.) 
Beginning Linux Programming: Chapt. 12 (mutexes). 
Lecture notes on STUDIUM, in the course area.
11UNIT 3: CONCURRENCY, SYNCHRONIZATION, INTER PROCESS COMMUNICATION, DEADLOCK. Linux IPC. Semaphores. Functions: semget(), semop(), semctl(). Message queues. Functions: msgget(), msgsnd(), msgrcv(), msgctl(). Shared memory. Functions: shmget(), shmat(), shmdt(), shmctl(). Program examples.Beginning Linux Programming: Chapt. 14. 
Lecture notes on STUDIUM, in the course area.
12UNIT 3: CONCURRENCY MANAGEMENT, SYNCHRONIZATION, INTER PROCESS COMMUNICATION, DEADLOCK.Deadlock. Problem definition and management strategies. Tanenbaum: Chapt.6. 
(Silbershatz: Chapt.7.)
Lecture notes on STUDIUM, in the course area.
13UNIT 4: FILE SYSTEM. File System and System calls relevant to file management. Tanenbaum, Chapt.4. 
(Silbershatz, Chap.8, Chapt. 11, 13.)
Lecture notes on STUDIUM, in the course area.
14UNIT 5: CLIENT-SERVER COMMUNICATIONS. Socket concept. Stream sockets. Datagram sockets.Beginning Linux Programming: Chapt. 15. 
Lecture notes on STUDIUM, in the course area.
15UNIT 6 CPU SCHEDULING. CPU scheduling. Aims. Classical algorithms: FIFO, Round-robin, Priority-based scheduling.  Starvation. Multiple queues.  Tanenbaum: Chapt.2.4.  (Silbershatz: Chapt.6, Chapt.7.) Lecture notes on STUDIUM, in the course area.
16UNIT 6: CPU SCHEDULING. Notes on scheduling in  real-time systems. Linux scheduling overview: The Completely Fair Scheduler.Lecture notes on STUDIUM, in the course area.

Learning Assessment

Learning Assessment Procedures

LEARNING ASSESSMENT PROCEDURES
The exams are fixed in agreement with the CdS in compliance with the procedures established by the academic calendar.
Reservations are required through the University portal. The closing date for reservations is usually fixed a few days before the exam, in order to allow the teacher to book the computer rooms of adequate capacity for the number of registered students.
The exam consists of a written test and an oral test.
The written test is made up by two sections. One section is relevant to the development of one or more programs in C language using the system calls studied in the course; for this reason, it requires the use of a computer made available to the students by the university. The other section consists of one or more theoretical open-ended questions. The section relevant to the C language program development allows to achieve a total mark of 18/30 points; the theoretical section allows to achieve a total mark of 12 /30 points. The written test, 3 hours long, is passed if the sum of the two marks is greater than or equal to 18/30. On the corse website available on Studium (www.studium.it) a template of the written test that specifies both the types of sections and the relative marks is available.
The oral test is optional and can only be held in the same session in which the written test was passed. The oral exam focuses on the theoretical topics addressed in the classes.
The assessment can also be carried out on-line, should the conditions require it.

Examples of frequently asked questions and / or exercises

System call for process and signal management.

Difference between thread and process.

Thread implementations.

Pthread library.

Mutual exclusion and relevant solutions.

InterProcess Communication mechanisms.

VERSIONE IN ITALIANO