Module 2: OS Overview Flashcards
kernel
one of two core components (with the file system)
file management system
one of three core components of OSs (with kernel and I/O component). all data in a computer is stored in the form of a file, and the OS helps maintain the file sizes, names, locations, directory structures, and file access rights
CPU
computer processing unit; circuitry to execute program instructions
CPU cycle
the cycle performed by the CPU to read a program instruction, execute it, and repeat it
user mode
applications in user mode can only run instructions that affect is own application; executing functions in the application’s code
kernel mode
allows privileged machine instructions to run. this mode is entered by flipping a bit on the CPU (TRAP)
privileged machine instructions
have global effects on your whole computer and external devices. examples: writing data to disks and running the logic that makes one application stop running, and instead start running another application
process
a program in execution. because there are limited CPU cycles and the OS needs to perform many tasks, the process concept allows OSs to switch between executing different tasks
process context
the snapshotted state of a process, which includes its data, memory utilization, and execution progress. the process context must be saved when the OS wants to stop running a process, and it gets reloaded when the OS resumes running the process
process management
a function of the OS kernel that manages applications using an abstraction called a process
address space
the memory organization for processes. each process has its own address space of five segments:
- code
- data
- heap
- stack
- kernel
code
segment of the process address space that is stored in the memory locations specified by the lowest addresses. consists of the instructions being executed for the process
program counter
register value stored in the CPU. points to the address of the next instruction to execute in the code segment
data
segment of the process address space that is stored in the memory locations just above the code segment. stores statically-defined variables
heap
segment of the process address space that is stored in the memory locations just above the data segment. stores dynamically allocated memory. grows and shrinks at runtime during program execution (malloc and free)
stack
stored just above heap segment. stores temporary values required during function calls and pops them off once the function completes
kernel space
stored just above the stack segment. reserved space for the OS and privileged code
process identification number (pid)
unique number assigned to each process by the OS
process table
contains an array of process control blocks and is maintained by the OS
process control block
each PCB stores the context of a single process
init process
the only process that exists when the OS is booted. all other processes are child processes of init
parent and child processes
hierarchical structure / parent creates child
PPID
PID of the process’ parent
copy-on-write
on the creation of a new process, the child shares the parent’s memory address space until a modification is required. on a modification, a distinct memory page is then created for the child
fork()
system call that creates a new process and gives an integer return value, which is used to differentiate between the child and parent processes that are simultaneously running the same code after the call
exec()
accepts a path name to a code file as an input and allows the child to execute this new piece of code
wait()
allows a process to wait for another process to finish completing, to give a signal, or to perform some other specified condition; settings are specified in the Linux man-pages
exit()
terminates the process in which the exit() command is invoked
process state
running: instructions for this process are being executed by the CPU
blocked: process is waiting on I/O to access, user input, or some other condition required to continue executing
ready: the process that has all it needs to run and is waiting for CPU access
signals
software interrupts sent from process A to process B to communicate an event that took place in process A. Process B can be set up to watch for certain signals and respond accordingly, depending on the application being run
superuser
an account with special permissions on a machine. the exact permissions depend on one’s OS
orphan process
a child whose parent process has been terminated but it (the child process) is still running
zombie process
if a child’s parent process has not called wait on it
daemon process
system-level processes that are started to run OS-specific management tasks
shell
an interface allowing the user to enter OS commands