Week 5 Stephen INTRO Flashcards

(10 cards)

1
Q

What are good features of an OS (hint there are 7)

A

Efficiency :
Mimimal overhead , maximises use of hardware resources

fairness - shares out system resources according to policy

reliability - If one program is faulty ( OR HARDWARE IS FAULTY) the whole os doesnt collapse

security -
Keeps working even when programs are adversarial ( be it malicious or unintended)
AND SO PREVENTS UNAUTHORISED ACCESS
when program tries to access memory that is not theirs ( ie other progammes memory)

USABILITY

ABSTRACTION

SIMPLICITY

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

Secure multiplexing

A

Sharing out hardware resources among processes such that PROCESS DOES NOT GET MORE THAN ITS INTENDED SHARE AND THAT A PROCESS DOES NOT INTEFERE WITH BEHAVIOUR OF ANOTHER PROCESS’ SHARE

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

What does a program run on

A

runs on a virtual computer provided by os

gets its own:
virtual cpu
virtual memory
virtual storage
virtyal network
virtual devices …

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

Explain difference between concurrency and parallelism

A

concurrency is about managing multiple tasks that may not run simultaneously but appear to do so

parallelism is about actual simultaneous execution.

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

Why is os internally concurrent

A

Due to the parallelism of hardware - we have many pieces of hardware doing different things at the same time and the Os must coordinate these

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

loading program into memory

A

Loading a program means taking the static binary on disk and mapping its code and data sections into the process’s virtual memory, plus preparing dynamic regions like the heap and stack for runtime use.

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

JUST READ

A

so let me tell you everything i know

user mode - part of process virtual address space that program runs on. It doesnt have access to hardware resources and if theres a fault its not catastrophic as its isolated to that process and doesnt crash OS

if programs didnt run on user mode they could just access hardware resources directly bypassing secure multiplexing ( as it could interfere with memory thats not theres)

Kernel mode - part of process virtual address space that is privilleged and can access hardware resources. kernel encompasses evertyhing ( ie its user + kernel)

Switching - We use system calls to switch between user and kernel mode. when a system call ocurs , we switch from user to kernel , and execute kernel code on os before returning to user so program execution can continue

an error in kernel can lead to whole os crashing

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

Limited direct execution

A

programs run on real hardware but os can regain control ( ie through interrupts

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

How does the os run a user program

A

The OS sets the CPU to User Mode and jumps to the program’s memory.

The OS must eventually regain control, either via interrupts (preemptive) or waiting/yielding (cooperative).

Any interrupt (timer, I/O, system call) switches the CPU to Kernel Mode, allowing the OS to take control.

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

Why do system calls have numbers as identifiers and not address

A

System calls take place in user mode (in order to get us to switch to kernel mode) therefore we dont have have access to physical memory

System calls use numbers to identify which service is requested; the OS holds a system call table that maps these numbers to the specific privileged kernel functions that implement the services.

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