Processor Manager Flashcards

1
Q

Processor Manager

A

Decides how to allocate the CPU to waiting processes/Decides which process gets on the CPU first to be decoded and executed.
- Creates processes when a program is executed.
- Initialises memory and stacks for new processes.
- Keeps track of status of processes.
- Context switch.
- Changes process states
- Handles termination of processes on completetion/abort.
- Allows communication between processes.
- Manages process queues and prioritisation.

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

Multiprogramming

A

Put process on CPU, and doesn’t come off until it either it terminates or blocks if the process is waiting for an I/O, in which there is no point keeping it on the CPU, creating difference between process phase or I/O phase. Problem arise with compute-bound and I/O bound processes. This is balanced with multitasking.

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

Multitasking (time-sharing)

A

Gives each process a fixed time on the CPU, interrupting it if it takes too long. When it is interrupted, the OS gets a clock interrupt and puts itself (the OS scheduler) onto the CPU, operating what they need to do (tidying up etc). Since this is so fast, it looks like it is multitasking.

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

Interrupt Handling

A

multitasking relies upon the fact it can interrupt the CPU. An interrupt request (IRQ) is a hardware signal that occurs when something happens outside normal program execution, which can happen at anytime regardless on what the CPU is doing. This tells the CPU to stop and load an interrupt handler (known as interrupt service routines, or ISR).

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

Interrupt Vector

A

The CPU also has a interrupt vector, which stores the memory address of handler for each type of interrupt, populated by OS when it first boots up. So essentially, the OS is responsible for handling and managing each interrupt.

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

CPU Interrupt

A

When the CPU receives an interrupt, the interrupt will have a number in which the CPU uses to find the correct address in the interrupt vector to find the correct address for the code to handle the interrupt.

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

Context Switch with OS

A

The clock interrupt is triggered at the end of each time slice, which results in the OS running its scheduling algorithm to choose next processes, known as context switch. The current state of the CPUs are stored in a data structure called process control block. This overall wastes a few FDE cycles but gives maximum CPU usage with multitasking without the original problems of multiprogramming.

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

Process Control Block

A

What the kernel maintains for every process, which can also be represented as a file. This contains things such as:
- Unique process ID
- User ID of process owner
- Process state
- Memory address of process
- Statistics
- Resources allocated to process (files, devices etc)
- Register values from context switch

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

States of Processes

A
  • Running -> currently being executed.
  • Ready -> ready to be executed/ waiting for CPU to become free.
  • Blocked -> waiting for I/O to be complete.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Creation and Termination

A
  • Creation -> reverse memory for the process and its stack, setup process control block, initialise I/O channels, place process into the ready state.
  • Termination -> close I/O channels, remove process control block, deallocate memory.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly