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
Q

ULTs?

A

User level threads

26
Q

6 hits, 14 misses. what is the hit ratio

A

6 / (6+14)

= 0.3

27
Q

What does the program counter register hold

A

The address of the next instruction to be executed

28
Q

What signal cannot be caught and handled? (SIG______)

A

SIGKILL

29
Q

What is a multi programmed batch system

A

Seeks to optimize CPU usage

30
Q

Why don’t we just use 1TB of cache memory if it is faster?

A

It’s way too expensive and also Volatile

31
Q

Difference between a process and a program?

A

Process - a program in execution

Program - a set of instructions stored in memory

32
Q

If a process has two threads, can they be in different states?

A

No because both threads share the same memory address, so if 1 thread is suspended or whatever then both threads are suspended

33
Q

If the PC is 203, what is loaded into the IR?

A

Whatever instruction is loaded into address 203

34
Q

What does PC stand for

A

Program counter

35
Q

What does IR stand for

A

Instruction register

36
Q

Is cache memory visable to the programmer?

A

No - only hardware

37
Q

A process is in main memory, waiting for an I/O event. It is most likely in the ______ state

A

Blocked

38
Q

What does Hit Ratio refer to?

A

The percentage of memory accesses occurring only within level 1 memory. A hit ratio of 1 would be all Hits at level 1.

39
Q

Can a program continue to run after receiving SIGINT

A

yes - only if the program has a catch for it

40
Q

If the OS disables interrupts while an interrupt is being processed, what will happen to the interrupts?

A

The OS will process them one at a time. The others will have to wait in line.

41
Q

If the OS processes multiple interrupts using a priority scheme, what will happen?

A

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
Q

Describe a situation where a two level memory scheme is doing more harm than good

A

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
Q

Difference between a multi programmed batch system and a time sharing system?

A

MPBS - Seeks to optimize CPU usage

TSS - seeks to optimize response times for users

44
Q

A symmetric multiprocessor shares access to:

A

I/O devices, main memory

45
Q

What is false about the Linux OS

A

Takes a strict micro-kernel approach

46
Q

Why would a process be moved from READY to RUNNING

A

Dispatcher is ready to move a program out of the queue and start executing it

47
Q

Why would a process be moved from RUNNING to READY

A

Process reaches the timeout limit or is trumped by a higher priority process

48
Q

Why would a process be moved from RUNNING to BLOCKED

A

A running process has to wait on an I/O event to complete, so it’s moved to a blocked state

49
Q

Why would a process be moved from BLOCKED to BLOCKED/SUSPENDED

A

More memory is needed, so the process is moved over to secondary storage

50
Q

Why would a process be moved from BLOCKED/SUSPEND to READY/SUSPEND

A

The event that the process was waiting on is finished so it is ready to proceed, but is still in a suspended state

51
Q

In an OS that only uses ULTs, can a multi-threaded application take advantage of multiprocessing?

A

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
Q

Why do we not see a perfectly linear performance increase as we increase the number of processors or cores?

A

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
Q

Disadvantages of ULTs

A

Mutlithreaded application cannot take advantage of multiprocessing

54
Q

What is jacketing?

A

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
Q

What is a trace?

A

The behaviour of an individual process by listing the sequence of instructions that execute for that process

56
Q

What is the dispatcher

A

A small program that switches the processor from one process to another

57
Q
What is not part of the process control block?
PC
Context data
Memory pointers
Process state
User stack
A

User stack

58
Q

If a process is IN main memory and is waiting for an I/O event, it is most likely in what state

A

Blocked

59
Q

If a process is OUT OF main memory and is waiting for an I/O event, it is most likely in what state

A

Suspended

60
Q
Which is permitted to occur while in user mode?
Privileged instructions
Access to kernel stack
Making a service call
Executing interrupt handler
A

Service call

61
Q

Can a program keep running after receiving SIGKILL?

A

Nope - SIGKILL is a for sure kill >.

62
Q

Would it make sense for a process to transition directly from Ready/Suspend to Blocked/Suspend?

A

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.