Operating Systems foe ES (Schedulers) Flashcards

1
Q

High level schedule?

A

Scheduler allows tasks to be called (periodically or sporadically)

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

Low-level Schedule?

A

Scheduler can be viewed as a single timer interrupt service routine that is shared between many different tasks

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

Preemptive, non-preemptive?

A

preemptive - tasks can be interrupted

non-preemptive - tasks always run to completion

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

typecast the pointer: ‘void *aNumber’ to an integer pointer ‘intPtr’

A

int *intPtr = (int *)aNumber

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

What is difference between:

  1. (*intPtr)++; and
  2. intPtr++;
A

referencing and dereferencing.

  1. increments the integer saved in *intPtr
  2. increments the intPtr address to next entry
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Round Robin limitations?

A
  • tasks run in fixed order (no skipping/priorities)

- no control over timing

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

What is an Event-driven loop?

A
  • tasks executed upon events
  • tasks implemented as ISRs
  • infinite while loop which gets interrupted
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

number of tasks in a tasklist tasks[]? Code?

A

numTasks = sizeof(tasks)/sizeof(tasks[0])

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

Difference between cooperative and preemptive scheduler?

A

Cooperative: tasks decide themselves when to halt and yield to another task
Preemptive: Scheduler decides when to halt current task and resume other task

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

What does context switch mean?

A

Changing of running task is called context switch

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

What are the manual steps of context switch?

A
  • context pushed on stack: PC pushed by ISR automatically and r0 to r31, SREG and stack pointer are pushed manually
  • restoring context from stack pointer of current TCB (task control block)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Define Concurrent Task Model

A

Describes functionality of system in terms of concurrently executing subtasks disregarding interleaving aspects

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

How to achieve communication between tasks?

A
  • shared memory

- message passing

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

What is mutual exclusion and how is it achieved?

A
  • when tasks enters critical sections all other tasks must be locked out until it leaves critical section
  • Mutex and Semaphores
How well did you know this?
1
Not at all
2
3
4
5
Perfectly