View on GitHub

Computer Architecture and Operating Systems

Course taught at Faculty of Computer Science of Higher School of Economics

Final Test: Operating Systems

The grade formula is as follows:

Grade = 0.4 * Theory + 0.6 * Programming

Part 1. Theoretical Questions

Answer the theoretical questions in a few sentences (1-2 paragraphs for a question).

Use your own words. Copy-paste from external sources and other students will result in 100% penalty.

  1. Memory management.
    • Memory layout of a program: What memory segments do you know? What purposes do they serve?
    • What ways to allocate memory do you know?
    • How dynamic memory allocation via malloc/free is implemented (using what data structures)?
    • Give definitions of payload, fragmentation, and placement strategies.
    • What is the purpose of the sbrk system call?
  2. Processes.
    • What is a process? What parts does it contains (its layout in memory)?
    • List the states of a process and describe how it changes states.
    • What is Process Control Block (PCB)? What information does it contain?
    • Describe the idea of process creation with system calls fork and exec. What is the role of system call wait?
    • How to see the list of running processes in Linux (what system utilities do you know)?
  3. Permissions.
    • What access rights do you know? What permission groups do you know?
    • How to view and how to change file permissions (what utility tools to use)?
    • Explain the setuid/setguid and sticky bit permissions.
    • Study the text below. What can you say about file1, file2, file3, and file4?
    acos@acos-vm:~/folder$ ls -li
    total 12
    892954 drwxr-x--- 2 acos   acos 4096 июн 16 14:53 file1
    795083 lrwxrwxrwx 1 acos   acos    5 июн 16 14:55 file2 -> file1
    792657 -rwsrwxr-x 2 myuser acos    7 июн 16 14:56 file3
    792657 -rwsrwxr-x 2 myuser acos    7 июн 16 14:56 file4
    

Part 2. Programming Task

Write a program in C that does the following:

Example of Function (you need your variant, see below)

Note: the ^ symbol means “power”.

f0(a, b, c, d) = (a - b + c - d) / 2
f1(x) = 2*x^3 - 4*x^2 + 3*x + 1
f2(x) = sin(5*x)*4 + 3
f3(x) = 1 / (1 + e^(-7*x))
f4(x) = 2^x + 5

Requirements and Grades

Hints

Variants

Choose your variant number according to your number in your group. See the lists of students here.

Variants for groups: