Midterm review Flashcards

1
Q

What does the CPU do

A

Data processing and operation of computer

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

What is RAM?

A

Real or primary memory
It is wiped on power down (Volatile)
Much faster than secondary storage, much slower than cache

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

What are the components of a CPU connected by?

A

The system bus

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

Why is cache the fastest form of memory

A

It is directly inside the CPU (Locality principle). It does not need to be accessed via system bus

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

Instruction execution?

A
  • Os loads program into memory
  • Instructions are fetched and executed one at a time
  • Fetch, then execute
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are interrupts

A

A result of an external device requesting attention

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

What recieves an interrupt

A

The interrupt request channel

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

How does the processor handle checking for interrupts

A

It adds an interrupt check stage after the execute stage

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

If we are in the fetch or execute stage, the interrupt has to _____

A

Wait bitch

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

As you go down the memory hirearchy, what happens?

A

Decreasing cost per bit
Increasing capacity
Increasing access time
Decreasing frequency of access by the processor

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

What does the OS act like?

A

A user/computer interface

A program

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

What are the two modes of operation?

A

User mode and kernel mode

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

What is user mode?

A

User programs execute in this mode

Certain areas of memory and instructions are protected and may not be executed

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

What is kernel mode?

A

The monitor executes in kernel mode

Privilledges instructions may be executed here, and the protected memory can be accessed

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

What is uniprogramming

A

The processor spends time executing until it reaches an I/O instruction
It then waits for that instruction to conclude before resuming work
It’s very slow -.-

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

What is multiprogramming

A

PRocessor spends time on multiple programs while waiting for interrupts
As long as we have space in memory we can load more programs to maximize CPU usage

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

What is a process?

A

A program in execution / an instance of a running program

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

What is a trace?

A

a process being executed

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

Seven stages of the seven state model

A
New process
Admit - goes to READY
Dispatch - goes to RUNNING
if it times out it goes back to ready
if it releases then goes to EXIT
Event wait - goes to BLOCKED
Event occurss during this - back to ready
Takes too long - goes to SUSPENDED and then back to ready eventually
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Processes have two characteristics:

A

Resources ownership

Schedules and execution

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

What is resources ownership

A

One unit of this is reffered to as a process or task

Resources allocated at process level

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

What is schedules and execution

A

A unit of this is called disbatching, or a thread, or a lightweight process

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

What is multithreading?

A

When an OS can support multiple paths of execution within a single process

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

KLTs?

A

Kernel level threads

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
ULTs?
User level threads
26
6 hits, 14 misses. what is the hit ratio
6 / (6+14) | = 0.3
27
What does the program counter register hold
The address of the next instruction to be executed
28
What signal cannot be caught and handled? (SIG______)
SIGKILL
29
What is a multi programmed batch system
Seeks to optimize CPU usage
30
Why don't we just use 1TB of cache memory if it is faster?
It's way too expensive and also Volatile
31
Difference between a process and a program?
Process - a program in execution | Program - a set of instructions stored in memory
32
If a process has two threads, can they be in different states?
No because both threads share the same memory address, so if 1 thread is suspended or whatever then both threads are suspended
33
If the PC is 203, what is loaded into the IR?
Whatever instruction is loaded into address 203
34
What does PC stand for
Program counter
35
What does IR stand for
Instruction register
36
Is cache memory visable to the programmer?
No - only hardware
37
A process is in main memory, waiting for an I/O event. It is most likely in the ______ state
Blocked
38
What does Hit Ratio refer to?
The percentage of memory accesses occurring only within level 1 memory. A hit ratio of 1 would be all Hits at level 1.
39
Can a program continue to run after receiving SIGINT
yes - only if the program has a catch for it
40
If the OS disables interrupts while an interrupt is being processed, what will happen to the interrupts?
The OS will process them one at a time. The others will have to wait in line.
41
If the OS processes multiple interrupts using a priority scheme, what will happen?
The processer will start on one interrupt, and then if another with a higher priority comes along, it will pause the first one and then go to the second one. It will then resume WHERE IT LEFT OFF after it is done.
42
Describe a situation where a two level memory scheme is doing more harm than good
If the average access time is greater than the access time of level 2 memory due to a low hit ratio, then the scheme is doing more harm than good
43
Difference between a multi programmed batch system and a time sharing system?
MPBS - Seeks to optimize CPU usage | TSS - seeks to optimize response times for users
44
A symmetric multiprocessor shares access to:
I/O devices, main memory
45
What is false about the Linux OS
Takes a strict micro-kernel approach
46
Why would a process be moved from READY to RUNNING
Dispatcher is ready to move a program out of the queue and start executing it
47
Why would a process be moved from RUNNING to READY
Process reaches the timeout limit or is trumped by a higher priority process
48
Why would a process be moved from RUNNING to BLOCKED
A running process has to wait on an I/O event to complete, so it's moved to a blocked state
49
Why would a process be moved from BLOCKED to BLOCKED/SUSPENDED
More memory is needed, so the process is moved over to secondary storage
50
Why would a process be moved from BLOCKED/SUSPEND to READY/SUSPEND
The event that the process was waiting on is finished so it is ready to proceed, but is still in a suspended state
51
In an OS that only uses ULTs, can a multi-threaded application take advantage of multiprocessing?
No because the OS wouldn't be aware of the threads because it only sees processes. Therefore it cannot schedule the threads because it doesn't know they exist.
52
Why do we not see a perfectly linear performance increase as we increase the number of processors or cores?
Execution can still be limited by the speed/performance of the system bus Overhead can be incurred while trying to account for memory coherence (can impair performance)
53
Disadvantages of ULTs
Mutlithreaded application cannot take advantage of multiprocessing
54
What is jacketing?
Writing an application as multiple processes rather than multiple threads. This eliminates the advantages of threads but will allow ULTs to run without being trumped by the kernel not knowing about multiple threads
55
What is a trace?
The behaviour of an individual process by listing the sequence of instructions that execute for that process
56
What is the dispatcher
A small program that switches the processor from one process to another
57
``` What is not part of the process control block? PC Context data Memory pointers Process state User stack ```
User stack
58
If a process is IN main memory and is waiting for an I/O event, it is most likely in what state
Blocked
59
If a process is OUT OF main memory and is waiting for an I/O event, it is most likely in what state
Suspended
60
``` Which is permitted to occur while in user mode? Privileged instructions Access to kernel stack Making a service call Executing interrupt handler ```
Service call
61
Can a program keep running after receiving SIGKILL?
Nope - SIGKILL is a for sure kill >.
62
Would it make sense for a process to transition directly from Ready/Suspend to Blocked/Suspend?
No because if a process is in the Ready/Suspend stage it has everything it needs to continue executing - it just needs to be moved back to main memory. In order for the process to be moved to Blocked/Suspend, it would first have to be in a running state and then transferred to block and then suspend.