Summary

This document serves as a midterm study guide for CSC 4420, focusing on core concepts of operating systems including resource management, system calls, and C language fundamentals. The guide covers processes, threads, and scheduling algorithms, offering an overview of essential topics for the midterm.

Full Transcript

CSC 4420 Midterm Study Guide Winter 2025 Chapter 1: Introduc on 1. Understand what an Opera ng System is  Opera ng systems can be viewed from two viewpoints: resource managers and extended machines. In the resource-manager view, the opera ng...

CSC 4420 Midterm Study Guide Winter 2025 Chapter 1: Introduc on 1. Understand what an Opera ng System is  Opera ng systems can be viewed from two viewpoints: resource managers and extended machines. In the resource-manager view, the opera ng system’s job is to manage the different parts of the system efficiently. In the extended-machine view, the system provides the users with abstrac ons that are more convenient to use than the actual machine.  The abstrac ons include processes, address spaces, and files. Opera ng systems handles requests, prevents errors and improper use, serves as a file system and operates a windowing system where the graphical user interface (GUI) presents data in a window format to the user interface (UI). 2. Retain knowledge on history of Opera ng Systems  Opera ng systems have a long history, star ng from the days when they replaced the operator, to modern mul programming systems. Highlights include early batch systems, mul programming systems, and personal computer systems.  The early opera ng systems were focused on managing I/O opera ons and scheduling jobs in the batch processing systems. The modern opera ng systems are focusing on efficient resource management, providing a user-friendly interface, robust security features, seamless integra on with cloud services, support for mul ple processors and diverse hardware, and handling complex applica ons like mul media while maintaining high performance across a variety of devices, including mobile and cloud-based environments.  Modern opera ng systems typically include built-in networking capabili es, allowing users to connect to the internet, access shared network drives, and send data to other devices on the network. 3. Know the key Computer Hardware components  Opera ng system interacts with several hardware components including the CPU (Central Processing Unit), RAM (Random Access Memory), storage devices (hard drives), input/output devices (keyboard, mouse), and the motherboard which connects all these components together.  Essen ally, the OS manages how these hardware parts work together to run applica ons and perform tasks on a computer. Memory is one of key hardware components and structured as a hierarchy based on the speed, cost and capacity. Main memory is the primary internal workspace that stores data temporarily with limited capacity and virtual memory is a memory management technique that uses a computer’s secondary memory to make up for a lack of physical memory. 4. Know the fundamental Opera ng System types and structures  Opera ng systems can be structured as monolithic, layered, microkernel/client-server, virtual machine, or exokernel/unikernel systems. Regardless, the basic concepts on which they are built are processes, memory management, I/O management, the file system, and security. The main interface of an opera ng system is the set of system calls that it can handle. These tell us what it really does. 5. Know what system Calls are  System call is a mechanism that allows a user program to request a service from the opera ng system kernel, ac ng as a bridge between the user space (applica ons) and the kernel space, enabling ac ons like opening files, reading data, crea ng processes, or managing network connec ons, all by essen ally "calling" a specific func on provided by the kernel to perform the desired opera on. Essen ally, it's the primary way a program interacts with the opera ng system.  It is very commonly to make a system call to trap the kernel. The system calls can act as a controlled way to switch to kernel mode from user mode. While interrupts are asynchronous events trigged by external hardware. 6. fundamental C  C is used as the primary language to build the Linux kernel and many of its system-level components, making it a founda onal element of the opera ng system, allowing for high performance and direct access to hardware capabili es; essen ally, understanding basic C is crucial for working deeply with Linux systems.  In Linux, everything is a file. This includes hardware devices, processes, directories, regular files, sockets, links, and so on. Also, the file system is usually divided into data blocks and inodes. With that said, you can think of inodes as the founda on of the Linux file system.  A pipe in Linux/Unix is a mechanism that allows the output of one command to be used as the input for another command, essen ally connec ng the standard output of a process to the standard input of another, enabling users to chain mul ple commands together to efficiently filter and manipulate data on the command line. When using pipe in the script, a good prac ce is to close one end of pipe if using another end. The same concept can be applied to the file descriptors. Chapter 2: 1. Understand what a process is, how a process is created and how the state transi ons work.  Process is a separate instance of a running program with its own memory space, meaning any me you execute a command or applica on, it becomes a process with its own unique iden fier (PID) that allows the opera ng system to track and manage its execu on; essen ally, it's a program ac vely running on the system.  A new process can be created inside a process by making a fork system call. Processes are organized in a tree-like structure where a parent process can create child processes, allowing for efficient management of related tasks. A process can be in different states like running, ready and blocked. One state can transit to another state when the condi on is met. 2. Know what a thread is, how a thread is created, how a thread is managed, what the rela onships are between processes and threads and what different thread models are.  Threads are the smallest unit of execu on within a process. They share the same memory space as the parent process. Threads can execute independently, but they are not completely independent like separate processes.  Crea ng a new thread doesn’t need to allocate separate memory space so the crea on is light weighted. Context switching between threads is faster because threads share the same memory space. Communica ons are faster between threads.  Each thread has its own thread table which can be stored in either user space or kernel space. There are some pros and cons on where the thread table is stored.  Different thread model is suitable for different applica ons, like event-driven servers is designed to respond to events, meaning it waits for specific occurrences (like a user ac on, data change, or system no fica on) and then executes code only when those events happen, instead of constantly polling for updates; this allows for efficient resource usage and highly responsive systems, o en u lizing messaging brokers like manage event streams. 3. Know what synchroniza on and Inter-process Communica on are  Deadlock is a situa on where two or more processes are stuck wai ng for each other to release resources held by another process in a circular dependency where none of the processes can con nue execu on, effec vely hal ng the system. Many ways can prevent the deadlock like, mutual exclusion, priority ordering, meout mechanism, etc. Deadlock is a specific type of race condi on where the outcome is always a complete stands ll.  Race Condi on occurs when two or more threads or processes try to access and modify a shared resource (cri cal region) simultaneously, leading to unpredictable results depending on the order of execu on. Various synchroniza on mechanisms like locks(mutexes), Peterson’s solu on, TSL/XCHG, semaphores, monitors and message passing can be used to avoid or minimize the race condi on.  Processes can synchronize with one another using synchronization and interprocess communication primitives, for example, semaphores, monitors, or messages. These primitives are used to ensure that no two processes are ever in their critical regions at the same time, a situation that leads to chaos. A process can be in one of running, ready, and blocked states. The state can be changed when the process executes one of interprocess communication primitives. 4. Know pros and cons on common scheduling algorithms  A great many scheduling algorithms have been studied. Some of these are primarily used for batch systems, such as shortest-job-first scheduling. Others are common in both batch systems and interactive systems. These algorithms include round robin, priority scheduling, multilevel queues, guaranteed scheduling, lottery scheduling, and fair-share scheduling. Some systems make a clean separation between the scheduling mechanism and the scheduling policy, which allows users to have control of the scheduling algorithm.  In interactive systems, one of the goals is to minimize turnaround time which refers to the process of prioritizing which tasks to run on the CPU based on the total time it takes for a process to complete from the moment it is submitted to the system until it finishes execution, including any waiting time in the queue  Two types of scheduling: preemptive scheduling means that a currently running process can be interrupted at any time by the operating system to allow a higher priority process to execute, while non-preemptive scheduling means a process will run uninterrupted until it finishes or voluntarily yields control to another process, even if a higher priority process is waiting to run.

Use Quizgecko on...
Browser
Browser