332 Flashcards

1
Q

What is idempotent?

A

It is when we have a process that can receive one request but perform the task twice and NO PROBLEMS will be produced.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is non-idempotent?

A

It is when we have a process that can receive one request but perform the task twice AND PROBLEMS WILL BE PRODUCED.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the steps that occur when doing a fork() ?

A

a) The child creates a copy of the parent process
b) The child’s process context is set
c) The child is allocated resources
d) Copy the instructions the child is to perform into its memory space
e) The child is started

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the problems with a low quantum in Round Robin scheduling?

A

Excessive context switching, lower throughput, increased turnaround time, poor cache utilization

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the problems with a high quantum in Round Robin scheduling?

A

Poor responsiveness (processes wait too long), starvation of smaller processes, degenerates into FIFO

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are some possible process states?

A

RUNNING, READY, BLOCKED, DEADLOCKED

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does a Process Control Table contain (PCB) ?

A
  • PID
  • PPID
  • USER ID
  • PROCESS STATE
  • PRIORITY
  • EVENT FOR WHICH THE PROCESS IS WAITING (IF BLOCKED)
  • PAGE TABLE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What performance issues are introduced when multi-core processor schedules threads for execution? How do these issues interfere with each other?

A

Dividing the activity among the cores

LOAD BALANCING. Are the cores achieving equal work of equal value?

DATA SPLITTING. Do cores need to share data? Can one core work on one part of a data structure, while another works on another part? What if they are on the same part of memory, but not logically related?

DATA DEPENDENCY. Coordination and communication is required. Complex schedulers may be needed to control that communication and determine how to manage the ready queue for maximum efficiency.

TESTING/DEBUGGING

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Scheduling priorities can be based on what?

A

MEMORY REQUIREMENTS.

TIME ALREADY TAKEN.

EXPECTED TIME TO COMPLETE.

EXTERNAL PRIORITIES (USER ASSIGNED).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why does virtualization matter?

A
  • Isolation (restrict resources given to service)
  • Fault-tolerance (Failure of one service does not bring down entire machine)
  • Load Balancing (may want to move a service from computer to another)
  • Amortize hardware expenditure/energy utilization (multiplex services on smaller machine)
  • Support legacy applications without backwards compatibility
  • Multi-platform software development
  • Cloud services
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are some problems virtualization faces?

A
  • Sensitive vs privileged instructions (proper trap from usermode)
  • Binary translation (replace sensitive instructions at runtime via emulation)
  • Paravirtualization (uses hypercalls, Guest makes requests to hypervisor, uses modified guest OS)
  • Process virtualization (process thinks it’s running on a different OS)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the types of hypervisors?

A

Type I - Runs on bare metal, hypervisor runs as the “OS”, guest OS has direct access to hardware
Type II - Relies on a host OS. Uses a non-modified ISO file to install the guest OS on a virtual disk. Guest OS has to make calls to host OS to use hardware, does NOT have direct access to hardware.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the 5 NIST definitions?

A
  • On demand self-service
  • Broadband network access (standard protocols)
  • Resource pooling (resources allocated dynamically)
  • Rapid elasticity (automatic scaling to user needs)
  • Measured service (matches service level agreement of both parties)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the classes of Client/Server Applications?

A
  • Host-based processing (traditional mainframe environment, not true client/server computing)
  • Server-based processing (server does all processing)
  • Client-based processing (all application processing done on client)
  • Cooperative processing (application processing is performed in an optimized fashion)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a soft link (symbolic link) and a hard link?

A
  • A hard link is a direct reference (alias) to the file’s data blocks
  • A symbolic link is a pointer to the original file’s path or location
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Name the two file types.

A
  • Typed
  • Untyped
17
Q

What does a user have to be able to do to use a filesystem?

A
  • Read
  • Write
  • Create
  • Delete
18
Q

What types of directories are there?

A
  • Single-level directories (no sub directories, no concept of files owned by another user)
  • Two-level directories (users now have their own directories, but can’t share if we want to)
  • Tree-structured directories (each user is now allowed their own sub-directories)
  • Acyclic graph directories (extension of tree-structured, two directories can contain same file or directory)
19
Q

What are the 3 file allocation methods?

A
  • Contiguous file allocation (file occupies contiguous blocks)
  • Linked file allocation (linearly linked usually non-contiguous blocks)
  • Index file allocation (pointers to file blocks now in index block, directory points to index block for each file)
20
Q

How does a system keep track of free disk blocks?

A
  • Bit Vector/Bit Mask (works because blocks are 512 bytes each)
  • FSL (Free Space List)
21
Q

In what layer does standard file operations occur?

A
  • VFS (Virtual File System) Layer (open, close, read, write, seek)
22
Q

Name 4 types of I/O.

A
  • Programmed I/O (CPU actively controls all I/O operations by checking/polling the status of the I/O device in a loop called busy-waiting, and when the device is ready the CPU transfers data directly between the device and a register in the CPU)
  • DMA (Direct memory access) (A dedicated DMA controller handles data transfers between I/O devices and memory without involving the CPU, the CPU still sets up the DMA controller by giving it SOURCE, DESTINATION, and SIZE OF DATA, but the DMA does the actual transfer into memory, DMA notifies CPU when done)
  • Memory-Mapped I/O (I/O devices treated as memory locations, and specific memory addresses are assigned I/O devices. Reading or writing to these memory addresses controls the I/O device. CPU involved like in Programmed I/O but it’s more abstracted, as it uses it like memory)
  • Interrupt-Driven I/O (Device sends an interrupt signal to the CPU when it is ready for data transfer, instead of the CPU polling the device. When interrupted, CPU stops its current task, saves its state and executes an interrupt service routine (ISR) to handle the I/O request)
