Computing systems channel 1
Chair (Coordinator) and Rapporteur: LEONARDO QUERZONI
Lecturers
Objectives
The course provides a programmer's view of how computing systems
execute programs, store information, and communicate, addressing
general issues such as performance, portability, and robustness.
Students are introduced to the basic operation principles of modern
computers, showing how compilers map C programs to assembly code and
how programs interact with the operating system to manage computing
resources.
Learning outcomes
The course provides a programmer's view of how computing systems execute programs, store information, and communicate, addressing general issues such as performance, portability, and robustness.
Students are introduced to the basic operation principles of modern computers, showing how compilers map C programs to assembly code and how programs interact with the operating system to manage computing resources.
Knowledge and Understanding
Upon completion of the course, students will understand how computing systems execute programs, store information, and communicate with each other. Furthermore, they will acquire the basics of Assembly programming for 32-bit x86 platforms and understand how this is functional to program execution.
Applying Knowledge and Understanding
Students will be able to apply appropriate system programming techniques to problem-solving. They will also be capable of analyzing program execution and identifying errors and bottlenecks.
Making Judgments
Students will be able to analyze and evaluate programs during execution, verifying their correctness, as well as identifying and correcting potential errors.
Communication Skills
Students will be able to describe and discuss how a program is executed and how it interacts with the operating system, illustrating its operation, properties, and efficiency.
Learning Skills
Students will acquire the methodological tools to identify, analyze, and solve problems related to the operation of programs within complex computing systems.
Prerequisites
Knowledge of the Von Neumann architecture, boolean algebra, two's complement representation, floating-point number representation, C language (array, pointers, operators */&).
Programme
Part I: Architecture, Toolchain, and Assembly Programming (IA32) (30 hours)
This section introduces the low-level operation of the machine and the translation of C code into Assembly language.
- Introduction to computing systems: Von Neumann architecture and overview of the development toolchain (GCC, differences between C, Assembly, and machine code).
- Analysis and debugging tools: Basic and advanced use of GDB, Valgrind, and system utilities (objdump, file).
- Fundamentals of IA32 Assembly: The Instruction Set Architecture (ISA), general-purpose registers, basic instructions (mov, arithmetic-logic), syntax, and endianness.
- Low-level memory management: Addressing modes, stack frame usage (%esp), and management of pointers, arrays, and strings.
- Control flow and functions: Translation of C constructs (if, while, do), call/ret instructions, parameter passing, and ABI rules (caller-save/callee-save registers).
- Complex data structures: Alignment, padding, stack-allocated structures, and an introduction to the 64-bit extension.
Part II: Performance, Processes, and OS Interaction (15 hours)
This phase moves to a higher level of abstraction: studying code optimization and introducing the Operating System as a computing resource manager.
- Performance optimization: Evaluation metrics (Amdahl, Moore) and code profiling (gprof).
- Standard libraries and I/O: Introduction to Operating System design and intensive use of libc functions for memory and file system management (standard I/O).
- Process Abstraction: Memory image, process states, and system calls for process management (fork, wait, exec, getpid).
- Execution and Scheduling: Pipelining, concepts of preemption, time-sharing, and introduction to threads.
- Exceptional control flow: Interrupt handling, system call mechanisms (syscalls with wrappers and INT 0x80), and signal management (kill, sigaction).
Part III: Virtual Memory and File System (15 hours)
The final part is dedicated to advanced memory and storage management by the operating system and processes.
- Dynamic allocation: Mechanisms of malloc and free, fragmentation (internal and external), and evaluating allocator efficiency.
- Virtual and Physical Memory: Address translation via MMU, paging, valid bits, and concepts of locality (spatial/temporal) and thrashing.
- Memory hierarchy: Operation of cache memories for access optimization.
- File System Architecture: Internal structure (inodes and blocks), permissions in octal notation, and system operations (mount, umount, link, readdir).
- Execution environment: Environment variables and passing parameters to main via the env argument.
Books
Notes from the course (available on course website)
Bibliography
R. E. Bryant and D. R. O’Hallaron, "Computer Systems - A Programmer’s Perspective", Prentice Hall, ISBN: 978-0130340740
B. W. Kernighan and D. M. Ritchie, "Il linguaggio C. Principi di programmazione e manuale di riferimento", Pearson, ISBN: 978-8891908230
Lessons mode
The course is delivered in person through traditional lectures, which are necessary to acquire the skills targeted by the course.
All lectures are recorded, and the recordings are made immediately available to students.
The lectures are accompanied by a weekly practical session, designed to allow students to apply the acquired knowledge.
Frequency
Attendance to the course is optional.
Exam mode
The exam consists of a series of multiple-choice questions requiring justifications, as well as programming exercises.
To pass the exam, students must achieve a grade of at least 18/30.
The student must demonstrate having acquired sufficient knowledge of the topics related to the operation of computing systems and how programs are executed. Furthermore, they must demonstrate sufficient understanding of how C programs are translated into Assembly language and how a program interacts with the operating system.
To achieve a score of 30/30 cum laude, the student must demonstrate excellent knowledge of all the topics covered during the course, showing full mastery of the techniques and methodologies studied.
Example exam questions
Which of the following statements is FALSE?
A. Cache memories leverage the principles of spatial and temporal locality to reduce data access times.
B. The principles of spatial and temporal locality often emerge naturally in program code, but in some cases, the programmer can rewrite the code to favor them.
C. The Least Recently Used (LRU) replacement policy involves selecting the cache block that has been accessed the least recently for replacement.
D. In some architectures, there is a dedicated L1 cache for instructions and a separate one for data.
E. The size of a cache line is equal to the size of a virtual memory page.
"Past exam papers are publicly available at the following link.: https://season-lab.github.io/SC/MaterialeDidattico
Sustainability goals
- Academic year2026/2027
- Degree program to which the course belongsComputer and Control Engineering
- Lesson code1056029
- CurriculumAutomatic
- Year and semester2nd year - 2nd semester
- Activity typeAttività formative caratterizzanti
- Academic areaIngegneria informatica
- SSDING-INF/05
- Mandatory presenceNo
- Languageita
- CFU9 CFU
- Total duration90 hours
- Hours distribution54 classroom hours, 18 training hours, 18 laboratory hours