Tute Questions Flashcards

1
Q

What are the desirable features of an OS?

A

Efficiency, reliability, robustness, etc

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

Define program

A

Set of instructions that performs a task when executed. Static description of algorithm

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

Define process

A

Processes are dynamic. These are instances of programs in execution

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

Define processor

A

agent which executes instructions. It may be hardware only (e.g. an x86
CPU) or a combination of hardware and software (e.g. a CPU running an interpreter for the
JVM).

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

Multiprogramming

A

Switching between several process rapidly on a CPU to give illusion of parallelism

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

What is the distinction between user and kernel modes. Why is it important?

A

distinction is the foundation needed by the kernel for the building of its security mechanisms. Protecting processes from each other and preventing the system from
being compromised by an intruder.

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

When an interrupt or system call transfers control to the OS, execution stops using the stack of the interrupted process and switches to a separate kernel stack. Why?

A

Kernel mode can execute privileged instructions. We don’t want users to be able to access this through any variables in the case that this information ends up being stored in local variables in the one stack.

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

. Can a process make a transition from the Ready state to the Blocked state? Why or why not?

A

No, it cannot. A process can become blocked only when it issues a request for a resource that is
not available, and it can make such a request only when it is executing.

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

How do we calculate wait time for a process?

A

Finish time - arrival time - burst time

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

In the round-robin scheduling algorithm, why can’t you start new processes at the front of the
queue instead of at the end?

A

Users would learn of this and would fork off new processes in order to keep using CPU right before their process ends

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

What advantages are there to multilevel feedback queues?

A

The system should allow newly runnable higher-priority processes to preempt a currently running
lower-priority process.
The multile

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

What are the functions of memory management? Why is it necessary?

A

(a) Manage one of the main resources of the machine: keep track of what parts are in use and
by whom, and allocate memory to processes that need it.
(b) Allow several processes to share memory by protecting memory against unauthorized access.
(c) Manage the automatic movement of data between main memory and disk. These systems
can thus project the illusion that the system has a lot more main memory than it actually
has.

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

Where is the MMU in typical computers? Are there any memory references that do not go through
the MMU?

A

Between the CPU and the bus, usually next to (or on) the CPU chip. Memory references that
are issued on behalf of the MMU (lookups of the page table) should not go through the MMU,
otherwise an infinite loop may result.

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

Give an arithmetic expression connecting a given virtual address with the corresponding page
number and offset. What does this tell you about page sizes that are not powers of two?

A

virtual_address = virtual_page_number * page_size + offset.
Since offset must be less than page_size, the following must hold:
virtual_page_number = floor(virtual_address / page_size)
In binary, division by powers of two is trivial, but division by other numbers is very difficult,
taking more than a dozen CPU cycles even in good implementations. However, you cannot search
the TLB for a virtual page number until it has been computed. Therefore non-power-of-two page
sizes would slow down every memory reference by a large factor.

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