Operating System: Process Management

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

Explain how priority scheduling can lead to starvation and describe a solution to mitigate this issue.

Priority scheduling can lead to starvation because low-priority processes may never get executed if higher-priority processes continuously arrive. Aging, which gradually increases the priority of processes over time, can mitigate this.

Compare and contrast preemptive and non-preemptive scheduling algorithms. Give an advantage of each.

In preemptive scheduling, a running process can be interrupted and moved to the ready queue by the OS. In non-preemptive scheduling, a process runs until it voluntarily releases the CPU. Preemptive scheduling allows for better responsiveness, while non-preemptive scheduling has lower overhead.

Describe the difference between internal and external fragmentation in memory management. How can each be addressed?

Internal fragmentation occurs within allocated memory blocks when the allocated space is larger than the required space. External fragmentation occurs when there are sufficient free memory space to satisfy a request, but it is non-contiguous. Internal fragmentation can be addressed by using smaller, more appropriately sized partitions or through the use of suballocation techniques. External fragmentation can be addressed through compaction or the use of paging/segmentation.

Explain the concept of a 'thrashing' and how it impacts system performance. What steps can an OS take to reduce thrashing?

<p>Thrashing occurs when a process spends more time paging than executing, leading to very low CPU utilization. The OS can reduce thrashing by implementing a good page replacement algorithm (like LRU) and using a working-set model or page-fault frequency (PFF) algorithm to determine the appropriate number of frames to allocate to a process.</p> Signup and view all the answers

How does the two-factor authentication enhance OS security, and what are its limitations?

<p>Two-factor authentication enhances security by requiring users to provide two different authentication factors, such as a password and a code from a mobile app. This makes it harder for attackers to gain unauthorized access, even if they have one factor. However its limitations can be inconvenience, and sometimes it's possible to compromise both factors simultaneously by sophisticated attacks.</p> Signup and view all the answers

What is the purpose of access control lists (ACLs) in the context of file systems, and how do they differ from basic file permissions?

<p>ACLs provide more fine-grained control over file access permissions compared to basic file permissions. While basic permissions typically define read, write, and execute permissions for the owner, group, and others, ACLs allow specifying permissions for individual users or groups beyond the standard three categories.</p> Signup and view all the answers

Describe the role of a system call in accessing OS services? Provide an example of how a program uses a system call.

<p>A system call is a request made by a user-level program to the OS kernel for performing privileged operations or accessing hardware resources. For example, a program might use the <code>open()</code> system call to open a file for reading or writing.</p> Signup and view all the answers

Explain the concept of context switching. What information must be saved/restored during a context switch?

<p>Context switching is the process of saving the state of one process and restoring the state of another process so that execution can resume from the same point later. The information that must be saved/restored typically includes the program counter, register values, memory management information, and I/O status.</p> Signup and view all the answers

Explain the difference between preemptive and non-preemptive kernels. What are the implications of each on system responsiveness?

<p>In a preemptive kernel, a process running in kernel mode can be interrupted, allowing the OS to regain control. In a non-preemptive kernel, a process runs in kernel mode until it voluntarily relinquishes control. Preemptive kernels generally provide better system responsiveness, especially when a kernel-mode process takes a long time to execute.</p> Signup and view all the answers

Discuss the trade-offs between using a smaller vs. larger time quantum in Round Robin scheduling.

<p>A smaller time quantum in Round Robin scheduling leads to more frequent context switches, increasing overhead but potentially improving fairness and responsiveness for interactive processes. A larger time quantum reduces context switching overhead but can lead to longer waiting times for short processes if a long process gets the CPU.</p> Signup and view all the answers

Flashcards

Process Management

Managing the execution of processes, including creation, scheduling, and termination.

First-Come, First-Served (FCFS)

Executes processes in the order they arrive.

Inter-Process Communication (IPC)

Enables processes to exchange data and synchronize execution.

Deadlock

Two or more processes are blocked indefinitely, waiting for each other.

Signup and view all the flashcards

Memory Management

Allocates and deallocates memory space to programs.

Signup and view all the flashcards

Virtual Memory

Allows a process to access more memory than is physically available using paging and segmentation.

Signup and view all the flashcards

File System

Organizes and manages files on storage devices, such as creating, reading, writing, and deleting files.

Signup and view all the flashcards

OS Security

Protects the system from unauthorized access and threats, using authentication, access control, and encryption.

Signup and view all the flashcards

