Exam 2 Flashcards
Interrupt
The type of exception that is generated by an I/O device. Example: I/O device completes request
Trap
The type of exception that occurs intentionally as a result of executing an instruction. Example: User program opens a file
Fault
If a process causes an access to data or instruction that is not currently in main memory. Example: Read of a instruction not currently in main memory
Abort
If a process causes an access to corrupted data or instructions. Example: Hardware error
Concurrent processing (Multitasking)
Single processor executes multiple processes concurrently. Register values for nonexecuting process saved in memory
Parallel processing (Multiprocessing)
Parallel processing is a type of concurrent processing where more than one set of instructions is executing simultaneously.
Logical control flow
Each program seems to have exclusive use of the CPU, provided by kernel mechanism called context switching.
Private virtual address space
Each program seems to have exclusive use of main memory. Provided by kernel mechanism called virtual memory
User vs. Kernel mode
In User mode, the executing code has no ability to directly access hardware or reference memory.
In Kernel mode, the executing code has complete and unrestricted access to the underlying hardware.
Context Switch
Processes are managed by a shared chunk of memory resident OS code called the kernel. Important: the kernel is not a separate process, but rather runs as part of some existing process. Control flow passes from one process to another via a context switch
zombie
When process terminates, it still consumes system resources. Examples: Exit status, various OS tables. Called a “zombie”. Living corpse, half alive and half dead
Signal
A small message that notifies a process that an event of some type has occurred in the system
Pending Signal
A signal that has been sent but not received yet; there can be at most one pending sending of a particular type. Any more are discarded
Blocked Signal
When a signal is blocked, it can be delivered, but the resulting pending signal will not be received until the process unblocks the signal.
Sending Signals
Every way to send a signal relies on the idea of a process group. Every process belongs to exactly one group, obtained by the getpgrp function. Setpgid can change process ID
Receiving Signals
When the kernel switches a process to user mode, it checks the set of unblocked pending signals, and if there are none, it passes control to the next instruction. If there are pending signals, it forces the process to receive the signal
Catching Signals
Signals have default actions that can be overridden with signal handlers
sigprocmask, sigfillset, sigemptyset, sigaddset, sigdelset
sigprocmask - Changes the set of currently blocked signals
sigfillset - initializes a signal set to contain all signals
sigemptyset - initialize a signal set to contain NO signals
sigaddset - add a signal s to a set S via sigaddset, S=S∪{s}
sigdelset - remove a signal s from a set via sigdelset, S=S{s}
alarm
A function that sends the SIGALRM signal
Arranges for the kernel to send a SIGALRM signal to the calling process in (secs) seconds.
atexit
Executed every time an application is about to shut down
getpid
Returns the process ID of the calling process. This is often used by routines that generate unique temporary filenames.
getppid
Returns the process ID of the parent of the calling process. If the calling process was created by the fork() function and the parent process still exists at the time of the getppid function call, this function returns the process ID of the parent process. Otherwise, this function returns a value of 1 which is the process id for init process.