Operating Systems - Complete Study Guide for Flashcards

0.0(0)
studied byStudied by 0 people
full-widthCall with Kai
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/58

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.

59 Terms

1
New cards

Program Counter (PC)

A pointer that indicates which instruction to execute next.

2
New cards

Stack Pointer (SP)

Points to the top of the process's stack, indicating where to find local variables and return addresses.

3
New cards

PSW/FLAGS Register

Status indicators for the CPU, showing results of last operations, like zero flag and carry flag.

4
New cards

Pseudoparallelism

Fake multitasking where the appearance of concurrent execution is created by rapidly switching between tasks.

5
New cards

Multiprogramming

Running multiple programs in memory by switching between them to maximize CPU usage.

6
New cards

Copy-on-Write

A memory management technique where memory is shared until a write operation occurs, then a copy is made.

7
New cards

Context Switch

The process of saving the state of a running process and loading the state of another process.

8
New cards

Critical Region (Critical Section)

Code that accesses shared resources, which must not be executed by more than one process at a time.

9
New cards

Mutual Exclusion

Ensures that only one process can enter a critical region of code at a time.

10
New cards

Race Conditions

Situations where the outcome depends on the timing of events, often leading to unpredictable results.

11
New cards

Spin Lock

A locking mechanism where a process repeatedly checks if a lock is available, wasting CPU resources.

12
New cards

Semaphore

A synchronization primitive that maintains a count of available resources and manages access to those resources.

13
New cards

Kernel

The core component of an operating system that manages hardware and software interactions.

14
New cards

Jobs of the Kernel

Includes process management, memory management, device management, file system control, CPU scheduling, and handling system calls.

15
New cards

Process vs Program

A program is a static set of instructions; a process is a program in execution with its current state.

16
New cards

What is a Thread?

A lightweight process within a program, sharing resources but having its own stack and program counter.

17
New cards

Process State: READY

Indicates a process is ready to be executed by the CPU.

18
New cards

Process State: RUNNING

Indicates a process is currently being executed by the CPU.

19
New cards

Process State: BLOCKED

Indicates a process cannot continue until a certain condition is met.

20
New cards

Transition: READY to RUNNING

Occurs when the scheduler selects a process to execute.

21
New cards

Transition: RUNNING to READY

Happens when a process's time slice expires or a higher priority process arrives.

22
New cards

Transition: RUNNING to BLOCKED

Occurs when a process needs resources that are currently unavailable.

23
New cards

Transition: BLOCKED to READY

Happens when the resource a blocked process was waiting for becomes available.

24
New cards

RUNNING to READY vs RUNNING to BLOCKED

RUNNING to READY indicates a preemption, while RUNNING to BLOCKED indicates resource unavailability.

25
New cards

Context Switch - 6 Steps

Steps to save current state, select new process, and load the new state.

26
New cards

Problems from Bad-Timed Context Switches

Can lead to race conditions, data corruption, and inconsistent program states.

27
New cards

Process Table (proctab)

An array structure for storing process information, indexed by Process ID.

28
New cards

Accessing Current Running Process

Use proctab[currpid], where currpid is the ID of the currently running process.

29
New cards

Ready List

A queue of processes that are in the READY state, waiting for CPU access.

30
New cards

Semaphore Structure in Xinu

Contains a count of resources and a queue of waiting processes.

31
New cards

Semaphore wait() Operation

Decreases the semaphore count and blocks the process if the count is negative.

32
New cards

Semaphore signal() Operation

Increases the count and wakes a waiting process if applicable.

33
New cards

Reading Semaphore Count

Reflects the availability of resources, with negative counts indicating waiting processes.

34
New cards

Message Passing: receive()

A blocking operation that waits for a message to be ready before proceeding.

35
New cards

Message Passing: recvclr()

Non-blocking operation that clears the message buffer if a message is available.

36
New cards

Message Passing: recvtime()

Blocking operation that allows for a timeout while waiting for a message.

37
New cards

Killing a SLEEPING Process

Requires removing it from the sleep queue before freeing its resources.

38
New cards

Killing a READY Process

Requires removing from the ready list before freeing the process entry.

39
New cards

Killing a WAITING Process

Requires removal from the semaphore queue and adjusting the semaphore count.

40
New cards

Why Must We Clean Up Before Killing?

Ensures system integrity and prevents dangling pointers or crashes.

41
New cards

Data Structures Used in Kernel

Includes process tables, ready lists, semaphore queues, and message buffers.

42
New cards

Fields in Process Entry

Contain process attributes like name, priority, state, and pointers.

43
New cards

Kernel-Level vs User-Level Threads

Kernel-level threads are managed by the OS, while user-level threads are managed by user libraries.

44
New cards

Invariants in Xinu

Conditions that must always hold true for proper system functioning.

45
New cards

Why Invariants Matter

Violating invariants indicates kernel bugs and can lead to process starvation.

46
New cards

Atomic Actions

Operations that must complete fully or not at all, without interruption.

47
New cards

fork() Function

Creates a copy of the parent process, resulting in a child process with its own execution context.

48
New cards

fork() Return Values

0 for child, positive PID for parent, -1 for failure.

49
New cards

Complete Process Lifecycle

Describes the states and transitions of a process from creation to termination.

50
New cards

Why Copy-on-Write Improves fork()

It avoids unnecessary copying of data by sharing memory until a write operation is performed.

51
New cards

Spin Lock vs Semaphore Comparison

Spin locks waste CPU resources, good for short waits; semaphores block processes and are better for longer waits.

52
New cards

Relationship Between States and Data Structures

Kernel maintains the mapping between process states and their corresponding data structures.

53
New cards

Preemption by Higher Priority Process

Process preemption occurs when a higher-priority process is ready, prompting a context switch.

54
New cards

Why Process Termination Must Check State

Ensures appropriate cleanup based on process state to prevent system inconsistencies.

55
New cards

Quantum in Time-Sharing

Defines the maximum time a process can run before being switched out for fairness.

56
New cards

Priority-Based Scheduling in Xinu

Processes are managed in a priority queue, with higher-priority processes served first.

57
New cards

Why Atomicity Important for Synchronization

Atomicity in operations prevents race conditions and ensures proper execution of critical sections.

58
New cards

Blocking and I/O Operations

Managing I/O by blocking the process and yielding CPU to maximize efficiency.

59
New cards

Why Race Conditions Are Particularly Hard to Debug

Unpredictable nature of race conditions makes them difficult to replicate and resolve.