23
Q

What types of devices are there?

A
  • Character (send data byte-by-byte)
  • Block (send data in blocks of bytes)
  • Direct
  • Sequential
  • Communication
24
Q

What are the 3 measures of hard disk performance?

A
  • Seek time (time required to move a head from one track to another)
  • Rotational latency (the time required for the desired sector to spin under the head)
  • Transfer rate (the disk to memory data transfer rate, once the appropriate disk, surface, track and sector are located)
25
Q

Name the disk scheduling algorithms.

A
  • First come first serve (execute requests in order of arrival, a lot of head movement, fine for low volume disk I/O)
  • Shortest seek time first (execute request nearest to current head position, main problem is starvation under large volume)
  • SCAN (move head back and forth, executing requests as encountered, stops starvation, best for moderately loaded system)
  • CSCAN (just like SCAN except the head only moves in one direction, best algorithm for highly loaded system)
26
Q

Name the disk scheduling optimizations.

A
  • Sector Queuing (for rotational latency optimization)
  • SLTF (shortest latency time first)
  • “Track at a time” caching (read entire track the sector resides on and place in RAM)
  • Native-Command Queuing (hard-drive optimizes internally to decrease latency)
27
Q

Name memory management schemes.

A
  • Bare Metal (application owns all memory, application can write to any memory location)
  • Resident Monitor (placed top or bottom of memory, divides memory into monitor and user application, protects the OS from modification)
  • Static relocation (all addresses the load module are calculated assuming the object were to be loaded starting at address 0)
  • Dynamic relocation (each memory reference is bound to its physical address at execution time, right before the instruction is executed)
  • Swapping (allows monitor to switch from process to process, it swaps to and from disk)
  • Background Swapping (do disk transfers during execution of application)
  • Swapping with Partitions (copy some information at context switch time, swapping can now be done outside of user space with no copying)
28
Q

How is first-layer paging performed?

A
  • Divides fixed size blocks in virtual memory called pages, and fixed size blocks called frames in physical memory. The size of the page and frame are always the same.
  • Virtual address is divided into page number and page offset
  • If the virtual address is n bits long and the page size is 2^m bytes then the page number uses the UPPER (n - m) (left-most) bits of the virtual address. Page offset uses uses the LOWER m (right-most) bits of the virtual address.
    EX: VA is 16-bits long (64 KB of addressable memory) and page size is 2^12 bytes (4096 bytes) that would mean 2^16 / 2^12 = 2^4 pages, or 16 pages (pagenumbers).
  • OS maintains a page table for every process. There’s also a Translation Lookaside Buffer (TLB) that is a cache and is checked first instead of going into memory. This table is used to map Virtual Page Numbers (VPNs) to Physical Frame Numbers (PFNs). Each entry contains a Frame Number (index of the frame in physical memory), and other control bits (dirty bit, reference bit, etc)
  • Given the above, remember these (for single-tree);
  • VPN = VA / Page Size
  • Offset = VA % Page Size
  • PPN = single-tree-page-table[VPN]
  • PA = (PPN * Page Size) + Offset
29
Q

What are the 4 things an OS does?

A
  • Consume Resources
  • Manage Resources
  • Abstraction
  • Interfacing
30
Q

What is a page fault?

A
  1. Hardware traps to kernel, saves PC
  2. Save registers and other volatile data, calls page fault handler
  3. Get virtual page needed
  4. Check to see if page is valid, and if protection is consistent with the access (if not kill). If it is valid, get a free frame if there are some, if not select a victim
  5. If the victim is dirty, schedule for saving to disk & context switch to writing process
  6. Once it’s ready, look up the disk address where needed page is and schedule disk operations to bring it in
  7. When disk interrupt indicates page has arrived, page tables are updated & frame is marked as normal
  8. Faulting instruction backed up to state that failed
  9. Faulting process is scheduled, and OS returns to routine that called it
  10. Routine reloads registers and other state information
31
Q

What are the two ways to keep track of memory usage?

A
  • Bitmaps
  • Free lists
32
Q

What are the memory placement algorithms?

A
  • First Fit (occupy the first region of memory we find available)
  • Next Fit (same as first fit, but keeps track of where it is, so it searches the list from where it left off)
  • Best Fit (occupy the smallest region of memory we find available)
  • Worst Fit (occupy the biggest region of memory we find available)
33
Q

Name some RAIDs and what they are.

A
  • RAID 0 (Striping): Data is split across multiple drives, and each drive contains a portion of the data. No redundancy.
  • RAID 1 (Mirroring): Data is duplicated (mirrored) on two or more drives. High redundancy.
  • RAID 5 (Striping with Parity): Data is striped across multiple drives with one disk storing parity information, which can be used to recover data if one drive fails. High redundancy.
  • RAID 6 (Striping with Double Parity): Similar to RAID 5 but with two parity blocks, allowing recovery from up to two simultaneous disk failures. Very high redundancy.
34
Q

What are Bernstein’s concurrency conditions?

A

In order for two processes P1 and P2 to run concurrently, the following 3 conditions must hold:
- R(P1) cannot intersect W(P2)
- W(P1) cannot intersect R(P2)
- W(P1) cannot intersect W(P2)
NOTE: When Bernstein’s concurrency conditions fail, this creates a critical section