Chapter 4 Flashcards

(40 cards)

1
Q

Distinguish between hard real-time OS and soft real-time OS. Define jitter.

A

In hard real-time late completion of a task is inacceptable (i.e. nuclear reactor).

In soft real-time occasional late completion of a task is acceptable as long as the application generally meets the deadline. (i.e. office printer)

Variability of the time to complete an application task.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Distinguish between server, desktop and general purpose operating systems.

A

Maximizes throughput (efficiency) and focuses on recoverability to failures and scalability.

Rapid startup, rapid user response times and energy efficiency.

General purpose aims to combine both to adapt to different applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain round robin process scheduling algorithm.

A

All processes are advanced within a period of time. Each process runs for a short period (time quantum) before yielding CPU to the next process. Some time wasted by switching.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the period of time each process runs for called?

A

Time Quantum

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the three different types of process?

A

Interactive: Requires quick response time.
Normal: Performs business-related computations and needs to maximize the usage of computer resources.
Housekeeping: Usually runs when there is nothing else to do.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the disadvantage of basic round robin scheduling?

A

It doesn’t take into account the different kinds of task at all.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain preemptive scheduling with priority queues (naive).

A

Priority assigned to each process. When picking next process:
1. Always pick the runnable process with the highest priority.
2. If two or more runnable processes with equal priority are available schedule them using round robin.
Processes are arranged into queues based on their priorities, with different time quantum for each as appropriate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the problem with preemptive scheduling with priority queues (naive).

A

If some high-priority process is always runnable, lower priority processes never get a chance to run. This is called starvation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Explain MFQS.

A

Multilevel Feedback Queue Scheduling.

  1. If P(A) > P(B). A runs.
  2. If P(A) = P(B), A & B run in RR using time quantum of given queue.
  3. When job enters system, place at highest P.
  4. Once a job uses up time allotment reduce its priority.
    5 After some time period S, move all the jobs in the system to the topmost queue.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the downside of MFQS?

A

Has many parameters time quantum at different levels, how often to reset priorities, how to rebalance priorities. These are all set by admin called “voodoo constants” and are complex to understand or alter in an attempt to improve efficiency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Explain Linux completely fair scheduling nice value.

A

nice values range from -20 to 19. The lower the nice value - the higher the priority. The higher the nice value - the lower the priority.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Explain Linux completely fair scheduling virtual runtime.

A

Virtual runtime of a process is the total amount of CPU time it has received so far.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Explain Linux completely fair scheduling.

A

When choosing the next process to run always choose the runnable process with the minimal virtual runtime. Stores virtual runtime in RB tree for efficiency (leftmost node minimum). When a new process is started, its inserted at this leftmost node to give it the highest priority. Nice value of process affects how much virtual runtime it accumulates. So a lower nice value leads to less accumulation and increases priority.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Define BIOS.

A

Basic Input Output System.
Initial program stored in ROM
Loads OS kernel
Provides run time services for OS.
Performs POST (Power-on self test).
Performs required hardware initialization.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does UART stand for?

A

Universal Asynchronous Receiver/Transmitter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Where is OS kernel (supervisor) in QEMU system?

A

Executable file loaded into RAM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is booting?

A

Refers to computer startup and involves:
1. Loading OS kernel into memory
2. Initializing computer hardware adapters and peripherals
3. Starting background application programs
4. Starting interactive shell

18
Q

What is the typical boot loading stages in linux?

A

Bios Bootloader Program runs in ROM -> loads from data storage ->
Operating System Bootloader runs in RAM -> loads from data storage
-> Operating System Kernel runs in RAM -> launches from file system -> init file runs -> starts all other programs (e.g. shell and daemon processes)

19
Q

What is the access control matrix?

A

Rows represent Users, columns objects, and data the operations the corresponding user has permission to perform on the corresponding object.

20
Q

What do access control mechanisms do?

A

Only allow users with the appropriate permissions to perform appropriate actions.

21
Q

How are user groups set? Why key information is used by access control mechanisms that is stored in User account?

A

On a multi-user computer system, users are split into several groups based on their job function. Data sharing between groups should be limited.

User identifier (UID)
Group identifier (GID)

22
Q

What is superuser?

A
  1. Special user account called root
  2. Has privileges above all other accounts
  3. Can change ownership and permissions
  4. Has full access to all files
  5. Can kill any process
23
Q

What is sudo group?

A

The superuser access is too dangerous for interactive login, but users part of the sudo group can access its privileges.

24
Q

How are file permissions specified?

A

For file owner (match UID), for group of owner (match GID) and for all other users

drwxrwxrw

first letter is file type (d=directory, -=ordinary file, l=link, b=block device etc.)
r = permission to read contents
x = permission to execute/search
w = permission to modify
- = No permission

25
What is a semaphore?
An unsigned integer variable which is initialized to some value >= 0. Binary semaphore is similar to a lock. wait operation attempts to decrement the value of the semaphore variable by 1. If new value would be negative go to sleep, otherwise continue execution. signal operation attempts to increment the value of the semaphore by 1. If there are processes sleeping on the semaphore it wakes them up.
26
Suppose we have three threads A, B and C and three critical sections for each how can we go through them in order.
Sa=1, Sb = 0 Sc = 0 wait(Sa) critical section A signal(Sb) wait(Sb) critical section B signal(Sc) wait(Sc) critical section C signal(Sa)
27
How can we use semaphores to keep track of used GPU's?
Initialize a semaphore to the number of GPUS free, then call function wait() and mark that GPU as used. This will decrement semaphore. Have another semaphore to make sure the part of the code that changes GPU count can only be accessed by one GPU at a time. Have another function to release semaphore.
28
How is data allocated on the stack?
By decrementing stack pointer by number of bytes.
29
In which direction does stack grow?
Downward
30
In a typical C program memory layout, which section is used to store uninitialized global and static variables?
.bss
31
In a single multitasking CPU hart, how can interrupts be used to prevent race conditions when accessing shared resources like an MMIO display, as discussed in the context of critical sections?
By disabling interrupts before entering a critical section and re-enabling them upon exit.
32
What is the primary function of a Memory Management Unit (MMU)?
To translate virtual addresses generated by the CPU into physical memory addresses.
33
In Unix, what is a ”file descriptor”?
A small, non-negative integer that the kernel uses to identify an open file for a process.
34
In a Unix shell, what is the typical purpose of input/output redirection using > (greater-than sign)?
To redirect the standard output of a command to a file, overwriting the file if it exists.
35
Which of the following best describes the sbrk() system call in traditional Unix systems?
To change the size of the data segment (heap) of the calling process.
36
In the cut command, when using field-based extraction (e.g., cut -d’ ’ -f FIELDS file.txt), what does the field specifier -f2- typically mean?
To select all fields from the second field to the end of the line.
37
For many system information utilities (like free or tools reading /proc/cpuinfo) to function correctly in a minimal Linux environment (e.g., booted with an initramfs), what filesystem typically needs to be mounted?
/proc (process information pseudo-filesystem)
38
What does the uname -a command typically display in a Linux environment?
All system information including kernel name, hostname, kernel release, kernel version, machine hardware name, and operating system.
39
Which of these is a common strategy to avoid deadlocks when multiple locks are involved?
Acquiring locks in a predefined global order and releasing them in the reverse order.
40
In the context of QEMU, if the -bios none option is used, what typically happens at the start of emulation?
QEMU directly loads the specified kernel into RAM, and the emulated ROM contains minimal code to jump to the kernel’s entry point.