370 midterm lectures

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

1/113

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:32 PM on 10/5/23
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

114 Terms

1
New cards

operating system

provide user programs with a better, simpler, cleaner model of the computer

2
New cards

operating system

manage resources efficiently

3
New cards

kernel

What mode does the operating system reside in ?

4
New cards

F

The operating system is a user interface program (T/F)

5
New cards

user

what mode does all non-OS software run in?

6
New cards

Instruction set, memory organization, I/O, and bus structure

four elements of computer architecture

7
New cards

NEC PD765

floppy disk controller that supports 16 commands for managing floppy disks

8
New cards

T

Operating systems are designed to translate a frustrating hardware interface into a usable interface for application programs (T/F)

9
New cards

referee

Which role of the OS isolates applications from each other?

10
New cards

illusionist

which role of the OS provides an abstraction of the physical hardware to simplify application design?

11
New cards

F (the illusionist can do this invisibly)

The OS cannot change the amount of resources assigned to each application (T/F)

12
New cards

Glue

Which role of the OS provides a set of common services to facilitate sharing among applications?

13
New cards

Glue

cut-and-paste is an example of which OS role

14
New cards

Referee, Illusionist, Glue

What are the three roles of an Operating System?

15
New cards

referee

provide orderly and controlled allocation of resources to programs competing for them (processors, memories, and I/O devices)

16
New cards

resource allocation (referee)

management of numerous & conflicting requests in a system of scarce and expensive resources. Ensuring efficient and fair distribution that MUST increase overall system throughput

17
New cards

fault isolation

requires restricting the behavior of applications to less than the full power of the underlying hardware

18
New cards

debugging

__________ would be vastly harder if an error in one program could corrupt data structures in other applications (isolation by the OS referee is important)

19
New cards

F (while the referee does intentionally isolate, it also allows for communication when deemed necessary)

the referee does not allow communication between different applications and different users (T/F)

20
New cards

T

A particular application can have differing amounts of resources from time to time, even when running on the same hardware (T/F)

21
New cards

kernel

the one program that is running all the time

22
New cards

5 million (application programs such as GUI, libraries and application software 10-20x as many lines)

About how many lines of code are in the kernel of an OS like Linux or Windows?

23
New cards

CPU, memory, I/O

Three main subsystems of a computing machine (Von Neumann Architecture)

24
New cards

electrons

at its core, modern computers harness the movement of __________ in circuits to carry out computations

25
New cards

F (only voltages, currents, switches, and malleable materials)

Internally, at the hardware level, the computer processes numbers and symbols (T/F)

26
New cards

processors

brain of the computer

27
New cards

key variables and temporary results

In order to decrease memory accesses, what do registers hold?

28
New cards

program counter

register than contains the memory address of the next instruction to be fetched

29
New cards

stack pointer

points to the top of the current stack in memory

30
New cards

program status word

register that stores condition code bits and other control code bits, plays an important role in system calls and I/O

31
New cards

high-speed cache

Where are most heavily used cache lines stored?

32
New cards

cache hit

refers to a situation where the requested data is found in the cache memory, resulting in faster access compared to retrieving the data from the main memory or disk storage. It helps improve system performance by reducing the time needed to fetch data.

33
New cards

cache miss

occurs when the requested data is not found in the cache memory and needs to be fetched from a higher level of memory hierarchy, such as main memory. This can result in longer access times and decreased performance.

34
New cards

OS caching examples

  1. pieces of heavily used files in main memory

  2. conversion of file names to disk addresses

    1. addresses of web pages (URLs) as hosts

35
New cards

main memory

also known as RAM (Random Access Memory), is a type of computer memory that is directly accessible to the CPU (Central Processing Unit). It is used to store data and instructions that are actively being used by the computer. It is volatile, meaning that its contents are lost when the computer is powered off or restarted. It is much faster than secondary storage devices such as hard drives or solid-state drives, but it has a limited capacity compared to them.

36
New cards

decreases

in the storage system hierarchy as cost per bit increases access time ________

37
New cards

processor cycle, cache access, memory access, context switch, disk access, quantum

Peripheral devices in order of speed (low to high)

38
New cards

F

Disk access times have decreased exponentially over time (T/F)

39
New cards

T

Processor speeds have grown exponentially over time (T/F)

40
New cards

they become obsolete

If memory technology makes memories much faster than CPU, what will happen to caches?

41
New cards

T

everything other than the kernel is running in a restricted environment (T/F)

42
New cards

privileged instructions

instructions available in kernel mode, but not in user mode

43
New cards

memory protection

all memory accesses outside of a process’s valid memory region are prohibited when executing in user mode

44
New cards

timer interrupts

regardless of what the process does, the kernel must have a way to periodically regain control from the current process

45
New cards

F

When set to 0, the processor is in kernel mode and can do anything (T/F)

46
New cards

privileged operation

resetting the timer is a _______ _________

47
New cards

interrupts, processor exceptions, and system calls

three reasons for the kernel to take control from a user process

48
New cards

asynchronous

interrupts (triggered by external events which can cause a transfer to kernel mode) are what type of event

49
New cards

Synchronous

