Introduction to Operating Systems
Understand the purpose of an operating system, its core functions (process, memory, file, I/O, and security management), and key techniques such as scheduling, paging, and access control.
Summary
Read Summary
Flashcards
Save Flashcards
Quiz
Take Quiz
Quick Practice
How does the Operating System define a "process"?
1 of 10
Summary
Overview of Operating Systems
What is an Operating System?
An operating system (OS) is fundamental software that acts as an intermediary between users, applications, and computer hardware. Its primary purpose is to manage all hardware resources—such as the CPU, memory, and storage devices—and provide convenient services that allow other programs to run effectively without needing to understand low-level hardware details.
Think of the operating system as a manager of a complex facility: just as a building manager handles electricity, water, security, and room allocation so that tenants can focus on their work, the operating system handles hardware management so that application programs can focus on their tasks.
When you power on a computer, the operating system is the first program that starts running. It initializes the CPU, loads memory management systems, activates storage devices, and prepares all input/output devices (keyboards, displays, network cards, etc.) before any application can run.
The Core Functions of an Operating System
An operating system performs five essential functions:
Process Management involves creating, scheduling, and terminating processes, which are running instances of programs. The OS decides which process gets access to the CPU and when, ensuring that multiple programs can run simultaneously in an orderly fashion.
Memory Management allocates RAM to processes and tracks which memory locations are in use and which are free. This ensures processes don't interfere with each other's data and that available memory is used efficiently.
File System and Storage Management organizes data on disks and other permanent storage into files and directories. The OS provides a standard interface so programs can read, write, and organize data without knowing the physical details of the storage hardware.
Device Input/Output Management abstracts away the technical complexity of hardware devices like keyboards, printers, and network cards. Through device drivers, programs can interact with peripherals using simple, standardized commands rather than complex hardware-specific instructions.
Security and Protection enforces authentication (verifying who users are), controls which users can access which resources, and isolates processes so that a misbehaving program cannot damage the system or interfere with other programs.
Process Management: Making Multiple Programs Work Together
Scheduling and Multitasking
Modern computers appear to run many programs simultaneously—you can listen to music, browse the web, and check email all at once. However, if your computer has only one CPU core, it genuinely runs only one program at a time. The OS creates the illusion of simultaneous execution through multitasking: it rapidly switches the CPU among different processes, typically hundreds of times per second.
The scheduling algorithm is the set of rules the OS uses to decide which process gets the CPU next. Different algorithms prioritize different goals—some aim to give each process equal time, while others prioritize interactive programs that need quick response times.
Protecting Against Failures
A critical responsibility of process management is protection against misbehaving programs. If one application crashes or enters an infinite loop, the operating system must prevent that program from crashing the entire system. The OS achieves this through isolation: each process runs in a protected memory space, and the OS monitors system calls (requests from programs to the OS) to prevent any single process from monopolizing resources or directly accessing another process's data.
Memory Management: Making Limited Memory Sufficient
The Challenge of Memory
Physical RAM is finite and expensive. Yet modern programs often need more memory than is available. The operating system solves this problem through clever memory management techniques.
Paging: Breaking Memory into Manageable Pieces
One key technique is paging, which divides both physical RAM and a program's memory space into small fixed-size blocks called pages (typically 4 KB each). The OS can move pages between fast RAM and slower secondary storage (like a hard disk) as needed. When a program needs a page that's currently on disk, the OS retrieves it and places it in RAM, moving another page to disk if necessary. This process happens automatically and transparently to the program.
Segmentation: Dividing Programs into Logical Sections
Another technique is segmentation, which divides a program's address space into logical segments based on function. Typical segments include:
The code segment containing the program's instructions
The data segment containing global variables
The stack segment containing local variables and return addresses for function calls
Segmentation allows the OS to protect different parts of a program differently—for example, the code segment can be marked read-only to prevent accidental modification.
Virtual Memory: The Illusion of Unlimited RAM
These techniques combine to create virtual memory, perhaps the OS's most elegant feature. Each process sees a large, continuous address space (often 4 GB or more on 32-bit systems) as if it were all backed by physical RAM. In reality, the OS swaps pages between RAM and disk automatically. A program can use more memory than physically exists on the computer—when it accesses a page that's on disk, the OS loads it into RAM.
The diagram above illustrates how a single process's virtual memory space (shown in yellow on the left) maps to physical RAM and disk storage (shown on the right). Multiple processes can simultaneously use virtual memory, with the OS managing what portions of each process are in RAM versus on disk.
File System and Storage Management
Providing a Standard Interface
The operating system presents files and directories as the abstraction for permanent storage, hiding the complexity of different storage hardware. Programs interact with files using a standard interface: they can open a file, read its contents, write new data, and close the file. The OS translates these simple operations into appropriate commands for whatever storage device is actually involved—whether it's a hard drive, solid-state drive, USB drive, or network storage.
This historical screenshot shows a text editor's file menu, illustrating the standard file operations that the OS enables: Open, Duplicate, Get Info, Put Back, Close, and others. These operations work the same way regardless of where files are actually stored.
Permissions and Access Control
Beyond simple file operations, the operating system enforces file permissions that control which users can read, write, or execute each file and directory. For example, an OS might allow you to read a document but prevent you from modifying it, or allow you to execute a program but not examine its contents. These protections prevent accidental modification of important files and provide security by restricting what users can access.
Managing Different Storage Media
The OS handles diverse storage devices transparently. Whether data is on a mechanical hard disk, a fast solid-state drive, or a removable USB device, the file system presents a uniform interface. The OS manages the low-level details of how data is physically organized on each type of media.
Security and Protection: Keeping Systems Safe
User Authentication
The operating system is responsible for verifying the identity of users—this is authentication. Typically, this means verifying passwords, but modern systems also use fingerprints, facial recognition, security keys, and other biometric methods. Authentication ensures that only authorized users can access the system.
Access Control: Who Can Access What
Once a user is authenticated, the OS enforces access control to determine what resources that user can access. Access control lists and permission bits specify which users can read, write, or execute particular files, and which users can access devices and system resources.
This diagram shows how access control is structured: a file's security descriptor contains information about the owner and access control entries (ACEs) that specify precisely which users or groups can perform which actions (read, write, execute, etc.) on that file.
Preventing Interference
The OS continuously monitors program behavior to prevent accidental or malicious interference. For example:
The OS prevents one program from reading another program's memory
The OS prevents programs from directly accessing hardware without permission
The OS prevents users from accessing files they don't have permission to read
The OS limits how much CPU time and memory each process can consume
These protections ensure system integrity and stability.
<extrainfo>
Additional Architectural Concepts
The operating system operates in two distinct modes: user mode and kernel mode. Applications run in restricted user mode, where certain dangerous operations are prohibited. Critical OS code runs in privileged kernel mode, where all operations are allowed. When an application needs to access protected resources—such as reading a file or allocating memory—it makes a system call to request OS services. The OS briefly switches to kernel mode to perform the privileged operation, then returns to user mode. This architecture provides fundamental security and stability by preventing applications from directly accessing hardware or interfering with other processes.
</extrainfo>
Flashcards
How does the Operating System define a "process"?
A running program
Which mechanism does the Operating System use to decide which process receives the CPU at any given moment?
Scheduling algorithm
How does the Operating System enable multitasking?
By rapidly switching the CPU among multiple processes
How does the Operating System prevent a misbehaving program from crashing the entire system?
By isolating its execution
Which technique divides memory into fixed-size blocks that can be moved between RAM and secondary storage?
Paging
Which technique divides a program's address space into logical segments like code, data, and stack?
Segmentation
What mechanism allows a process to use more memory than is physically present in the system?
Virtual memory
What standard set of commands does the Operating System provide for programs to interact with data?
Open, read, write, and close
How does the Operating System control which users can read, write, or execute specific files?
By assigning permissions to files and directories
What software components allow the Operating System to abstract the details of hardware like keyboards and network cards?
Device drivers
Quiz
Introduction to Operating Systems Quiz Question 1: Which core function of an operating system involves creating, scheduling, and terminating processes?
- Process management (correct)
- Memory management
- File system management
- User authentication
Introduction to Operating Systems Quiz Question 2: How does an operating system decide which process receives CPU time at any moment?
- By using a scheduling algorithm (correct)
- By randomly selecting a process
- By assigning based on process ID order
- By letting the user choose manually
Introduction to Operating Systems Quiz Question 3: Which memory‑management technique divides memory into fixed‑size blocks that can be moved between RAM and secondary storage?
- Paging (correct)
- Segmentation
- Swapping
- Caching
Introduction to Operating Systems Quiz Question 4: What OS feature provides a uniform set of commands for programs to open, read, write, and close files?
- Standard file interface (correct)
- Device driver layer
- Memory management unit
- Network protocol stack
Which core function of an operating system involves creating, scheduling, and terminating processes?
1 of 4
Key Concepts
Operating System Fundamentals
Operating System
File System
Device Driver
Operating System Security
Process and Memory Management
Process Management
Memory Management
Virtual Memory
Paging
Segmentation
Scheduling and Algorithms
Scheduling Algorithm
Definitions
Operating System
Fundamental software that manages computer hardware and provides services for all other programs.
Process Management
OS component that creates, schedules, and terminates running processes.
Memory Management
Subsystem that allocates RAM to processes, tracks usage, and handles memory protection.
File System
Organized method by which an OS stores, retrieves, and manages data on storage media.
Device Driver
Software module that abstracts and controls hardware devices, enabling OS interaction.
Operating System Security
Set of mechanisms enforcing user authentication, access controls, and process isolation.
Virtual Memory
Technique allowing programs to use more memory than physically present by swapping pages to secondary storage.
Scheduling Algorithm
Policy used by the OS to decide which process receives CPU time at any moment.
Paging
Memory‑management scheme that divides memory into fixed‑size blocks and moves them between RAM and storage.
Segmentation
Memory‑management method that divides a program’s address space into logical segments such as code, data, and stack.