User Authentication

Verifies the identity of users trying to access the system.

Signup and view all the flashcards

System Calls

Interface between user-level programs and the OS kernel to request services.

Signup and view all the flashcards

Study Notes

  • An operating system (OS) manages computer hardware and software resources and provides common services for computer programs
  • It acts as an intermediary between the user and the hardware

Process Management

  • Process management involves creating, scheduling, and terminating processes
  • A process is an instance of a computer program that is being executed
  • Process scheduling algorithms determine which process will be executed by the CPU
  • Common scheduling algorithms include First-Come, First-Served (FCFS), Shortest Job First (SJF), Priority Scheduling, and Round Robin
  • FCFS executes processes in the order they arrive
  • SJF executes the process with the shortest execution time first
  • Priority scheduling executes processes based on assigned priorities
  • Round Robin allocates a fixed time slice to each process
  • Inter-process communication (IPC) enables processes to exchange data and synchronize execution
  • Common IPC mechanisms include shared memory, message passing, and pipes
  • Process synchronization ensures that multiple processes access shared resources in a controlled manner to prevent data inconsistency
  • Synchronization mechanisms include mutex locks, semaphores, and monitors
  • Deadlock occurs when two or more processes are blocked indefinitely, waiting for each other

Memory Management

  • Memory management allocates and deallocates memory space to programs
  • The goal is to efficiently utilize memory and prevent processes from interfering with each other
  • Virtual memory allows a process to access more memory than is physically available
  • It uses techniques like paging and segmentation to map virtual addresses to physical addresses
  • Paging divides memory into fixed-size blocks called pages
  • Segmentation divides memory into variable-size blocks called segments
  • Page replacement algorithms are used to decide which page to evict from memory when a new page needs to be loaded
  • Common page replacement algorithms include FIFO (First-In, First-Out), LRU (Least Recently Used), and Optimal
  • Memory fragmentation occurs when memory is allocated and deallocated over time, leading to unused memory gaps
  • Fragmentation can be internal (within a partition) or external (between partitions)
  • Compaction is a technique used to reduce external fragmentation by moving allocated memory blocks to contiguous locations

File Systems

  • A file system organizes and manages files on storage devices
  • It provides a hierarchical structure of directories (folders) and files
  • File systems define how data is stored, accessed, and retrieved
  • Common file system operations include creating, reading, writing, and deleting files
  • Different file systems have different characteristics, such as maximum file size, filename length, and supported features
  • Examples of file systems include FAT32, NTFS, ext4, and APFS
  • File system metadata stores information about files, such as name, size, permissions, and timestamps
  • Access control mechanisms regulate who can access and modify files
  • File system security features include permissions, access control lists (ACLs), and encryption
  • Disk scheduling algorithms optimize the order in which disk I/O requests are serviced
  • Common disk scheduling algorithms include FCFS, SSTF (Shortest Seek Time First), SCAN, and C-SCAN

Security in OS

  • OS security protects the system from unauthorized access, malware, and other threats
  • User authentication verifies the identity of users trying to access the system
  • Common authentication methods include passwords, biometrics, and multi-factor authentication
  • Access control mechanisms restrict users' access to system resources based on their roles and permissions
  • Privilege escalation occurs when a user gains unauthorized access to higher-level privileges
  • Security policies define the rules and guidelines for maintaining system security
  • Firewalls protect the system by filtering network traffic and blocking malicious connections
  • Intrusion detection systems (IDS) monitor the system for suspicious activity and alert administrators
  • Antivirus software detects and removes malware from the system
  • Encryption protects data confidentiality by converting it into an unreadable format
  • Security vulnerabilities are weaknesses in the system that can be exploited by attackers
  • Regular security updates and patches are essential to address vulnerabilities

System Calls

  • System calls are the interface between user-level programs and the OS kernel
  • User programs request services from the OS kernel through system calls
  • System calls provide access to hardware resources and privileged operations
  • Examples of system calls include file I/O, memory allocation, process creation, and network communication
  • When a user program makes a system call, the OS kernel takes over and performs the requested operation
  • System call handling involves switching from user mode to kernel mode
  • System calls are typically implemented using a software interrupt or trap
  • The system call interface provides a level of abstraction, shielding user programs from the complexities of the underlying hardware
  • Different operating systems have different system call interfaces
  • System call overhead can impact performance, so it's important to minimize the number of system calls

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team
Use Quizgecko on...
Browser
Browser