Operating System Fundamentals
Table of Contents
Operating System Fundamentals
Process Management
What is a process in the context of operating systems? drill
Back
A process is an instance of a program in execution. It includes the program code, its current activity (as represented by the value of the program counter), and the contents of the processor's registers.
Explain the difference between a process and a thread. drill
Back
A process is an independent program in execution with its own memory space, while a thread is a lightweight unit of execution within a process. Threads within the same process share the same memory space and resources, allowing for more efficient communication and context switching compared to processes.
Memory Management
What is virtual memory and why is it important? drill
Back
Virtual memory is a memory management technique that provides an idealized abstraction of the storage resources that are actually available on a given machine. It allows programs to use more memory than physically available by using disk space as an extension of RAM. This is important because it enables efficient use of physical memory, isolation between processes, and the ability to run larger programs than would fit in physical memory alone.
Explain the concept of paging in memory management. drill
Back
Paging is a memory management scheme that eliminates the need for contiguous allocation of physical memory. It divides physical memory into fixed-sized blocks called frames and logical memory into blocks of the same size called pages. The operating system keeps track of all free frames. To run a program, its pages are loaded into available frames in physical memory. This allows for more efficient use of memory and simplifies memory allocation.
File Systems
What is a file system and what are its main functions? drill
Back
A file system is a method and data structure that the operating system uses to control how data is stored and retrieved. Its main functions include:
- Tracking allocated and free space
- Maintaining directories and file names
- Mapping files to storage locations
- Ensuring data integrity and controlling access to files
Explain the difference between FAT and NTFS file systems. drill
Back
FAT (File Allocation Table) and NTFS (New Technology File System) are both file systems used in Windows:
- FAT is simpler, older, and more compatible across different operating systems, but has limitations on file size and doesn't support advanced features.
- NTFS is more modern, supports larger file and partition sizes, has built-in security features, journaling for improved reliability, and supports advanced features like compression and encryption.
Device Management
What is the role of device drivers in an operating system? drill
Back
Device drivers are software components that act as an interface between the operating system and hardware devices. They:
- Translate high-level operating system instructions into low-level hardware-specific commands
- Manage device-specific operations and data transfers
- Handle interrupts and error reporting from devices
- Provide a standardized interface for the OS to interact with various hardware devices
Explain the concept of interrupt handling in device management. drill
Back
Interrupt handling is a mechanism used by operating systems to manage requests from hardware devices. When a device needs attention, it sends an interrupt signal to the CPU. The operating system then:
- Suspends the current process
- Saves the current state
- Determines the source of the interrupt
- Executes the appropriate interrupt service routine (ISR)
- Restores the saved state and resumes the interrupted process
This allows for efficient multitasking and responsive handling of hardware events.
Security and Access Control
What is the principle of least privilege in operating system security? drill
Back
The principle of least privilege is a fundamental concept in computer security that states that a user, program, or process should be given only the minimum levels of access – or permissions – needed to perform its function. This reduces the potential damage from errors or malicious actions and limits the attack surface of the system.
Explain the difference between discretionary access control (DAC) and mandatory access control (MAC). drill
Back
Discretionary Access Control (DAC) and Mandatory Access Control (MAC) are two different approaches to access control in operating systems:
- DAC: Allows users to control access to their own files and resources. The owner of a resource can grant or restrict access to other users. It's more flexible but potentially less secure.
- MAC: Enforces access control based on system-wide policies that cannot be changed by individual users. Access decisions are made by the system, not the users. It's generally more secure but less flexible than DAC.