1.2.1 Flashcards

The need for, function and purpose of operating systems including

1
Q

Memory Management

A

Computers often need more memory than is available and so must efficiently manage the available memory and share it between programs.

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

Paging

A
  • Memory is broken down into equal sized parts called pages.
  • Pages are swapped between main and virtual memory.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Segmentation

A
  • Memory is split up into segments.
  • Segments can vary in size.
  • These segments represent the logical flow and structure of a program.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Virtual Memory

A
  • Part of the hard drive can be used as RAM.
  • Access is slower than RAM.
  • Paging is used to move sections which are not in active use into virtual memory.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Interrupts

A
  • A signal generated by hardware or software to tell the processor it needs attention.
  • Have different priorities.
  • Stored with a priority queue in an interrupt register.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Interrupt Service Routine (ISR)

A
  • At the end of the fetch, decode, execute cycle the interrupt register is checked.
  • If there is an interrupt with a higher priority than the current task:
    - The contents of the registers are transferred into a stack .
    - The appropriate (ISR) is loaded into RAM.
    - A flag is set, noting that the ISR has begun.
    - The flag is reset when the ISR has finished.
    - This process repeats until no more interrupts exist.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Round robin

A

Each process is allocated a certain time-slice of CPU time (5ms in the example right) .

If the process is still running when the time slice expires it is swapped out and added to the back of the queue.

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

Round robin pros and cons

A

Pros
- Avoids process starvation.

Cons
- Can be inefficient if the processor is allocated to a process that
is waiting for input or output eg printer to print.
- Overhead in swapping
- Performance depends heavily on the size of the time quantum
selected. If the quantum is very large (infinite), RR is the same
as FCFS.

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

First come first served (FIFO)

A

Processes are allocated processor resources in the order in which they are requested.

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

First come first served (FIFO) pros and cons

A

Pros
- Easy to implement with a FIFO queue
- No swapping in and out so no overhead

Cons
- A more important process might have to wait for a less
important one to finish which could crash the system.
- Quick jobs may have to wait for a long job to complete.
- A long process could monopolise the CPU.
- Average waiting time may be long. The average waiting time
under a FCFS policy is generally not minimal, and may vary
substantially if the process burst times vary greatly.

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

Multi-level feedback queues

A
  • Has a number of queues each assigned a different priority level.
  • All processes start in top priority queue (FIFO). Processes on a higher priority queue run first.
  • If a process uses up its time allotment, its priority is reduced and it will be moved to a lower-priority queue.
  • Using this feedback, processes move between queues.

-To prevent processor starvation, after a set interval, all processes are promoted.

  • A MLFQ is the most common general CPU-scheduling algorithm as well as being the most complex.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Multi-level feedback queues advantages and disadvantages

A

Advantages
- A process that waits too long in a lower priority queue may be moved to a higher priority queue.
- No prior knowledge of the job is needed
- Fair and makes progress for long-running CPU-intensive workloads. - For this reason, many systems including Windows operating systems use a form of MLFQ as their base scheduler.

Disadvantages
- Moving the process around queue produces more CPU overhead.
- How many queues should there be? How big should the time slice be per queue?
-How often should priority be boosted in order to avoid starvation?

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