Operating Systems Comprehensive Lecture Review

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

1/28

flashcard set

Earn XP

Description and Tags

Comprehensive practice flashcards covering Operating System fundamentals, process management, CPU scheduling, synchronization, deadlocks, memory management, virtual memory, secondary storage, and security.

29 Terms

1
New cards

What is an operating system, and what are its primary and secondary goals?

An operating system is a program that acts as an intermediary between a user of a computer and the computer hardware. Its primary goal is to make the computer system convenient to use, and its secondary goal is to use the computer hardware in an efficient manner.

2
New cards
<p>According to the abstract view of computer system components shown below, what are the four fundamental layers of a computer system?</p>

According to the abstract view of computer system components shown below, what are the four fundamental layers of a computer system?

The four fundamental components are the users (user 1,user 2,…,user n\text{user } 1, \text{user } 2, \dots, \text{user } n), system and application programs (such as compiler, assembler, text editor, database system), the operating system, and the computer hardware.

3
New cards

When was the first operating system implemented, by whom, and for which computer?

The first operating system was implemented in the early 1950’s1950\text{'s} by the General Motors Research Laboratories for their IBM 701701.

4
New cards

What are the five major operating system activities regarding process management?

  1. Creation and deletion of user and system processes.
  2. Suspension and resumption of processes.
  3. A mechanism for process synchronization.
  4. A mechanism for process communication.
  5. A mechanism for deadlock handling.
5
New cards

What components constitute a process in execution within the system?

A process includes the current value of the Program Counter (PC\text{PC}), the contents of processor registers, the value of variables, the process stack (SP\text{SP}) containing temporary data (subroutine parameters, return addresses, temporary variables), and a data section containing global variables.

6
New cards
<p>Identify the five process states and the valid transitions between them as depicted in this diagram.</p>

Identify the five process states and the valid transitions between them as depicted in this diagram.

The states are:

  • new: The process is being created.
  • ready: Waiting to be assigned to a processor (entered via admitted or interrupt/event completion).
  • running: Instructions are being executed (entered via scheduler dispatch).
  • waiting: Waiting for an I/O or event completion.
  • terminated: The process has finished execution (entered via exit).
7
New cards
<p>What is a Process Control Block (PCB), and what key fields does it store?</p>

What is a Process Control Block (PCB), and what key fields does it store?

A Process Control Block (PCB), or task control block, represents each process in the operating system. It stores the process state, process number, program counter, registers, memory limits, and list of open files.

8
New cards

Under which four circumstances do CPU scheduling decisions take place?

  1. When a process switches from the running state to the waiting state (e.g., I/O request or wait invocation).
  2. When a process switches from the running state to the ready state (e.g., when an interrupt occurs).
  3. When a process switches from the waiting state to the ready state (e.g., completion of I/O).
  4. When a process terminates.
9
New cards

What three major operations are performed by the dispatcher?

  1. Switching context.
  2. Switching to user mode.
  3. Jumping to the proper location in the user program to restart that program.
10
New cards

What five criteria are commonly used to compare CPU scheduling algorithms?

  1. CPU utilization
  2. Throughput
  3. Turnaround time
  4. Waiting time
  5. Response time
11
New cards
<p>How does Multilevel Queue Scheduling work, and what is the priority order of the process queues shown below?</p>

How does Multilevel Queue Scheduling work, and what is the priority order of the process queues shown below?

Processes are permanently assigned to a queue based on a property such as memory size, process priority, or process type. The algorithm chooses the process from the occupied queue with the highest priority (preemptively or non-preemptively). The hierarchy from highest to lowest priority is: system processes, interactive processes, interactive editing processes, batch processes, and student processes.

12
New cards

What is a race condition in concurrent processing?

A race condition occurs when several processes access and manipulate the same data concurrently and the outcome of the execution depends on the particular order in which the access takes place.

13
New cards

What three requirements must a solution to the critical-section problem satisfy?

  1. Mutual Exclusion: If process PiP_i is executing in its critical section, no other processes can be executing in their critical sections.
  2. Progress: If no process is executing in its critical section and some wish to enter, only processes not executing in their remainder section can participate in deciding which enters next, and this selection cannot be postponed indefinitely.
  3. Bounded Waiting: A bound must exist on the number of times other processes are allowed to enter their critical sections after a process has made a request to enter and before that request is granted.
14
New cards
<p>In what exact sequence must a process utilize a system resource, as illustrated in the cycle below?</p>

In what exact sequence must a process utilize a system resource, as illustrated in the cycle below?

A process may utilize a resource in only the following sequence: Request the resource, Use the resource, and Release the resource.

15
New cards

What four conditions must hold simultaneously for a deadlock situation to arise?

  1. Mutual exclusion: At least one resource must be held in a non-shareable mode.
  2. Hold and wait: A process must hold at least one resource while waiting to acquire additional resources held by other processes.
  3. No preemption: Resources cannot be preempted; they can only be released voluntarily by the process holding them.
  4. Circular wait: A closed chain of processes exists such that each process holds resources needed by the next process in the chain.
16
New cards

How do base and limit registers protect user processes in contiguous memory allocation?

The base register contains the value of the smallest physical address, and the limit register contains the range of logical addresses. The hardware ensures that each logical address generated by a process is strictly less than the limit register before dynamically adding it to the base register, preventing unauthorized memory access.

17
New cards
<p>How does dynamic relocation using a relocation register in an MMU compute physical addresses?</p>

How does dynamic relocation using a relocation register in an MMU compute physical addresses?

The Memory-Management Unit (MMU) dynamically adds the value stored in the relocation register (such as 1400014000) to every logical address generated by the CPU (such as 346346) at the moment it is dispatched to memory, yielding the physical address (14000+346=1434614000 + 346 = 14346).

18
New cards

Compare First-fit, Best-fit, and Worst-fit dynamic storage-allocation algorithms.

  • First-fit: Allocates the first hole that is big enough.
  • Best-fit: Allocates the smallest hole that is big enough, producing the smallest leftover hole (requires searching the whole list unless ordered by size).
  • Worst-fit: Allocates the largest hole, producing the largest leftover hole (must also search entire list).

First-fit and best-fit perform better than worst-fit in terms of speed and storage utilization.

19
New cards
<p>Explain how segmentation hardware validates and maps an address pair $$\langle s, d \rangle$$ to physical memory.</p>

Explain how segmentation hardware validates and maps an address pair ⟨s,d⟩\langle s, d \rangle to physical memory.

The CPU generates logical address ⟨s,d⟩\langle s, d \rangle (segment number ss and offset dd). The segment table uses ss to look up the segment's limit and base. The hardware tests whether d<limitd < \text{limit}. If yes, the base is added to the offset (base+d\text{base} + d) to produce the physical memory address. If no, a trap for an addressing error is generated.

20
New cards

What is virtual memory, and what major advantages does it offer?

Virtual memory is the separation of user logical memory from physical memory. It allows execution of programs that are only partially loaded in physical memory, enabling the logical address space to be much larger than physical address space, allowing address spaces to be shared by several processes, and enabling more efficient process creation.

21
New cards

What is the function of the valid-invalid bit in demand paging?

Each page table entry has a valid-invalid bit: vv indicates the page is valid and in memory, while ii indicates it is not in memory. Initially, all entries are set to ii. If an address translation references an entry marked ii, a page fault occurs.

22
New cards
<p>What are the six sequential steps in handling a page fault, as depicted in the diagram?</p>

What are the six sequential steps in handling a page fault, as depicted in the diagram?

  1. Reference: CPU attempts to access an instruction/data whose page table entry has an invalid bit (ii).
  2. Trap: System traps to the operating system.
  3. Backing store check: OS checks an internal table to verify the reference and locate the page on backing store.
  4. Bring in missing page: OS reads the page from disk into a free frame in physical memory.
  5. Reset page table: Page table is updated with the new frame location and valid bit set to vv.
  6. Restart instruction: The instruction that caused the page fault is restarted.
23
New cards

What is the role of the modify (dirty) bit in page replacement?

The modify bit reduces the overhead of page transfers between main memory and disk. If a page has not been modified while in memory, it does not need to be written back to disk during page replacement; only modified pages are written to disk.

24
New cards

What are the two major components that constitute disk positioning time (random-access time)?

Positioning time consists of:

  • Seek time: The time required to move the disk arm to the cylinder containing the desired sector.
  • Rotational latency: The additional time waiting for the desired sector to rotate under the read-write head.
25
New cards
<p>Identify the primary mechanical components of the moving-head disk mechanism illustrated below.</p>

Identify the primary mechanical components of the moving-head disk mechanism illustrated below.

The mechanism includes the central rotating spindle, multiple platters, track (tt), sector (ss), cylinder (cc), read-write heads, arms, and the arm assembly.

26
New cards
<p>How does Linked Allocation organize file blocks on a disk as shown in this diagram?</p>

How does Linked Allocation organize file blocks on a disk as shown in this diagram?

Each file is stored as a linked list of disk blocks scattered across the disk. The directory entry stores pointers to the starting block (block 99) and ending block (block 2525). Each block contains a pointer to the next block in the chain, with the final block holding a value of −1-1.

27
New cards
<p>How does Indexed Allocation manage file pointers as demonstrated in this diagram?</p>

How does Indexed Allocation manage file pointers as demonstrated in this diagram?

Indexed allocation brings all pointers together into a single dedicated index block (here, index block 1919 for file 'jeep'). The directory points directly to the index block, and the entries within that index block point to the individual physical data blocks (9,16,1,10,259, 16, 1, 10, 25, followed by −1-1 for unused entries).

28
New cards

What is the primary difference between a threat and an attack in computer security?

A threat is a potential security violation, whereas an attack is an actual attempt to breach security (which may be accidental or malicious).

29
New cards

What is authentication, and what practices help ensure password security?

Authentication is the mechanism by which a process verifies that the communication partner is who it is supposed to be and not an imposter. Password security practices include frequent changes, using non-guessable passwords, logging all invalid access attempts, encrypting passwords, and allowing passwords to be used only once.