1/133
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
operating system
a program that acts as an intermediary between a user an computer hardware
goals of an OS
execute user programs, make the computer system easy to use, utilize hardware efficiently
computer system structure
hardware, OS, applications, users
resource allocator
an OS function that decides between conflicting requests for efficient and fair use
control program
an OS function that controls execution of programs to prevent erros and improper system use
kernel
the one program running at all times on the computer
bootstrap program
a program loaded at power up or reboot, stored in the ROM or EPROM, initializes system components, loads the OS kernel and starts execution
concurrent execution
I//O and CPU can execute simultaneously
interrupt
a signal from hardware to the CPU indicating an operation is complete, transfers control to the interrupt service routine via the interrupt vecotr, incoming interrupts are disabled while another is being processed
trap
a software generated interrupt caused by an error or user request
interrupt handling
the OS determines the type of interrupt using polling oor a vectored interrupt system
system call
a request made by a user program to the OS, often to wait for I/O completion
device status table
a data structure containing an entry for each I/O device that lists its type, address, and state. The OS uses this table to check or modify device status when interrupts occur
storage structure
main memory, secondary storage, disk
main memory
random access, volatile storage
secondary storage
non-volatile, large capacity extension of main memory
disk
divided into tracks and sectors, the disk controller manages the logical interaction between disk and computer
caching
copying information into faster storage to improve performance
multiprocessor systems
systems with muliple processors that provide increased throughput, economy of scale, increased reliability, can be asymmetric or symmetric, and may be organized as clustered systems
multiprogramming
technique for increasing efficiency via job scheduling; when one job waits, the OS switches to another job
timesharing
the CPU switches among jobs frequently so that each user can interact with programs in real time
dual mode operation
enables OS protection via two modes: user mode, kernel mode
user mode
for user applications
kernel mode
for OS operations
process threading for single threaded process
one program counter
process threading for multithreaded process
one program counter per thread
protection
mechanism for controlling access of processes or users to resources defined by OS
security
defense of a system against attacks or unauthorized access
user ID and group ID
identifiers that determines user and group privileges within the system
user interface
allows users to interact with system services; can be CLI, GUI, or Batch. Uses system calls typically written in C/C++
system services user-oriented
include program execution, I/O operations, file system manipulation, communications, and error detection
system services efficiency-oriented
include resource allocation, accounting, protection, and security to ensure efficient OS operation
API
provides access to system calls; common ones include Win32, POSIX, and Java
system call numbers
each system call is associated with a unique number; the system call interface maintains a table indexed by these numbers
passing parameters in system calls
parameters can be passed via registers, by storing the address of parameters in a block, or by using the stack. Block or stack methods allow unliminited number and length of parameters
process control system calls
include end, abort, load, execute, create/terminate process, wait, and allocate/free memory
file management system calls
include create/delete file, open/close file, read, write, and get/set file attributes
device management system calls
include request/release device, read, write, and logically attach/detach devices
information maintenance system calls
include get/set time, get/set data, and get/set process, file, or device attributes
communication system calls
include create/delete communication connection, send/receive messages, and transfer status information
OS layered approach
the OS is divided into layers, each built on top of lower layers. Layer 0 is hardware, top layer is the user interface. Each layers uses only lower-level functions and services
VM
uses a layered approach that treats hardware and the OS kernel as thought they were all hardware. The host creates the illusion each process has its own processor and virtual memory
host vs guest in VMs
the host sytem provides each guest with a virtual copy of underlying computer
core dump file
file generated when an application fails capturing the memory of the process at the time of failure
crash dump file
file generated when the operating system fails, containing the contents of kernel memory
process
contrains a program counter, stack, and data section; represents a program in execution
text section
part of a process that contains the program code itself
stack
stores temporary data such as function parameters, return addresses, and local variables
data section
stores global variables used by the program
heap
contains memory dynamically allocated during run time
process control block
data structure containing information for each process: process state, program counter, CPU registers, scheduling info, accounting info, and I/O status info
I/O bound process
spends more time doing I/O than computations; has many short CPU bursts
CPU bound process
spends more time doing computations; has few, very long CPU bursts
context switch
when the CPU switches from one process to another, the system saves the old process's state to its PCB and loads the new process's state. Time depends on hardware
process creation
parent processes create child processes forming a tree structure. Each process as a PID for management
process resource sharing
parent and child processes may share all, some, or non of their resources
process execution relationship
parent and child processes can execute concurently o rhte parent can wait until the child terminates
fork() system call
creates a new process (child) that is a duplicate of the parent process
exec() system call
replaces the calling process's memory space with a new program, usually after a fork()
interprocess communications
mechanism allowing cooperating processes to exchange data, using either shared memory or message passing
shared memory
region of memory shared between processes for direct data access and communication
message passing
processes communicate by sending and receiving messages; can be blocking (synchronous) or non-blocking (asynchronous)
blocking send
sender waits until the message is received
blocking received
receiver waits until a message is available
blocking message passing
considered synchronous
non-blocking message passing
considered asynchronous
non-blocking send
sender sends and continues
non-blocking receive
receiver gets a message or null
thread
fundamental unit of CPU utilization that forms the basis of multithreaded computer systems
process vs thread creation
process creating is heavy-weight, while thread creation is light-weight; threads simplify code and increase efficiency
mulithreaded kernel
most kernels are designed to support multiple threads running concurrently
multithreaded models
many-to-one, one-to-one, many-to-many models for mapping user threads to kernel threads
many-to-one model
many user-level threads are mapped to a single kernel thread
one-to-one model
each user-level thread maps directly to a single kernel thread
many-to-many model
many user-level threads are mapped to many kernel threads, combining flexibility and concurrency
thread library
provides and API for programmers to create and manage threads
threading issues
include thread cancellation, signal handling, thread-specific data, and scheduler activations
asynchronous cancellation
terminates the target thread immediately
deferred cancellation
allows the target thread to periodically check whether it should be canceled
signal handling in threads
signal handler processes signals generated by specific events, delivered to a process, and handled appropriately
scheduler activiations
provides upcalls, communcation from the kernel to the thread library, to help the application maintain the correct number of kernel threads
race condition
situation where several processes access and manipulate the same data concurrently, and the outcome depends on the order of access
critical section
portion of a process's code where shared data is accessed or modified
critical section problem
each process must request permission to enter its critical section (entry section), execute it, then perform an exit section before the raminder section. Difficult in preemptive kernels
Peterson's solution
software based solution for two processes that ensures mutual exclusion using shared variables turn and flag[2]
Peterson's variables
turn: indicates whose turn it is to enter the critical section
flag[i]: true if process Pi is ready to enter the critical section
atomic operation
a hardware instruction that executes as a single, non-interruptible unit of work
lock solution
uses a lock variable. Proccess must acquire the lock before entering the critical section and release it afterward
test-and-set instruction
atomic operation used for synchronization. Sets a boolean variable to TRUE and returns its old value. Used to implement locks without busy waiting
swap instruction
atomic operation that swaps the values of two boolean variables, used to implement mutual exclusion
semaphore
synchronization tool that does not require busy waiting. Controlled through only two operations: wait() and signal()
counting semaphore
semaphore with an unrestricted integer value; can allow multiple resources to be available
binary semaphore
semaphore restricted to a 0 or 1, functioning like a simple lock
deadlock
occurs when two or more processes wait indefinitely for an event that only one of them can cause
starvation
condition where a process never gets access to necessary resources because others keep taking priority
priority inversion
situation where a lower-priority process holds a lock needed by a higher-priority process, causing delays
bounded buffer problem
a sychronization problem where producers and consumers share a fixed-size buffer. Must ensure producers don't add to a full buffer and consumers don't remove from an empty one
readers-writers problem
synchronization problem where multiple readers can access shared data simultaneously, but writers require exclusive access
monitor
a high-level synchronization construct that allows only one process to be active inside it at a time
monitor condition variables
used within monitors to manage process suspension and resumption (e.g. condition x, y;)