Processor exemptions and system calls (triggered by process execution such as division by 0) are what type of event

50
New cards

interrupt (ex: kernel notifies the user process that the user was “mousing” across)

what does almost every I/O device generate whenever some input arrives for the processor and whenever a request completes.?

51
New cards

saves

if the processor detects that an interrupt has arrived it _______ the execution state

52
New cards

processor exceptions

a hardware event caused by user program behavior that causes a transfer of control to the kernel

53
New cards

examples of processor exceptions

a process…

attempts to perform a privileged instruction

accesses memory outside of its own memory region

causes an arithmetic overflow (divide by zero)

accesses a word of memory with a non-aligned address

attempts to write to read-only memory

54
New cards

system call

any procedure provided by the kernel that can be called from the user level such as a connection to a web server.

55
New cards

extreme version of defensive programming

always assume that system call parameters are intentionally designed to be as malicious as possible

56
New cards

interrupt vector table

a table that contains memory addresses or pointers to the interrupt service routines (ISRs) for different types of interrupts. When an interrupt occurs, the processor looks up the corresponding entry in the interrupt vector table to find the address of the ISR that should be executed.

57
New cards

different types of processor exemptions (divide-by-zero)

Entries 0 - 31 of the interrupt vector table on the x86

58
New cards

different types of interrupts (timer, keyboard, etc.)

Entries 32 - 255 of the interrupt vector table on the x86

59
New cards

asymmetric multiprocessing

different processors have different roles and responsibilities. In this system, one processor controls and manages the overall system, while the other processors perform specific tasks assigned by the control processor.

60
New cards

symmetric multiprocessing

multiple processors are connected to a single shared memory. Each processor has equal access to all resources and has their own set of registers and local cache (Supported by virtually all modern OS)

61
New cards

F

UNIX programs need to be aware of where their input is coming from, and where their output is going (T/F)

62
New cards

Ctrl-c

interrupt character

63
New cards

&

when appended to the end of a command upon execution this symbol will allow the command to start, but the shell won't wait for it to finish. Instead, it immediately provides you with a new prompt, allowing you to continue entering other commands.

64
New cards

background

what type of process allows you to continue working in the terminal without waiting for the command to finish?

65
New cards

daemon

processes that run indefinitely in the background, often performing system-related tasks or providing services.

66
New cards

POSIX

a set of standards and specifications that define a common interface and functionality for Unix-like operating systems.

67
New cards

independent

type of process that cannot affect or be affected by other processes

68
New cards

cooperating

type of process that can affect or be affected by other processes

69
New cards

shared memory

region of memory that can be written from and read to by cooperating processses

70
New cards

F

Independent processes use shared memory (T/F)

71
New cards

cooperating

Which is faster, independent or cooperating processes?

72
New cards

address space of process creating it

where does shared memory reside?

73
New cards

buffer (which is a shared memory region)

A _____ can solve the producer-consumer problem by allowing producer and consumer to run concurrently. The producer fills while the consumer empties.

74
New cards

consumer

If the buffer size is fixed and the buffer is empty who is waiting?

75
New cards

producer

If the buffer size is fixed and the buffer is full, who is waiting?

76
New cards

consumer

If the buffer size is NOT fixed and the buffer is empty, who is waiting?

77
New cards

nobody (since the buffer is not fixed it cannot be full so producer never has to wait)

If the buffer size is NOT fixed and the buffer is not empty, who is waiting?

78
New cards

in == out

buffer is empty when

79
New cards

out = (out+1) % BUFFER_SIZE

equation to calculate the value of out after consuming

80
New cards

in = (in+1) % BUFFER_SIZE

equation to calculate the value of in after consuming

81
New cards

bounded

Is a circular buffer bounded or unbounded?

82
New cards

(in+1) % BUFFER_SIZE == out

buffer is full when

83
New cards

shmat()

method to attach to shared memory

84
New cards

pointer to beginning location in memory

what doe shmat(id, asmP, mode) return?

85
New cards

shmget()

method to create a shared memory segment

86
New cards

ID of shared memory segment

what does shmget(IPC_PRIVATE, size, S_IRUSR | S_IWUSR) return?

87
New cards

* from shmat()

how do you access values in shared memory?

88
New cards

sprintf()

method to write to shared memory

89
New cards

printf() (print shared memory pointer)

method to print from shared memroy

90
New cards

shmdt()

method to detach from shared memory

91
New cards

shmctl()

method to remove a shared memory segment

92
New cards

shared memory, hardware bus, network

three physical implementations for message passing

93
New cards

direct

type of communication that explicitly names recipient or sender

94
New cards

indirect

type of communication where messages are sent and received from mailboxes (ports)

95
New cards

Inter-Process Communications

allows processes to communicate and synchronize actions without sharing the same address space

96
New cards

Local Procedure Call

Windows XP mechanism for inter-process communication

97
New cards

port objects

In LPC, the thing that allows for communication channels between processes

98
New cards

small, large

In Windows XP, ____ messages use the port’s internal message queue for intermediate storage while ____ messages are sent through a section object (sets up shared memory)

99
New cards

pipes

conduit for communications between processes

100
New cards

half duplex

data can travel one way at a time