Chapter 2 - introduction to operating systems Flashcards
what is an operating system
body of software as it is in charge of making sure the system operates correctly and efficiently
virtual machine
OS takes a physical resource and transforms it to virtual form
time sharing
OS switches quickly between programs
context switch
makes one CPU look like many
how to read memory
specify address - access the data stored there
where does a program keep its data structure
memory
what does malloc do
gets memory at a specific address
What is virtual memory?
A memory management technique where each process gets a private address space, managed by the OS.
Why does a program think it has all the memory to itself?
because the OS abstracts and manages the underlying physical memory
concurrency
host of problems that arise, must be addressed when working on many things at once
thread
function running within the same memory space as other functions, more than one of them active at a time
not atomic
another thread can interrupt in the middle -> gets different output with different threads
race condition
outcome depends on timing of thread switching
data race
A type of bug caused by unsynchronized access to shared data by multiple threads.
storing devices - why
SDD/hard drives - keep data permanently
3 basic system calls
open, write, close
how to prevent losing data after crash
use storing devices
what part of OS manages disk storage
file system
are files shared across programs - what does not
yes - CPU and memory
how does OS handle file storage behind the scenes
finds where to place the file - manages metadata - performs I/O requests to storage devices
journaling/write-ahead logging
write a log before writing real data to recover from crashes -
wha should OS minimize
time overhead (extra instructions)
space overhead (memory of disk use)
main goal of operating system
build abstractions that hide hardware complexity
how do files act as abstractions
hide the details of disk storage