OS Flashcards
sharing resources across users/programs by taking turns(time share)
Multiplexing
sharing resources by dividing them up (space share)
Space multiplexing
_____ connects the CPU/memory/I/o devices
System bus
software that runs in kernel mode (mostly). It manages all the hardware and provides programmers an interface to manage hardware. They have a user mode and kernel mode
- Processes
- Memory management
- I/o device management
Operating system (OS)
Processors (CPU) fetches instructions from memory and runs it. They have registers. Can execute more than one command at a time using a pipeline.
What are the 3 main steps that repeat?
-fetch
-decode
-execute
____ fetches instructions from memory and runs it
Processors
they store data locally to speed up processing
Registers
A type of register. memory address of next instruction to fetch
Program counter
(register) - points to the current stack in memory. Holds input parameters, local variables, and temp variables that are not kept in general registers.
Stack pointer
User programs run in ______ (which can only use a subset of the available instructions)
user mode
a user program makes a _______ ____ to invoke the OS
system call
____ allows the CPU to hold the state of different threads and switch back and forth at a nanosecond time scale
Hyperthreading
Memory Types
These are in order of fastest to slowest:
- Registers (no delay in access)
- Cache (L1/L2)
- Main memory
- SSD/hard drive
____ _____ have a penalty of tens to hundreds of cycles when being accessed.
Cache misses
Which cache is faster? L1 or L2?
L1
is faster, but also much smaller in size (8 KB to 64 KB)
Located on the processor chip
______ a container holding all the info needed to run a program.
What are things are contained in it?
Process
Holds:
- Address space (memory location where it can read/write)
- Executable program, data, and its stack
- Registers, program counter, stack pointer
- Open files
- Related processes
- Outstanding alarms
An array that holds info about each process
Process Table
used to request that data is retransmitted over the network when a process doesn’t get a response
Alarm Signal
___ are the software version of hardware interrupts
Signals
Alarm Signal
used to request that data is retransmitted over the network when a process doesn’t get a response
Memory that holds executing programs
Address Space
___ is done when one program is moved out of the address space so another program can be moved there (to the main memory).
Swapping
___ can connect two processes. Note that processes in the ___ expression may all be started at once, but they’ll be set to blocked until their input is ready
pipe
_______ ___ are the file read write and execute numbers. Ex: 640
Protection bits
Sh, csh, ksh, bash, zsh. These are each _____
shells
Which call can use the kernel?
Procedure call or system call?
System calls
A built-in bash command that is used to execute a command when the shell receives any signal is called a ___. It can respond to signals
trap
List the name of some common signals
SIGINT - means a process was interrupted
SIGKILL/SIGTERM - a process was explicitly killed by the kill program
SIGCONT - If a process has been paused by sending it SIGSTOP then sending SIGCONT to the process wakes it up again
SIGXCPU- happens if a process exceedes it’s CPU limit
Where is the L2 cache located?
How big is it?
On the mother board
Size: 256 KB to 16 MB
The operating system has a _____ to run commands. Then it has a __ __ _____to return control to the program that needed the OS to do work. Note that these live in the kernal space.
dispatcher
sys call handler
Portable Operating System Interface has 100 procedure calls
POSIX
______
- Only way to creat a new process in posix
- Creates an exact duplicate of a process, including all files, descriptors, registers, etc.
- After that, changes to each process are independent
- Returns the PID (process id)
Fork
____ __ _____
Two processes share a space in memory until a change is made, then a copy is created.
copy on write
The ______ _____ contains these three segments:
- Text segment (code)
- Data segment (variables) (grows up)
- Stack (grows down)
processes memory
What does L2 cache store?
It stores data and instructions that are not currently being accessed by the processor, but that may be needed in the near future
Where is L1 cache located?
On the processor (CPU)