15.2 Operating Systems, Software Components, and Resource Issues
Key Takeaways
- An operating system manages hardware resources and provides services to applications: it schedules processes, manages memory, organizes files, controls devices through drivers, and enforces security.
- System software (the operating system, device drivers, utilities, and language translators) supports the computer, while application software (browsers, word processors, games) performs tasks for users.
- When running programs need more memory than the installed RAM, the operating system uses virtual memory on storage; too much swapping (thrashing) makes the system very slow.
- A process is a running program; the scheduler shares CPU time among processes, for example in round-robin time slices, so many programs appear to run at once.
- Deadlock can occur only when mutual exclusion, hold-and-wait, no preemption, and circular wait all hold, so preventing any one of these conditions prevents it.
What this competency asks
ETS asks you to know that operating systems are programs that control and coordinate interactions between hardware and software components:
- Identify hardware components and their functions (Section 15.1).
- Identify software components and their functions.
- Identify common operating-system tasks.
- Identify resource issues that have an impact on functionality.
Software components
| Category | Examples | Function |
|---|---|---|
| Operating system | Windows, macOS, Linux, ChromeOS, iOS, Android | Manages hardware and provides services to other software |
| Kernel | The core of the operating system | Runs with full hardware access; handles processes, memory, and devices |
| Device drivers | Printer, graphics, and network drivers | Translate operating-system requests into commands for specific hardware |
| Utility programs | Backup, antivirus, disk cleanup, compression tools | Maintain and protect the system |
| Language translators | Compilers, interpreters, assemblers | Turn source code into runnable form (Section 12.1) |
| Firmware | BIOS/UEFI | Starts the hardware and loads the operating system |
| Application software | Browsers, office suites, games, learning apps | Perform tasks for the user |
The first six are system software, which runs and supports the computer. Application software serves the user's goals.
Users
↓
Application software (browser, spreadsheet, IDE)
↓ system calls
Operating system (process, memory, file, device, and security management)
↓ drivers
Hardware (CPU, RAM, storage, network, I/O devices)
Common operating-system tasks
| Task | What the operating system does | Example |
|---|---|---|
| Process management | Starts and stops programs, shares CPU time, handles multitasking | Music keeps playing while you type |
| Memory management | Gives each program its own memory space; provides virtual memory | Programs cannot overwrite one another's data |
| File management | Organizes files and folders; controls reading and writing | Saving, renaming, and searching for files |
| Device management | Communicates with hardware through drivers; handles interrupts | Printing; recognizing a USB drive |
| Security and access control | User accounts, passwords, permissions, and updates | Students cannot change system settings |
| User interface | Command-line or graphical interface | Desktop, windows, and menus |
| Networking | Connects to networks and manages connections | Wi-Fi setup |
| Error handling and logging | Detects and reports errors; keeps logs | Crash reports |
Processes and scheduling
A process is a program in execution, with its own memory and state. A thread is a sequence of execution within a process; threads share the process's memory. On a single core, the scheduler switches rapidly between processes (multitasking), often in round-robin time slices of a few milliseconds. The switching itself, called a context switch, costs time. On multicore processors, processes and threads can truly run in parallel.
A process moves through states: new → ready → running → (waiting for input or output → ready) → terminated. A running process goes back to ready when its time slice ends.
Memory management and virtual memory
The operating system gives each process the illusion of its own large memory space. With virtual memory, parts of a process's memory that are not currently needed are stored on disk and brought into RAM when they are needed, in fixed-size pages. If running programs together need much more than the installed RAM, the system spends most of its time moving pages between RAM and disk. This is thrashing: the disk is constantly busy while useful CPU work drops sharply.
File systems
A file system organizes storage into files within a hierarchy of folders, tracks where each file's data blocks are, and enforces permissions. Absolute paths start at the root (/home/lee/notes.txt), while relative paths start from the current folder (../notes.txt).
Resource issues that affect functionality
| Resource problem | Symptom | Remedy |
|---|---|---|
| Not enough RAM | Slowdown and thrashing when many programs or browser tabs are open | Close programs; add RAM |
| Storage nearly full | Cannot save files or install updates; slower performance | Delete or archive files; add storage |
| CPU overloaded | Laggy interface; slow processing | Close background tasks; faster or more cores |
| Too little network bandwidth | Buffering video; slow downloads | Reduce simultaneous use; upgrade the connection (Section 16.3) |
| Battery or power limits | Mobile devices throttle performance | Power-saving settings |
| Outdated or missing drivers | Devices stop working | Install the correct drivers |
| Resource contention | Programs wait for the same printer, file, or lock | Scheduling, queues, and locking |
Deadlock
A deadlock occurs when processes wait on one another forever. For example, process A holds the printer and waits for the scanner, while process B holds the scanner and waits for the printer. Coffman and colleagues (1971) identified four conditions that must all hold for deadlock to occur:
- Mutual exclusion: a resource can be used by only one process at a time.
- Hold and wait: a process holds one resource while waiting for another.
- No preemption: resources cannot be taken away from a process by force.
- Circular wait: a cycle of processes, each waiting for the next.
Preventing any one condition prevents deadlock. A common method is to make every process request resources in the same fixed order, which breaks circular wait.
Operating systems on different devices
Desktop operating systems prioritize flexibility and multitasking. Mobile operating systems add strict app permissions, battery management, and touch interfaces. Embedded systems (Section 15.3) often use small real-time operating systems that guarantee responses within fixed time limits, which is essential for devices such as airbag controllers and pacemakers.
A computer with 4 GB of RAM becomes extremely slow when a student opens many large programs at once. The storage-activity light stays on constantly, while the programs barely respond. What is the most likely cause?
Which of the following is NOT one of the four conditions that must all hold for deadlock to occur?
Which task is performed by an operating system rather than by an application program?
A new printer does not work until a small program from the manufacturer is installed that lets the operating system send it commands. What type of software is this?