This course is held at the second semester of the first year of the Master of Computer Engineering, and it is organized in two parts.
The first part introduces the architecture and the design principles of an operating system. More specifically, it deals with internal operating system modules, together with the main techniques and strategies for efficient management of resources such as processors, memories, peripheral devices, files, etc.
The second part describes programming interfaces for system programming and resource management, as well as concurrent programming. It introduces system programming techniques, within the framework of state-of-the-art operating systems, such as Unix/Linux and Windows. Advances concurrend programming techniques are introduced and used.
This second-semester, first-year Master of Computer Engineering course is organized into two main sections:
Operating System Architecture and Design: This section introduces the internal structure and core principles of operating systems. It focuses on techniques and strategies for the efficient management of computer resources (processors, memory, peripherals, files, etc.).
Modern System and Parallel Programming (C++): This section explores system programming, device (GPU) programming, and parallel programming concepts. Practical application will be in C++ on contemporary operating systems like Unix/Linux, Windows, and macOS.
Part I
• Knowledge of the operating systems architecture as a collection of resource managers
• Knowledge of operating system kernel modules, and new module implementation skills
• Skill to use system calls for creation, synchronization and termination of processes and threads
• Knowledge of virtual memory mechanisms
• Skill to understand and implement virtual memory management algorithms
• Knowledge of peripheral device management techniques
• Skill to understand and implement device drivers
Part II
• Knowledge of modern file system organizations and skill to manage file systems and file locking
• Knowledge of system programming APIs (system calls)
• Skill to understand and implement programs based on system calls
• Skill to understand and implement programs with advanced file system interactions, such as sequential, random and/or shared file access, and directory manipulation
• Skill to understand and implement reliable/robust programs exploiting exception and signal handling
• Skill to understand and implement programs with advanced memory management tachniques, such as dynamic allocation, memory mapping of files, dynamic libraries
• Skill to understand and implement concurrent programs based on processes/threads
• Skill to understand and implement concurrent programs exploiging
• Advanced synchronization, message passing, and data sharing techniques
Part I
• Knowledge of the architecture of the operating system as a collection of resource managers.
• Knowledge of operating system kernel modules and new module implementation skills.
• Skill to use system calls for creation, synchronization, and termination of processes and threads.
• Knowledge of virtual memory mechanisms.
• Skill in understanding and implementing virtual memory management algorithms.
• Knowledge of peripheral device management techniques.
• Skill in understanding and implementing device drivers.
Part II
Upon successful completion of Part II, students will be able to:
• Apply knowledge of C, C++, POSIX, and C++/CUDA standards to:
o Analyze modern file system organizations.
o Implement effective file system management, including file locking, file mapping, and multiplexing input/output.
o Utilize system programming APIs (system calls) for robust application development.
• Develop and implement programs demonstrating advanced proficiency in:
o File system interactions: Implement sequential and random ASCII, UNICODE, and binary file access patterns.
o Memory management: Employ advanced techniques such as dynamic allocation, smart pointers, and RAII techinques (resource acquisition is initialization).
o Concurrency: Design and implement parallel solutions using processes and threads.
o Manage advanced inter-thread (and inter-process) communication.
o Usingì basics and advanced synchronization techniques.
• Knowledge of a computer system architecture, with a specific emphasys on the structure of the CPU and memory subsystem
• Knowledge of the interrupt mechanism and basics of an assembly language
• Knowledge of the foundations of data structures and algorithms
• Good programming skill in C language
• Knowledge of base concurrent programming techniques.
• Knowledge of a computer system architecture, with a specific emphasis on:
o The structure of the CPU and the memory subsystem.
o The interrupt mechanism and basics of an assembly language.
• Basics on operating systems architectures, that is :
o Main functionalities of a modern operating system.
o Knowledge of UNIX-like operating systems (structure and tools, i.e., shell, main programming instruments, etc.).
• Foundations of data structures and algorithms:
o Good programming skills in C language, including dynamic memory allocation and advanced data structures (e.g., dynamic 1D and 2D arrays, lists, trees, hash-tables, heaps, priority queues, and graphs).
o Concurrent programming techniques (e.g., processes, threads, synchronization, semaphores).
Part I
• Review of operating system architecture (3.0 hours)
o Modules for the management of the resources of a computer system
o Process and thread management synchronization (recalls)
• Memory management (10.0 hours)
o Physical and logical address spaces, MMU, TLB
o Paging
o Virtual memory and demand paging
• Peripheral Device management (3.0 hours)
o Drivers and IO device management
o Disk management
• File system management (6.0 hours)
o File system organization and protection
o Management an operations on files and directories
• Teaching operating system OS161 (10.0 hours)
o System level architecture, source files, compilation, execution, debug
o Implementation of simple system calls for standard I/O
o Thread and user process management
o Implementation of synchronization primitives
o Implementation of simple support for file I/O
• Laboratory practice on all previous topics (18.0 hours).
Part II
• Review of basic system and concurrent programming (6.0 hours)
o Processes
o Threads
o Concurrent programming and synchronization in POSIX
• Introduction to concurrent programming in C11 (2.0 hours)
• Introduction to the Windows API (6.0 hours)
• Introduction to the C++ language (10.0 hours)
o Classes, inheritance and polymorphism
o Exception handling and runtime support
o Generic programming
o Concurrent programming
• Win32 and Linux system programming and concurrent programming (4.0 hours)
o File and directory management
o Process and thread management
o Synchronization
o Exception and signal handling
o Memory management
o Synchronous and asynchronous I/O
o Inter-process communication
• Examples of Windows and Linux application development (4.0 hours)
o General principles
o Reactive programming
• Laboratory practice on all previous topics (18.0 hours).
Part I (44 hours)
• Review of operating system architecture (3.0 hours):
o Modules for the management of the resources of a computer system.
o Process and thread management synchronization (recalls).
• Memory Management (10.5 hours):
o Physical and logical address spaces, MMU, TLB.
o Paging.
o Virtual memory and demand paging.
• Peripheral Device Management (2.0 hours):
o Drivers and IO device management.
o Disk management.
• File system management (6.0 hours):
o File system organization and protection.
o Management and operations on files and directories.
• Teaching operating system OS161 (10.5 hours):
o System-level architecture, source files, compilation, execution, and debugging.
o Implementation of the system calls for standard I/O.
o Thread and user process management.
o Implementation of synchronization primitives.
o Implementation of support for file I/O.
• Laboratory practice on all previous topics (12.0 hours).
Part II (56 hours)
• Course introduction with an overview of the pre-requisites, the program, and the examination rules (1.5 hours)
• Introduction to the C++ language (6.0 hours):
o Language basics.
o Functions.
o Classes, inheritance, and polymorphism.
o Simple examples and exercises in C++.
• The C++ standard library (10.5 hours):
o IO.
o Sequential containers.
o Associative containers.
o Generic programming.
o Dynamic memory management.
o Copy control.
o Templates.
o Problem-solving and applications in C++.
• Parallel programming in C++ (7.5 hours):
o Multithreading.
o Basics synchronization paradigm: semaphores and mutexes.
o Advanced synchronization paradigm: condition variables, barriers, thread throttles, thread pools, C++ tasks with futures and promises.
o Parallel problem-solving and applications in C++.
Advanced System Programming Techniques in POSIX (3.0 hours):
o File locking.
o Multiplexing IO.
o Memory mapping.
• GPU (Graphic Processing Units) for GPGPU Programming (General Programming in GPUs) (8.0 hours)
o Theory of concurrency and parallelization
o GPU (versus CPU) architectures.
o Basics in NVIDIA CUDA Programming.
o Memory models in CUDA.
o Synchnoization in CUDA.
o Efficiency and restriction in CUDA.
o Parallel problem-solving and applications in NVIDIA CUDA.
• Review, exam-based exercise, and Q/A session (3.0 hours).
• Laboratory practice on all previous topics (16.5 hours).
The class can be divided into theory lectures, practice lessons and laboratories. There is no formal distinction between theory and practice as almost all course topics involve theory and practice aspects developed during the classroom lessons by the teacher.
Laboratories (36 hours overall) allow students to solve typical concurrent problems, to be introduced to system, kernel and module programming, and applying all theory and practice aspects analyzed during the classroom lessons.
The course also include an optional project, done by working groups, on advanced topics from either of the two parts of the course
Laboratories and projects of the part I include
• Customizing and installing the OS161 (Unix-like teaching operating system) kernel
• OS booting
• Writing a system call
• OS support for process and thread management
• Synchronization primitives
• Creating and terminating a user process
• Support for file system management and structure of a device driver
Laboratories and projects of the part II include
• System calls for file system interface, file and directory management
• Concurrent programming based on thread and processes
• Synchronization primitives and concurrent programming templates
• Programs with exception and/or signal handling
• Programs with advanced dynamic memory management, memory mapping of files, dynamic libraries, inter-process communication.
The course includes theory lectures, practice lessons, and laboratories.
There is no formal distinction between theory and practice, as almost all course topics involve theory and practice aspects developed during classroom lessons by the teacher.
Laboratories (almost 30 hours overall) allow students to solve typical concurrent problems and be introduced to the system, the kernel, and modular programming. Moreover, they stress all the theoretical and practical aspects analyzed during the classroom lessons.
The course also includes an optional project, done by working groups, on advanced topics from either of the two parts of the course.
Laboratories and projects of Part I include:
• Customizing and installing the OS161 (Unix-like teaching operating system) kernel.
• OS booting.
• Writing a system call.
• OS support for process and thread management.
• Synchronization primitives.
• Creating and terminating a user process.
• Support for file system management and the structure of a device driver.
Laboratories and projects of Part II include:
• Review on C programming and the programming API.
• Basic problem solving in C++: Files and sequential containers.
• Programming in C++: Templates and associative containers.
• Advanced features in C++: Lambda expressions, copy control, parallel problem solving.
• Parallel programming in C++ with threads, tasks, and synchronization primitives.
• Basics of NVIDIA CUDA parallel programming.
Handouts and slides used during the classroom lessons are available on the teacher or course WEB site. The World Wide Web is also an excellent source of material for almost all topics introduced in the class (see Wikipedia, for example). Among the printed material, during the class, we make explicit usage of the following books:
• J. M. Hart, "Windows System Programming", Addison-Wesley Publishing Company
• A. Silberschatz, P. B. Galvin, G. Gagne, "Operating System Concepts", John Wiley & son
• W. R. Stevens, "Advanced programming in the UNIX Environment", Addison-Wesley
Handouts and slides used during classroom lessons are available on the teacher's or course website.
The World Wide Web is also an excellent source of material for almost all topics introduced in the class (see Wikipedia, for example).
Among the printed material, during the course, we make explicit usage of the following books:
• A. Silberschatz, P. B. Galvin, G. Gagne, "Operating System Concepts", John Wiley & son.
• W. R. Stevens, S. A. Rago, "Advanced Programming in the UNIX Environment", Addison-Wesley.
• S. B. Lippman, J. Lajoie, B. E. Moo, "C++ Primer", Addison Wesley, Fifth Edition.
• J. Flux, "Mastering CUDA Programming with C++: A Comprehensive Introduction", Independently published
Slides; Dispense; Libro di testo; Libro di esercitazione; Esercizi; Esercizi risolti; Esercitazioni di laboratorio; Esercitazioni di laboratorio risolte; Video lezioni dell’anno corrente; Video lezioni tratte da anni precedenti; Strumenti di auto-valutazione;
Lecture slides; Lecture notes; Text book; Practice book; Exercises; Exercise with solutions ; Lab exercises; Lab exercises with solutions; Video lectures (current year); Video lectures (previous years); Self-assessment tools;
Modalità di esame: Test informatizzato in laboratorio; Elaborato progettuale in gruppo;
Exam: Computer lab-based test; Group project;
...
The exam consists of a written test and an optional group project. The course does not include any oral examination, but the optional group project will be openly presented by the students belonging to the same group during one of the examination sessions. The target of the written test is to check the acquire theoretical knowledge in the area and to verify the ability of the candidate to solve medium-size problems in the operating system and device programming area (such as device management, system resource management, concurrent programming, etc.). The target of the project is to force the student to work and to coordinate his/her effort with his/her peers, and to face more complex and complete problems in the same area.
The Written Test
The written test includes questions and exercises on both theoretical and practical aspects of the entire course. Theoretical questions may include open and closed puzzles. These are formulated to test the candidate’s knowledge on all topics presented during the course and his/her ability to solve problems related to theoretical aspects. Practical questions and exercises test the ability of the candidate to solve system, device and concurrency problems writing programs in different environments and programming languages (UNIX/Linux, Windows, C, C++, etc.).
The written test is divided into two sessions following the previously described parts of the course. Both parts may include theoretical and practical aspect, involving respectively:
• Operating system internal topics
• System, device and concurrent programming aspects.
Both parts amount up to 13 points on the final evaluation mark. Each part has a passing threshold of 7 points. Thus, to pass the exam, a pass grade (larger or equal than 7) is required on both parts. The final mark is the sum of the two evaluations. As a consequence, the maximum grade that can be reached with the written test is equal to 13+13=26 out of 30. The exam is considered as passed only if the written mark is larger or equal to 18.
The time allowed for each written part may vary from 60 to 120 minutes, depending on the examination text. No books, notes, portable devices, or other material is allowed during the written text.
The two written parts can be taken during different examination sessions, but these sessions must be placed within a period corresponding to one academic year (e.g., if one take the first written text in September the second one must be taken at most in the summer session, i.e., June/July of the next year).
It is possible to reject a written mark only when the mark is delivered or when it is coupled with a previous mark. In other words, as soon as both parts have been passed, and their sum is larger or equal to 18, the written marks are considered as final, i.e., they can be improved only with the mark eventually obtained with the project. Moreover, any final mark will be registered as soon as possible, i.e., as soon as the mark of the project (if the project has been taken by the student) will be available.
On the contrary, when the validity of one written part expires, it will be automatically lost. In this case the candidate will have to retake the corresponding written test.
The Optional Project
An optional project, on either one of the two course parts, may be taken to improve the candidate’s knowledge on the course’s topics and eventually amend the final mark. Anyway, the exam is considered as “passed” only if the written test is passed.
Projects are specified yearly before then end of May, and must be selected by all students who want to apply for it before the end of June. Projects are usually taken by group of candidates (from 2 to 4).
To balance the teachers’ load during each academic year, there is a limit on the number of projects that are delivered on each one of the course parts. Project will be assigned to group of students on a first-come-first-served basis.
It must be noticed that each candidate is entitle to take a project at most once in his/her studying career at Politecnico, either during the first year he/she is enrolled in the course or in one of the following year.
The project mark will follow a short presentation given by the group of candidates. The purpose of this presentation is to present the main algorithmic flow, the main criteria and ideas used to solve the problem. To enroll for a project presentation the group of student must upload the entire project kit on the portal web page (at the “Materiale” session) before the written test date of that examination session. This has to be done within the same academic year the project has been offered and more specifically in one of the 4 examination sessions following each course. The beginning of the course of the following academic year will automatically erase all pending projects (i.e., projects without a final mark). Once that the final mark for a project has been obtained there is no time limit to its validity.
Each project can add from -2.0 to +6.0 marks to the final written evaluation. Marks can be different for different students within the same group, depending on the effort they put into the project and on the final presentation delivered.
The maximum mark which can be obtained with both the written test and the group project amount to 26+6 = 32 out of 30. Marks equal to 31 or 32 will be automatically converted into 30 with honor.
Gli studenti e le studentesse con disabilità o con Disturbi Specifici di Apprendimento (DSA), oltre alla segnalazione tramite procedura informatizzata, sono invitati a comunicare anche direttamente al/la docente titolare dell'insegnamento, con un preavviso non inferiore ad una settimana dall'avvio della sessione d'esame, gli strumenti compensativi concordati con l'Unità Special Needs, al fine di permettere al/la docente la declinazione più idonea in riferimento alla specifica tipologia di esame.
Exam: Computer lab-based test; Group project;
General Exam Information & Logistics
The course examination is a computer-based written test administered via the university's "Esami" platform. No oral examination component is included in this course. Exams are conducted on-site in a designated classroom. Students are required to bring their own laptops and verify their hardware and software features before the exam. Instructors will be present during the examination to provide necessary assistance and supervision.
Student Responsibilities & Academic Integrity
Students are required to familiarize themselves with and adhere to all University regulations pertaining to examinations. It is each student's responsibility to ensure they have the necessary hardware and software tools for the exam. Any infrastructural issues encountered during the exam must be promptly communicated to the instructors. All students must respect the ethical code defined by the University. In cases where irregularities are detected, the professors reserve the right to conduct an additional oral verification covering all course topics with the student(s) involved.
Examination Paths
Students may take the examination via one of two formats: Standard or Simplified. The "Standard" Examination Format consists of a written test and an optional group project. The "Simplified" Examination Format includes only the written test.
The Written Test (Standard Format).
• Objective: To assess acquired theoretical knowledge and the ability to solve medium-complexity problems in operating systems and device programming (e.g., device management, system resource management, concurrent programming).
• Content: Includes questions and exercises covering all theoretical and practical aspects of the course. Theoretical questions test knowledge of topics presented and problem-solving related to theoretical aspects. Practical questions and exercises assess the ability to solve system, device, and concurrency problems by writing programs in environments like UNIX/Linux (using C, C++, etc.).
• Structure: The written test is divided into two parts, corresponding to the two main sections of the course: Operating system internal topics and system, device, and concurrent programming aspects. Both parts may include theoretical and practical questions.
• Question Types: Includes closed-answer (automatically corrected) and open-answer (manually graded) questions and exercises. Accuracy and strict adherence to specified formats are required for automatically corrected questions. Incorrect responses to automatically corrected questions will incur a penalty on the final score.
• Scoring & Passing. Each of the two parts contributes a maximum of 15 points to the final written test score. A minimum score of 7 points is required on each part to pass that part. To pass the written test, a passing grade (larger than or equal to 7) is required on both parts, and the sum of the two evaluations must be larger than or equal to 18. The maximum score for the written test is 30 points (15+15).
• Duration: The time allowed for each written part may vary from 60 to 120 minutes, depending on the specific exam content.
• Permitted Materials: No books, notes, portable devices, or other external materials are allowed during the written test.
• The two written parts can be taken during different examination sessions. However, both parts must be successfully completed within one academic year (e.g., if the first part is taken in September, the second must be passed by the June/July session of the following year). A student may reject a score for a written part only at the time it is delivered or when it is being combined with a previously passed part's score. Once both parts have been passed and their sum is ≥18, the combined written test score is considered final (modifiable only by the optional project score). Final marks (including any project adjustments) will be registered as soon as the project mark (if applicable) is available. If the validity period for a passed written part expires (i.e., the other part is not passed within the academic year), its score is voided, and that part must be retaken.
Optional Group Project (Standard Format).
• Purpose: Allows students to deepen their understanding of course topics, work collaboratively, tackle more complex problems, and potentially improve their final grade.
• Prerequisite: The overall exam is considered "passed" only if the written test (both parts) is passed, regardless of project participation.
• Project specifications are released annually before the end of May. Students wishing to undertake a project must select one before the end of June. Projects are typically undertaken by groups of 2 or 3 candidates. Project assignment is on a first-come, first-served basis. Some projects may have limited applicant slots, and there's a limit on projects per course part to balance teacher workload. Each student may undertake a project at most once during their academic career at Politecnico for this course, either during their initial enrollment year or a subsequent year. Groups will give a short presentation on their project, outlining the main algorithmic flow, criteria, and problem-solving ideas. To register for a presentation, the complete project kit must be uploaded to the course portal (under "Materiale") before the written test date of that examination session. Submission and presentation must occur within the same academic year the project was offered, specifically in one of the four examination sessions following that course offering. Pending projects (not submitted and graded) expire at the start of the next academic year. Once a final mark for a project is obtained, it has no expiration date. The project can adjust the final written evaluation by -2.0 to +6.0 points. Individual marks within a group may vary based on individual effort and presentation quality.
Final Grading (Standard Format)
* The maximum possible score, combining the written test (max 30) and the group project (max +6), is 36 points.
* Final scores of 32 or higher (out of a possible 36) will be automatically recorded as "30 with honors".
The "Simplified" Examination Format.
This path is available for students who may benefit from an alternative assessment structure (e.g., those with reduced initial prerequisites, specific needs, or who encountered particular difficulties during the course). It involves a single written test resulting in a "pass" or "fail" outcome. A "pass" in this format corresponds to a final registered grade of 18/30.
The test is divided into two parts (corresponding to the course's two main sections) and covers theoretical and practical aspects of the entire course. Compared to the standard exam, this test places more emphasis on theoretical understanding and is less demanding regarding complex problem-solving and C/C++ implementation tasks. It includes 5 to 15 questions on each part.
Each part includes closed-answer (automatically corrected) and open-answer (manually graded) questions and exercises.
Accuracy and strict adherence to specified formats are required for automatically corrected questions. Incorrect responses to automatically corrected questions will incur a penalty. The student passes the simplified exam if and only if they achieve a passing grade on both internal parts of this single test.
In addition to the message sent by the online system, students with disabilities or Specific Learning Disorders (SLD) are invited to directly inform the professor in charge of the course about the special arrangements for the exam that have been agreed with the Special Needs Unit. The professor has to be informed at least one week before the beginning of the examination session in order to provide students with the most suitable arrangements for each specific type of exam.