Lecture 3 - Function and Structure Flashcards

1
Q

How do programs request services from the OS?

A

Traps or exceptions

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

How do hardware devices usually request attention from the OS?

A

Interrupts

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

What is the fetch execute cycle?

A

Fetch instruction at program counter

decode and execute

Write results to registers/memory

Increment counter

repeat

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

What are device drivers?

A

Routines that interact with specific device types

Encapsulate device-specific knowledge, e.g.

How to initialise device

How to request IO

How to handle interrupts or errors

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

What two methods can the cpu use to know whether a device is ready/finished?

A

Polling - device sets flag when it is busy, program tests the flag in a loop waiting for change

Interrupts - when device is ready forces CPU to jump to a specific instruction address

After interrupt is processed CPU returns to previous address and continues execution

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

How does the storage hierarchy work?

A

Main memory - large ish storage media - very fast - direct cpu access

Secondary storage - large, slow, no direct access

Speed vs Cost vs Volatility (Pick two)

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

What is caching?

A

Copying info into faster storage system

Main memory is fast cache for secondary storage

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

What is the point of Hardware Protection?

A

Make sure user programs cannot mess up other programs or OS itself

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

What is dual mode operation?

A
Hardware support of differentiating between two modes of operation:
user mode (for users)

Kernel mode (for operating system)

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

How is dual mode operation done at the hardware level?

A

Mode bit added to indicate current mode (kernel = 0, user = 1)

When interrupt or fault occurs - switch to kernel mode

Priviledged instructions only allowed in kernel mode

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

All I/O instructions are _______ instructions

A

privileged

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

How does memory protection work?

A

two registers - base register and limit register

base holds smallest legal address for current program

Limit holds size of legal address range for current program

Any attempt to access outside this is refused

Kernel mode can access any mem

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

The load instructions for base and limit registers are ____________ instructions

A

privileged

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

What is CPU protection?

A

Timer - interrupts control after specified period to ensure OS maintains control

Prevents program going into infinite loop and stopping OS from running

Timer also used to implement timesharing

Timer operations are privileged instructions

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

What is a system call?

A

When a program needs a service from the OS

Passes relevant info to OS

OS performs the service if it is permitted for the program

OS checks to ensure info passed to it is ok

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

What sort of operations can system calls do?

A

Fork program

Replace process’ core image

Terminate program

Read/write to I/O devices

Change file permissions

Etc.

17
Q

What is the booting process for an OS?

A

Bootstrap program loaded from ROM

Runs loader program

Which loads and runs kernel

Which loads and runs rest of os

18
Q

What is the difference between simple and layered OS?

A

Simple: Only one or two layers of code

Layered: Several levels, lower independent of upper

19
Q

What is the difference between a monolithic kernel and a microkernel?

A

Monolithic: OS is a single, large system that does all OS related activities

MicroKernel: OS is built from many small user level processes

20
Q

What are the 7 layers of a layered OS?

A

User Programs

Interface Primitives

Device Drivers and Schedulers

Virtual Memory

I/o

Scheduling

Hardware

21
Q

In a layered OS, each layer uses functions and services of only _____________________ layers

A

Lower level

22
Q

What are some of the problems with layering?

A

Imposes hierarchical structure which might not be appropriate (e.g. file system requires virtual memory buffer, virtual memory might want a file system for backing store) - not flexible

Poor performance - crossing each layer involves overhead

Not realistic - modeled as layers but systems aren’t actually built that way

23
Q

In the traditional unix system structure, what is the “boundary” between kernel space and user space?

A

System call interface - everything strictly below this is kernel space

24
Q

What does a microkernel approach aim to do?

A

Move as much as possible into user space, just a very small core OS

Communication between modules with message passing

25
Q

What are the benefits and disadvantages of a microkernel approach?

A

Benefits: more portable OS

Easier to extend kernel

More reliable (less running in kernel space)

Individual bits of kernel protected from each other

Disadvantages:

Big performance overhead from message passing between modules

26
Q

What is the client-server architecture of microkernels?

A

Process don’t share memory

Communication using message passing

Processes can request services from other processes

27
Q

In a microkernel, the file system, network, thread management, scheduling and paging would all be part of _______________ which are in _________ mode

A

System processes

User mode

28
Q

What is the difference between module bases structure and layered structure?

A

Layered: inflexible

Modules: no layers, rather individual system modules communicate using known interfaces through the core kernel

29
Q

What does a virtual machine do?

A

Emulates an entire operating system plus hardware etc. in software

Illusion of multiple processes each with its own processor and virtual memory

30
Q

What is a Type 1 Hypervisor?

A

Hypervisor directly on top of hardware - hosts many guests.

No Host OS - more efficient

31
Q

What is a Type 2 Hypervisor?

A

Hypervisor runs in a Host OS and hosts guests

Host OS on top of hardware