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

Lecturer: Francesco Quaglia


The examination requires fulfilling the development of a project in the Linux kernel, which must comply with the following specification. Each student should develop the project individually.

Timed messaging system

This specification is related to the implementation of a device file that allows exchanging messages across threads. Messages can be posted to the device file using common write() operations and can be acquired using common read() operations offered by the VFS API. To gain the possibility to read()/write() messages, threads must have access to a valid I/O session towards the device file. Each message posted to the device file is an independent data unit (a mail-slot message in the WinAPI analogy) and each read operation can extract the content of a single message (if present). Messages that are already stored in the device file must be delivered to readers in FIFO order. The message receipt fully invalidates the content of the message to be delivered to the user land buffer (so the message logically disappears from the device file, and is not re-deliverable), even if the read() operation requests less bytes than the current size of the message to be delivered. In addition, both write() and read() operations can be controlled by relying it the ioctl() interface, which must support a set of commands for defining the actual operating mode of read() and write() in an I/O session. In more detail, ioctl() can be used to post these commands:

By default, a newly opened session has both the previous timeouts set to the value zero.

Also, the file operation flush() must be supported in order to reset the state of the device file, meaning that all threads waiting for messages (along any session) must be unblocked and all the delayed messages not yet delivered (along any session) must be revoked.

The driver of the device file must therefore support at least the following set of file operations:

Concurrent I/O sessions on the device file must be supported. Also, the device file can be multi-instance (so its driver must be able to handle different minor numbers, associated with the different instances, to be configured at compile time).

Finally, the device file handling software must expose via the /sys file system the following set of reconfigurable parameters:


Project delivery

Projects can be delivered (for analysis and discussion) at any scheduled tutoring slot