Operating Systems: Difference between revisions
BloomWiki: Operating Systems |
BloomWiki: Operating Systems |
||
| Line 19: | Line 19: | ||
== Understanding == | == Understanding == | ||
The OS is a "Bureaucracy" that manages three main areas: | The OS is a "Bureaucracy" that manages three main areas: '''CPU Time''', '''Memory''', and '''I/O (Input/Output)'''. | ||
'''1. Process Management''': Your computer might have 100 programs open, but only a few CPU cores. The OS performs "Time Slicing"—it gives each program a few milliseconds of CPU time, then "context switches" to the next one so fast that it *looks* like they are all running at once. | |||
'''2. Memory Management''': To prevent one program from crashing the whole system, the OS gives each process its own "Virtual Address Space." The program thinks it has all the memory to itself, but the OS is secretly mapping those addresses to different parts of physical RAM. | |||
'''3. The Kernel vs. User Space''': The "Kernel" is the only part allowed to talk to the hardware. When a program wants to save a file, it can't just write to the disk; it must ask the OS via a '''System Call'''. This provides security and stability. | |||
'''Monolithic vs. Microkernel''': | |||
* | * '''Monolithic''' (Linux, Windows): Most services run inside the kernel for speed. | ||
* | * '''Microkernel''' (macOS/Darwin): Only the essentials run in the kernel; other services (like drivers) run in "User Space" for stability. | ||
== Applying == | == Applying == | ||
| Line 81: | Line 81: | ||
|} | |} | ||
'''The Concept of "Everything is a File"''': In Unix-based systems (Linux, macOS), almost everything—from your keyboard to your internet connection—is treated as a "file" that can be read from or written to. This abstraction is incredibly powerful because it allows programmers to use the same tools to manipulate hardware as they do for simple text files. | |||
== Evaluating == | == Evaluating == | ||
Evaluating an OS: (1) | Evaluating an OS: (1) '''Efficiency''': How much of the hardware power is "eaten up" by the OS itself (overhead)? (2) '''Security''': How well does the OS "sandbox" programs to prevent malware from spreading? (3) '''Compatibility''': How many different types of hardware and older software can it run? (4) '''Stability''': Can the system run for years without needing a reboot (uptime)? | ||
== Creating == | == Creating == | ||
Future Frontiers: (1) | Future Frontiers: (1) '''Distributed OS''': An OS that runs across a "cluster" of computers as if they were one single machine. (2) '''Exokernel''': A radical design that gives applications direct access to hardware for extreme performance (used in high-frequency trading). (3) '''Self-Healing OS''': Using AI to detect and fix corrupted files or driver issues before the user notices. (4) '''Energy-Aware OS''': Deeply optimizing every system call to extend the battery life of IoT and mobile devices. | ||
[[Category:Computer Science]] | [[Category:Computer Science]] | ||
[[Category:Software]] | [[Category:Software]] | ||
[[Category:Operating Systems]] | [[Category:Operating Systems]] | ||
Revision as of 14:22, 23 April 2026
How to read this page: This article maps the topic from beginner to expert across six levels � Remembering, Understanding, Applying, Analyzing, Evaluating, and Creating. Scan the headings to see the full scope, then read from wherever your knowledge starts to feel uncertain. Learn more about how BloomWiki works ?
An Operating System (OS) is the most important software that runs on a computer. It manages the computer's memory and processes, as well as all of its software and hardware. It also allows you to communicate with the computer without knowing how to speak the computer's language. Without an operating system, a computer is just a collection of metal and silicon. By acting as the "resource manager," the OS ensures that different programs don't interfere with each other, that the hardware is used efficiently, and that the user has a consistent interface to work with.
Remembering
- Operating System (OS) — Software that manages computer hardware and software resources.
- Kernel — The core part of the OS that has complete control over everything in the system.
- Process — A program in execution; the basic unit of work in an OS.
- Thread — A subset of a process; multiple threads can run within a single process.
- Virtual Memory — A technique that uses the hard drive to simulate additional RAM.
- File System — The way the OS organizes and tracks files on a storage device (e.g., NTFS, APFS, ext4).
- Interrupt — A signal to the processor emitted by hardware or software indicating an event that needs immediate attention.
- Context Switch — The process of storing and restoring the state of a CPU so that execution can be resumed from the same point at a later time.
- Scheduler — The part of the OS that decides which process runs next and for how long.
- Device Driver — A program that allows the OS to communicate with a specific piece of hardware (e.g., a printer).
- Shell — The user interface that allows access to the OS's services (can be GUI or CLI).
- System Call — The interface between a running program and the operating system.
- Deadlock — A situation where two or more processes are blocked forever, each waiting for the other.
- GUI (Graphical User Interface) — A visual way of interacting with a computer using windows, icons, and menus.
Understanding
The OS is a "Bureaucracy" that manages three main areas: CPU Time, Memory, and I/O (Input/Output).
1. Process Management: Your computer might have 100 programs open, but only a few CPU cores. The OS performs "Time Slicing"—it gives each program a few milliseconds of CPU time, then "context switches" to the next one so fast that it *looks* like they are all running at once.
2. Memory Management: To prevent one program from crashing the whole system, the OS gives each process its own "Virtual Address Space." The program thinks it has all the memory to itself, but the OS is secretly mapping those addresses to different parts of physical RAM.
3. The Kernel vs. User Space: The "Kernel" is the only part allowed to talk to the hardware. When a program wants to save a file, it can't just write to the disk; it must ask the OS via a System Call. This provides security and stability.
Monolithic vs. Microkernel:
- Monolithic (Linux, Windows): Most services run inside the kernel for speed.
- Microkernel (macOS/Darwin): Only the essentials run in the kernel; other services (like drivers) run in "User Space" for stability.
Applying
Modeling the 'Round Robin' Scheduler: <syntaxhighlight lang="python"> def simulate_scheduler(processes, time_quantum):
"""
Simulates a basic Round Robin scheduler.
processes: list of [name, time_needed]
"""
time = 0
while processes:
p_name, p_time = processes.pop(0)
# Run for the quantum or until finished
execution = min(p_time, time_quantum)
time += execution
p_time -= execution
print(f"Time {time:2d}: Running {p_name} for {execution}ms. Remaining: {p_time}ms")
if p_time > 0:
processes.append([p_name, p_time]) # Put back in queue
else:
print(f"--- {p_name} FINISHED ---")
- 3 tasks of varying lengths
tasks = [["Browser", 10], ["Compiler", 15], ["MusicPlayer", 5]] simulate_scheduler(tasks, 5) </syntaxhighlight>
- Major Operating Systems
- Windows → Dominant in desktop/gaming; uses a hybrid kernel.
- Linux → Powers 100% of the world's supercomputers and most web servers; open source.
- macOS / iOS → Based on Unix; tightly integrated with Apple hardware.
- Android → Based on the Linux kernel; the most widely used OS globally.
- Real-Time OS (RTOS) → Specialized systems for spacecraft or medical devices where timing must be 100% predictable.
Analyzing
| Component | Responsibility | Failure Mode |
|---|---|---|
| Scheduler | CPU Allocation | System "stuttering" or lag |
| Virtual Memory | RAM/Disk mapping | "Thrashing" (excessive disk usage) |
| Driver | Hardware communication | "Blue Screen of Death" / Kernel Panic |
| File System | Data organization | File corruption / Data loss |
The Concept of "Everything is a File": In Unix-based systems (Linux, macOS), almost everything—from your keyboard to your internet connection—is treated as a "file" that can be read from or written to. This abstraction is incredibly powerful because it allows programmers to use the same tools to manipulate hardware as they do for simple text files.
Evaluating
Evaluating an OS: (1) Efficiency: How much of the hardware power is "eaten up" by the OS itself (overhead)? (2) Security: How well does the OS "sandbox" programs to prevent malware from spreading? (3) Compatibility: How many different types of hardware and older software can it run? (4) Stability: Can the system run for years without needing a reboot (uptime)?
Creating
Future Frontiers: (1) Distributed OS: An OS that runs across a "cluster" of computers as if they were one single machine. (2) Exokernel: A radical design that gives applications direct access to hardware for extreme performance (used in high-frequency trading). (3) Self-Healing OS: Using AI to detect and fix corrupted files or driver issues before the user notices. (4) Energy-Aware OS: Deeply optimizing every system call to extend the battery life of IoT and mobile devices.