1/113
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
operating system
provide user programs with a better, simpler, cleaner model of the computer
operating system
manage resources efficiently
kernel
What mode does the operating system reside in ?
F
The operating system is a user interface program (T/F)
user
what mode does all non-OS software run in?
Instruction set, memory organization, I/O, and bus structure
four elements of computer architecture
NEC PD765
floppy disk controller that supports 16 commands for managing floppy disks
T
Operating systems are designed to translate a frustrating hardware interface into a usable interface for application programs (T/F)
referee
Which role of the OS isolates applications from each other?
illusionist
which role of the OS provides an abstraction of the physical hardware to simplify application design?
F (the illusionist can do this invisibly)
The OS cannot change the amount of resources assigned to each application (T/F)
Glue
Which role of the OS provides a set of common services to facilitate sharing among applications?
Glue
cut-and-paste is an example of which OS role
Referee, Illusionist, Glue
What are the three roles of an Operating System?
referee
provide orderly and controlled allocation of resources to programs competing for them (processors, memories, and I/O devices)
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
fault isolation
requires restricting the behavior of applications to less than the full power of the underlying hardware
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)
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)
T
A particular application can have differing amounts of resources from time to time, even when running on the same hardware (T/F)
kernel
the one program that is running all the time
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?
CPU, memory, I/O
Three main subsystems of a computing machine (Von Neumann Architecture)
electrons
at its core, modern computers harness the movement of __________ in circuits to carry out computations
F (only voltages, currents, switches, and malleable materials)
Internally, at the hardware level, the computer processes numbers and symbols (T/F)
processors
brain of the computer
key variables and temporary results
In order to decrease memory accesses, what do registers hold?
program counter
register than contains the memory address of the next instruction to be fetched
stack pointer
points to the top of the current stack in memory
program status word
register that stores condition code bits and other control code bits, plays an important role in system calls and I/O
high-speed cache
Where are most heavily used cache lines stored?
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.
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.
OS caching examples
pieces of heavily used files in main memory
conversion of file names to disk addresses
addresses of web pages (URLs) as hosts
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.
decreases
in the storage system hierarchy as cost per bit increases access time ________
processor cycle, cache access, memory access, context switch, disk access, quantum
Peripheral devices in order of speed (low to high)
F
Disk access times have decreased exponentially over time (T/F)
T
Processor speeds have grown exponentially over time (T/F)
they become obsolete
If memory technology makes memories much faster than CPU, what will happen to caches?
T
everything other than the kernel is running in a restricted environment (T/F)
privileged instructions
instructions available in kernel mode, but not in user mode
memory protection
all memory accesses outside of a process’s valid memory region are prohibited when executing in user mode
timer interrupts
regardless of what the process does, the kernel must have a way to periodically regain control from the current process
F
When set to 0, the processor is in kernel mode and can do anything (T/F)
privileged operation
resetting the timer is a _______ _________
interrupts, processor exceptions, and system calls
three reasons for the kernel to take control from a user process
asynchronous
interrupts (triggered by external events which can cause a transfer to kernel mode) are what type of event
Synchronous
Processor exemptions and system calls (triggered by process execution such as division by 0) are what type of event
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.?
saves
if the processor detects that an interrupt has arrived it _______ the execution state
processor exceptions
a hardware event caused by user program behavior that causes a transfer of control to the kernel
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
system call
any procedure provided by the kernel that can be called from the user level such as a connection to a web server.
extreme version of defensive programming
always assume that system call parameters are intentionally designed to be as malicious as possible
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.
different types of processor exemptions (divide-by-zero)
Entries 0 - 31 of the interrupt vector table on the x86
different types of interrupts (timer, keyboard, etc.)
Entries 32 - 255 of the interrupt vector table on the x86
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.
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)
F
UNIX programs need to be aware of where their input is coming from, and where their output is going (T/F)
Ctrl-c
interrupt character
&
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.
background
what type of process allows you to continue working in the terminal without waiting for the command to finish?
daemon
processes that run indefinitely in the background, often performing system-related tasks or providing services.
POSIX
a set of standards and specifications that define a common interface and functionality for Unix-like operating systems.
independent
type of process that cannot affect or be affected by other processes
cooperating
type of process that can affect or be affected by other processes
shared memory
region of memory that can be written from and read to by cooperating processses
F
Independent processes use shared memory (T/F)
cooperating
Which is faster, independent or cooperating processes?
address space of process creating it
where does shared memory reside?
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.
consumer
If the buffer size is fixed and the buffer is empty who is waiting?
producer
If the buffer size is fixed and the buffer is full, who is waiting?
consumer
If the buffer size is NOT fixed and the buffer is empty, who is waiting?
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?
in == out
buffer is empty when
out = (out+1) % BUFFER_SIZE
equation to calculate the value of out after consuming
in = (in+1) % BUFFER_SIZE
equation to calculate the value of in after consuming
bounded
Is a circular buffer bounded or unbounded?
(in+1) % BUFFER_SIZE == out
buffer is full when
shmat()
method to attach to shared memory
pointer to beginning location in memory
what doe shmat(id, asmP, mode) return?
shmget()
method to create a shared memory segment
ID of shared memory segment
what does shmget(IPC_PRIVATE, size, S_IRUSR | S_IWUSR) return?
* from shmat()
how do you access values in shared memory?
sprintf()
method to write to shared memory
printf() (print shared memory pointer)
method to print from shared memroy
shmdt()
method to detach from shared memory
shmctl()
method to remove a shared memory segment
shared memory, hardware bus, network
three physical implementations for message passing
direct
type of communication that explicitly names recipient or sender
indirect
type of communication where messages are sent and received from mailboxes (ports)
Inter-Process Communications
allows processes to communicate and synchronize actions without sharing the same address space
Local Procedure Call
Windows XP mechanism for inter-process communication
port objects
In LPC, the thing that allows for communication channels between processes
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)
pipes
conduit for communications between processes
half duplex
data can travel one way at a time