1/39
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Operating system
A program that acts as an intermediary between a user of a computer and the computer hardware
Roles of the operating system
Resource allocator
Control program: controls executions of programs to prevent errors and improper use
Protection and security
Non-virtual machine vs. virtual machine
In a non-virtual machine, the operating system communicates normally between the hardware and the processes
In a virtual machine, the operating system communicates with the hardware through a virtual machine manager
Process
A program in execution
Address space
Contains all of the memory state of the running program
Text section
Program code, located at the bottom of the stack (address space)
Data section
Contains all the global variables, located at the second to last block of the stack
Heap
Contains memory dynamically allocated during runtime, located above the data in the address space
Stack
Contains temporary data, such as function parameters, return addresses, and local variables
New state
The process is being created
Running state
Instructions are being executed
Waiting state
The process is waiting for some event to occur, such as input/output
Ready state
The process is waiting to be assigned to a processor
Terminated state
The process has finished execution
Process control block
Information associated with each process:
Process state
Process number
Program counter
Registers
Memory limits
List of open files
Context switch
When a process switches to another process on the CPU mid-execution. The CPU will attempt to save as much data from the process as possible before ending one process and load the data of the next one about to start
Thread
Short for thread of control/execution
Data parallelism
Distributes subsets of the same data across multiple cores, same operation on each
Task parallelism
Distributing threads across cores, each performing a unique operation
User threads
Management done by user-level threads, created by the user
Kernel threads
Threads supported/created by the kernel
Thread control block
A data structure in an operating system kernel that contains thread-specific information needed to manage the thread
Semaphore
An integer value that represents the number of resources available
Semaphore with Queue
When a semaphore has a queue, process waiting to acquire the resource but cannot because it is in use by another process will enter the semaphore queue. When the thread obtains the resource, it enters the ready queue after waking up.
Atomic operation
An operation that can only occur completely from start to finish. If the process cannot be completed fully, it will not be ran at all
wait / P()
Used to obtain a semaphore resource
Signal / V()
Releases a semaphore after use
Deadlock
A situation where no further process can occur. Happens when all 4 of its conditions are true.
Mutual exclusion
Only one process at a time can use a resource
Hold and wait
A process holding at least one resource is waiting to acquire an additional resource held by other processes
No preemption
A resource can be released only voluntarily by the process holding it, after that process has completed its task
Circular wait
A process is waiting for a resource that is being used by the process in front of it and so on
Domain
Set of access rights
Access rights
A subset of all valid operations that can be performed on the object, such as read, write, and execute
Domain switching
Can be performed by changing file system, using passwords, or through commands
Global table
Used to store ordered triples that contain permissions in a table, but could be too large to fit into main memory
Access control lists
Each column is implemented as an access list for one object
Capability list
Each row of the table can be kept as a list of the capabilities of that domain
Lock key
Each object has a list of unique bit patterns, called locks
Each domain has a list of unique bit patterns, called keys
Process in a domain can only access object if domain has key that matches one of the locks