OS
Operating
Systems
and
Real
Time
Operating
Systems

Exams

The exam focuses on the understanding of the course, and on practical issues (e.g., programming with POSIX). The analysis of technical papers / articles on Operating Systems is also quite common.

Various information

  • Date: To be defined.

  • Duration: 1 hour

  • Authorized documents: Closed books and notes, except one A4 sheet (two pages) with handwritten notes.

  • Language: Quiz exams are in English, and no text is to be entered.

Past exams

  • Fall 2022: Exam [Quiz with solutions covering most aspects of OS, including scheduling syscalls, memory management, threading, I/O and RTOS]

  • Fall 2021: Exam [Quiz covering most aspects of OS, including scheduling syscalls, memory management, threading, I/O and RTOS]

  • Fall 2020: Exam [Quiz covering most aspects of OS, including scheduling, memory management, RTOS and synchronization]

  • Fall 2019: Exam, Solutions [threads, page fault, deadlocks, Linux scheduler (load balancing)]

  • Fall 2018: Exam, Solutions [syscalls, condition variables, RTOS, Xenomai, RT tasks]

  • Fall 2017: Exam, Solutions [processes/threads, synchronizations, swap, page faults, Linux kernel code]

  • Fall 2016: Exam, Solutions [Real time scheduling, fork, signal management by the Linux kernel]

  • Fall 2015: Exam, Solutions [Double buffering, thread memory, Linux RAM disk]

  • Fall 2014: Exam, Solutions [Multiprogramming, virtual memory, RTAI tasks, Linux kernel modules]

  • Fall 2013: Exam, Solutions [System calls, programming errors, Linux kernel code analysis]

  • Fall 2012: Exam, Solutions [Swapping, devide drivers, memory allocation, POSIX programming]

  • Fall 2011: Exam, Solutions [Scheduling, page replacement, critical sections, kernel-level programming]

  • Fall 2010: Exam, Solutions [Booting of Linux, multi-thread programming]

  • Fall 2009: Exam [Interrupt service routines, kernel level code, Linux scheduling, real time scheduling]

  • Fall 2008: Exam, Solutions [Supervisor mode, drivers, preemption points, file systems in user space, scheduling of tasks]

  • Fall 2007: Exam, Solutions [Necessary hardware support, system calls, timer management, kernel-level programming, task synchronization]

  • Fall 2006: Exam [Timer management, system calls, real time application, scheduling of tasks]

  • Fall 2005: Exam, Solutions [Polling vs. interrupts, seg fault, synchronization between tasks, memory management in Linux, resource sharing between tasks]

  • Fall 2004: Exam, Solutions [kernel architecture, I/O buffers, signals, real time interrupt handlers, Os reliability, kernel-level programming]


Typical questions

You should be able to answer to the following questions before the exam.

Basic concepts

  • What is the difference between a trap and an interrupt? What is the use of each function?

  • Which of the following instructions should be privileged?
    • Set value of timer
    • Read the clock
    • Clear memory
    • Turn off interrupts
    • Switch from user to monitor mode

  • Name three hardware aids for designing an operating system, and describe how they can be used together to protect the operating system.

  • Which of the following have to be system calls and why?
    • open - to open a file
    • sprintf - to create a string from another string
    • printf - send data on the standard output
    • date - returns the value of the current time
    • encrypt - encrypt a stream of data
    • rename - rename a file
    • atoi - converts a string to an integer

  • What is the difference between the supervisor mode of a microprocessor and the administrator / root rights provided by an operating system? Are those two modes related? If yes, closely explain in what they are related.

  • What is the difference between a system call and a library function? Also, what is the difference between a static library and a dynamic library

Processes

  • Some operating systems provide no means of concurrent processing. Name one of them. Discuss three major complications that concurrent processing adds to an operating system.

  • Round-robin schedulers normally maintain a list of all runnable processes, with each process occurring exactly once in the list. What would happen if a process occurred twice in the list? Can you think of any reason for allowing this?

  • Explain the main steps that happen on UNIX Operating Systems when you start a program i.e. main actions that are executed (by the Shell from which the program is started, by the Operating System) when you type the name of an executable file in a shell until your first C instruction is executed

Memory Management

  • Most operating systems provide each process with its own address space by providing a level of indirection between virtual and physical addresses.
    • Give three benefits of this approach
    • Are there any drawbacks? Justify your answer!

  • Under what circumstances do page faults occur? Describe the actions taken by the operating system when a page fault occurs.

Input / Output

  • Can you imagine the general behavior of device drivers managing:
    • Keyboards?
    • Sound cards?
    • Speakers?
    • DVD drives?
    • Others?

  • Quickly explain the role of a driver. Then, explain why drivers frequently need to rely on buffers for managing devices. At last, explain why, when removing a USB key from a computer running Linux (or Solaris, Windows, etc.), one must first “detach the device”

  • UNIX coordinates the activities of the kernel I/O components by manipulating shared in-kernel data structures, whereas Windows NT uses object-oriented message passing between kernel I/O components. Discuss three pros and three cons of each approach.

  • What are the actions taken by the Operating System when a user program makes a call to the write() system call? We assume that this call is performed to write data in a file. Provide an answer for the two following cases:
    • Files are not cached in main memory
    • Files are cached in main memory

  • Suppose that a disk drive has 5000 cylinders, numbered 0 to 4999. The drive is currently serving a request at cylinder 143, and the previous request was at cylinder 125. The queue of pending requests, in FIFO order, is 86, 1470, 913, 1774, 948, 1509, 1022, 1750, 130. Starting from the current head position, what is the total distance (in cylinders) that the disk arm moves to satisfy all the pending requests, for each of the following disk-scheduling algorithms?
    • FCFS
    • SSTF
    • SCAN
    • LOOK
    • C-SCAN

RTOS

  • What is the difference between an exception and an interrupt?

  • In which case should nesting of interrupts be avoided?

  • When should interrupts be masked?

  • Why should timers’ ISR be as short as possible? What solution may be used if lots of processing must be performed within the ISR?

  • What are preemptions points used for? What happens if they are put too frequently in the operating system? On the contrary, what happens if they are not frequently put in the operating system? Why are preemption points more particularly at stake in real-time operating systems?