Chapter 3 Flashcards

1
Q

Describe how the OS manages application execution

A

Resources are made available to multiple applications.

The processor is switched among multiple applications so all will appear to be progressing.

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

What are the two essential elements of a process?

A
  • The program code

- The set of data associated with that code

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

What are the two process states?

A
  • Trace, list of instructions that execute for that process.

- Dispatcher, which switches the processor from one process to the other.

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

What are the 4 reasons for process creation/

A
  • A new batch job
  • Interactive logon
  • Created by the OS to provide a service
  • Spawned by existing process
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Give 4 reasons for process termination.

A
  • Time limit exceeded.
  • Not enough memory
  • Invalid instruction
  • Privileged instruction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are 4 characteristics of a suspended process?

A
  • The process isn’t immediately avaialble for execution
  • The process may or may not be waiting on an event. if it is, then it is blocked/suspended. Otherwise it is ready/suspended. It is important to note that it is suspended regardless if it’s waiting for an event or not.
  • The process was suspended by an agent: itself, it’s parent process or the OS itself for the purpose of preventing its execution.
  • The process may not be removed from this state until the agent explicitly orders the removal.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are some reasons for a process getting suspended?

A
  • Swapping
  • Other OS reason
  • Interactive user request
  • Timing
  • Parent process request
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a memory table used for?

A

Used to keep track of both main and secondary memory

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

What are I/O tables used for?

A
  • Used by the OS to manage the I/O devices and channels of the computer system
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are process control structures?

A
  • Data structure which stores:
  • Where the process is located in memory
  • Attributes of the process that are necessary for its management
  • These are contained in the process control structure
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the 3 ways to identify a process?

A
  • Identifier of this process
  • Identifer of the process that created this process (parent process)
  • User identifier
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the typical elements of a process image?

A
  • User data
  • User program
  • Stack
  • Process Control Block
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the process control block?

A

The process control block is an important data structure which holds information such as:

  • Process identifier
  • Process state
  • Process priority
  • Program Counter
  • Memory pointers
  • Context data
  • I/O status information
  • Accounting information
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

When a new process is created, what state is it in?

A

The process would be in a “not running” state.

The process only runs until dispatched.

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

What are the two modes of execution?

A
  • User mode, which is the less priviledged mode. User programs typically execute in this mode.
  • System mode, which is a more privileged mode.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What attributes are created when a new process is created?

A
  • A unique identifier for the process
  • Allocates memory for the process
  • Initializes the process control block with neccessary information
  • Sets the process control blcok
  • Creates or expands other data structures
17
Q

What are the 3 mechanisms for interrupting the execution of a process?

A
  1. Interrupt - Used as a reaction to an async, external event
  2. Trap - Used to handle an error or exception condition
  3. Supervisor call - Used to call an operating system function
18
Q

Explain mode switching. What happens if no interrupts are pending on the processor? What happens if there are?

A
  • If no interrupts are pending the processor, it proceeds to the fetch state and fetches the next instruction of the current program in the current process.
  • If an interrupt is pending the processor, it sets the program counter (PC) to the starting address of the interrupt handler program. Then switches from user mode -> kernel mode so that the interrupt processing code may include privilged instructions.
19
Q

What are the steps of a full process switch?

A
  1. Save the context of the processor.
  2. Update the process control block of the process currently in the running state.
  3. Move the process control block of this process to the appropriate queue.
  4. Select another process for execution.
  5. Update the process control block of the process selected
  6. Update memory management data structures.
  7. Restore the context of the processor to that which existed at the time selected process was last switched out.