Week 5 Stephen INTRO Flashcards
(10 cards)
What are good features of an OS (hint there are 7)
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
Secure multiplexing
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
What does a program run on
runs on a virtual computer provided by os
gets its own:
virtual cpu
virtual memory
virtual storage
virtyal network
virtual devices …
Explain difference between concurrency and parallelism
concurrency is about managing multiple tasks that may not run simultaneously but appear to do so
parallelism is about actual simultaneous execution.
Why is os internally concurrent
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
loading program into memory
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.
JUST READ
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
Limited direct execution
programs run on real hardware but os can regain control ( ie through interrupts
How does the os run a user program
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.
Why do system calls have numbers as identifiers and not address
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.