EXAM2

35 flashcardsby bauniee
Study these flashcardsFree · spaced repetition · iPhone, Android, Mac & web

All cards

1
an abrupt change in control flow in response to some change in the processors state
Interrupt
2
1. Original program processes
2. Event occurs
3. An indirect procedure call is made through the jump table to an operating system subroutine (interrupt handler)
4. interrupt returns
Steps of an interrupt
3
Operating system subroutine that deals with interrupts (like a function)
Interrupt Handler
4
an array of indexes corresponding to addresses to interrupt handlers created at system boot, AKA exception table
Jump table
5
1. Interrupt returns to the old process and moves on
2. returns to instruction that was trying to execute before the interrupt, retries it
3. returns and moves on to a completely different program (essentially terminating the original program)
What are the 3 ways to return from an interrupt?
6
Divide by zero or segmentation fault, any hardware issue
Hardware interrupts
7
Service calls, anything OS related
Operating system interrupts
8
-return address is a far address so it can return with a intersegment jump
-allows jump from kernel to process
-processor saves the program status in a word
- runs in kernel with an elevated privilage
Interrupt characteristics
9
Often these happen not at the same time, triggered by I/O devices like the keyboard
Device interrupt
10
Intentional exceptions that occur as the result of executing instruction, if the handler corrects it will return to the faulty instruction and retry, ex: page fault
Fault
11
When a virtual address is referenced that doesnt have a page on memory. (it has to be retrieved from disk)
Page fault
12
Traps are wrapped up into functions like read(), open(), and write()
Linux system calls
13
Instance of a program in execution, They have an independent logical control flow and private address space
Process
14
Two flows whose execution overlap in time.
Concurrency
15
a process taking turns with other processes
multitasking
16
two processes on different processors running at the same time
Parallelism
17
The OS sets up mappings between a processes logical memory and RAM, Processes only see memory through mapping
Logical memory
18
What library are fork and execve in
unistd
19
Clones the process, it's file descriptors, it's process group ID, it's memory space, pretty much everything
Fork
20
When fork returns 0
child
21
when fork returns the childs process ID
Parent
22
An unreaped child (when the parent doesn't use wait())
Zombie
23
Allows to child to see it's own process ID
getpid()
24
Waits for any child to end - Non-deterministic
wait()
25
waits for a specific child to end
waitpid()
26
What do you include to use wait
#include <sys/wait.h>
27
Path, arguments, null terminator
Argv
28
replaces code with an execution of a command line statement
execve(argv[0],argv, 0)
29
higher level software form of exceptions that allow processes + kernel to interrupt other processes,
allows processes to catch interrupts
signals
30
kernel forces destination process to react to signal
ignore, terminate, or handle it with a user level function
recieving signals
31
sent but not recieved, only one can exist for each type of signal
pending signals
32
processes can block the reciept. they are delievered but no response
blocking signals
33
How do you get the process group of which the child and parent are the same
getpgrp()
34
in/kill -9 15213
in/kill -SIGKILL 15213
in/kill -KILL 15213
command line kill
35
kill(pid, SIGKILL)
kill system call
Study all 35 cards for free