Advanced Operating Systems (9 CFU)
MS Degree in Computer Engineering
Academic Year 2020/2021

Lecturer: Francesco Quaglia


This page is used to post suggested homework which can help better making experience with the course topics. The suggested homework is not mandatory for passing the examination. For each suggested homework a solution will be posted along with the "Software Examples" available via the course main page. Students are encouraged to provide their own solutions before checking with the posted one.


RCU List (RCUL)

This homework deals with the C-based implementation of an RCU (Read Copy Update) list offering the following API:

Atomic memory operations via gcc bult-in API like, e.g., __sync_fetch_and_add(...), can be used as building blocks. Each function should return zero upon success.


Alternative Thread Local Storage (TLS)

This homework deals with the implementation of a TLS support standing aside of the original one offered by gcc. It should be based on a few macros with the following meaning:

Essentially, the homework is tailored to implementing an interface for managing per-thread memory resembling the one offered by the Linux kernel for managing per-CPU memory.


Sys Call Table Discovery (SCTD)

This homework deals with the implementation of a Linux kernel module that discovers at run-time the positioning of the system-call table. The simplifying assumption is that the module programmer can exploit the kernel-side name of some system-call (hence the corresponding actual address) in order to perform the discovery phase. The module should provide the current memory address of the system-call table via a kernel level message accessible via the 'dmesg' shell command.


Harder Sys Call Table Discovery (HSCTD)

This homework deals with the implementation of a Linux kernel module that discovers at run-time the positioning of the system-call table. The assumption is that the module programmer can exploit the compressed executable image of the kernel as exposed in /boot (the script at this link can be used as a facility for decompressing the kernel image). The module should include a function returning the current memory address of the system-call table, also logging it via a kernel level message accessible via the 'dmesg' shell command. The module should also include a function that identifies free entries of the system-call table, to be possibly used for inserting new services into the kernel. Essentially, this homework deals with providing a baseline module for hacking the system-call table which is independent of the kernel version (and should work across, e.g., kernel 3 to 5).


Process Controller (PC)

This homework deals with the implementation of a Linux kernel module that offers a device file which allows updating the content of memory locations in the address space of an arbitrary process. The device file must support a write operation that leads to update the content of some memory location (supposed to be of type long) in the address space of the target process. To be successful, the write operation needs to receive as input-stream a sequence of bytes structured as follows: "PID ADDRESS NEW_VALUE", where PID is the target process identifier, ADDRESS is the memory address where the update needs to be installed and NEW_VALUE is the value to be installed on that memory location.