ECS 150 midterm 2

0.0(0)
studied byStudied by 3 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/72

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

73 Terms

1
New cards

SIGINT/SIGKILL

terminate process

2
New cards

SIGSEGV

terminate process and generate core dump

3
New cards

SIGCHLD

ignore signal

4
New cards

SIGSTOP

Stop process

5
New cards

SIGCONT

continue process

6
New cards

raise()

send signal to self (kinda like a function call)

7
New cards

kill()

send signal to other process

8
New cards

alarm()/setitimer()

set timer for self and receives signal (SIGALRM/SIGVTALRM) when timer is up

9
New cards

sigprocmask()

examine or change signal( blocking signals)

10
New cards

sigpending()

examine pending blocked signals (blocking signals)

11
New cards

sigaction()

map signal handler to signal

12
New cards

pause()

suspend self until signal is received

13
New cards

malloc()/free()

dynamic memory allocation

14
New cards

When heap is full

it syscall to kernel to request for more space

15
New cards

sbrk()/brk()

linear increase of data segment

16
New cards

mmap()

map pages of memory in process and can map file contents

17
New cards

preprocessor(cpp)

transform program before compilation

18
New cards

compiler(cc)

compiles a program into assembly code

19
New cards

assembler(as)

compiles assembly code into relocatable object file

20
New cards

linker(ld)

links object files into an executable

21
New cards

API( application programming interface)

interface between pieces of code

22
New cards

UAPI(User API)

syscall interface between pieces of code

23
New cards

HAL(hardware abstraction layer)

interface inside kernel between arch-independent code and arch-dependent code

24
New cards

IS(instruction set architecture)

list of processor instructions

25
New cards

ABI(application binary interface )

interface between code and processor

26
New cards

Monolithic kernel

entire kernel code linked together in a single large executable

27
New cards

what are the pros and cons of Monolithic kernel

great performance but increased potential for instability like crashes

28
New cards

microkernel

communicates with services using message passing

29
New cards

what are the pros and cons of micro-kernel

great fault isolation but inefficient

30
New cards

Hybrid kernel

Trusted OS services implemented in kernel and Non-trusted OS services implemented as regular user- space processes

31
New cards

Kernel mode

Execution with full privileges on the hardware

32
New cards

what are some executions that kernel mode can do

Read/write to any memory location, Access to any I/O device, Read/write to any disk sector, Send/receive any packet

33
New cards

User mode

limited privileges on the hardware

34
New cards

native execution

Run unprivileged code directly on the CPU and is very fast execution

35
New cards

Memory protection

Prevent process from overwriting kernel's or other processes' memory

36
New cards

Timer interrupts

Prevent running process from hogging hardware and Kernel periodically regains control on CPU

37
New cards

Mode switch

From user mode to kernel mode, and vice-versa

38
New cards

Privileged instructions

Instructions only available to code running in kernel mode and processor traps(mod switching) if user code tries to execute privileged instruction

39
New cards

hardware timer

periodically interrupts the processor

40
New cards

what does it mean when a transition must be atomic?

one unbreakable logical step

41
New cards

Trap vector

provides limited number of entry points into the kernel

42
New cards

Kernel stack

kernel has it’s own stack, located in kernel memory and different from process’ stack. Also one kernel stack per process.

43
New cards

context saving

kernel stack is used to save associated process context

44
New cards

process

is the abstraction used by the OS to execute programs

45
New cards

features of a process

Protection against other processes,

Isolation from OS/kernel

Intuitive and easy-to-use interface (syscalls)

Portable, hides implementation details

Can be instantiated many times

Efficient and reasonable easy to implement

46
New cards

Address space

Each process has its own memory address space

47
New cards

Environment

Defined in PCB, Determines all the specific characteristics of a process

48
New cards

Execution flow

Single sequential execution stream, Statements executed in order, Can only be at one location in the code at a time, Can only be (slightly) disrupted by signals

49
New cards

what is the scheduler in charge of

determining which process should run

50
New cards

cooperative

process can hold onto cpu during long cpu bursts

51
New cards

preemptive

process can be forcefully suspended even during long CPU bursts

52
New cards

Process state: ready

after fork is called and is ready to execute. will be in this state until it’s elected to run by scheduler

53
New cards

Process state: running

the process is now executing instructions. (3 things can happen)

54
New cards

submission time

time at which a process is created

55
New cards

Turnaround time

total time between process submission and completion

56
New cards

Response time

time between process submission and first execution or first response

57
New cards

Waiting time

total time spent in the ready queue

58
New cards

FCFS (or FIFO)

takes the first process that arrives

59
New cards

SJF

Shortest Job First . takes the shortest process to execute. Optimal scheduling but requires to know task lengths in advance

60
New cards

Preemptive SJF

Also known as SRTF (Shortest Remaining Time First). New shorter jobs can interrupt longer jobs

61
New cards

Round-robin (RR)

asks run only for a (short) time slice at a time

Relies on preemption (via timer interrupts) and prevents starving

62
New cards

starvation

when a process is unable to run because of another process’ runtime

63
New cards

concurrency

the composition of independently executing tasks and is opposite to sequential execution

64
New cards

Types of concurrency

CPU burst and I/O burst

65
New cards

CPU virtualization

Processes interleaved on same CPU

66
New cards

I/O concurrency

I/O bursts overlapped with CPU bursts

Each task runs almost as fast as if it had its

own computer

Total completion time reduced

67
New cards

CPU parallelism

Requires multiple CPUs

Processes running at the SAME TIME simultaneously

Speedup

68
New cards

speedup

decrease it the time it takes for a process to run. Ideally linear, often sublinear due to bottle necks. Could be superlinear.

69
New cards

Process concurrency limitations

quite heavy for the OS to fork a process, Slow context switch, Difficulty to communicate between processes

70
New cards

Threads

Single execution sequence that represents a separately scheduled task. Usually one or more threads per process

71
New cards

PCB

Process Control Block. has the PID, Owner, priority, current working directory, active thread, pointers to thread control blocks,

72
New cards

TCB

Thread Control Block. has the tack pointer, PC, thread state, register values, pointer to PCB

73
New cards

context switch

change from one process to another