M2: Operating Systems Overview Flashcards
Kernel
one of two core components of OSs (with the file system)
File management system
one of two core components of OSs (with the
kernel). 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
the 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.
User mode
applications in user mode can only run instructions that affect its
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
Privileged machine instructions
have global effects on your whole computer and external devices. Examples include (1) writing data to disks and (2) 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 model for processes. Each process has its own address space = virtual address space, to distinguish it from physical address. Consists of five segments, including (1) Code, (2) Data, (3) Heap, (4) Stack, and (5) Kernel space.
Code
a segment of the process address space that is, by convention, 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. It points to the address of
the next instruction to execute in the Code segment.
Data
segment of the process address space that, by convention, is stored
in the memory locations just above the Code segment. Stores
statically-defined variables.
Heap
a segment of the process address space that, by convention, is stored
in the memory locations just above the Data segment. Stores dynamically
allocated memory. Grows and shrinks at runtime during program execution,
for example using malloc() and free() system calls in C.
Stack
a segment of the process address space that, by convention, is stored
in the memory locations just above the Heap segment. Stores temporary
values required during function calls and pops them off once the function
completes.
Kernel space:
a segment of the process address space that, by convention,
is stored in the memory locations 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.