Introduction
Every operating system, regardless of its target device, performs a common set of core functions: process management, memory management, file/storage management, device (I/O) management, and security/protection. Beyond these shared functions, operating systems are also classified into types based on how they schedule work and interact with users — batch, time-sharing, real-time, distributed, network, and embedded/mobile systems each optimize for different goals.
Cricket analogy: A cricket board handles player selection, ground maintenance, ticketing, and security at every venue, but IPL, Test matches, and school cricket run under different formats optimized for different goals, just like batch, time-sharing, and real-time OS types.
Explanation
Process management covers creating, scheduling, and terminating processes, plus coordinating concurrent execution. Memory management tracks which parts of RAM are free or in use, and translates virtual addresses used by programs into physical addresses via the CPU's memory management unit (MMU). File management organizes persistent data into files and directories on storage devices, exposing operations like open/read/write/close. Device management provides uniform interfaces (drivers) so the kernel and applications can control diverse hardware. Security and protection ensure processes and users cannot access resources they are not authorized to touch. On top of these functions, OS types differ in philosophy: a batch OS processes jobs with no interactive user; a time-sharing OS (like Linux or Windows on a desktop) rapidly switches between many interactive users/processes to give the illusion of simultaneity; a real-time OS (RTOS) guarantees a bounded worst-case response time for critical tasks (e.g., automotive control systems); and distributed/network OSes coordinate resources across multiple physically separate machines.
Cricket analogy: A team management office creates and retires player contracts (process management), tracks which nets and pitches are free (memory management), files match scorecards in the archive (file management), issues kit to each player through the equipment room (device management), and checks accreditation badges at the gate (security) — while a T20 league (time-sharing, rotating overs fast) differs from an IPL auction batch process and from an ICC DRS review (real-time bounded response).
Example
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(void) {
/* Demonstrates memory management: the OS lazily backs
this heap allocation with physical pages only when
the program actually touches the memory. */
size_t size = 1024 * 1024; /* 1 MB */
char *buffer = malloc(size);
if (buffer == NULL) {
perror("malloc failed");
return 1;
}
for (size_t i = 0; i < size; i++) {
buffer[i] = 'A'; /* touching pages triggers OS page allocation */
}
printf("Allocated and initialized %zu bytes via the OS memory manager.\n", size);
free(buffer);
return 0;
}Output
The program prints 'Allocated and initialized 1048576 bytes via the OS memory manager.' Under the hood, malloc() asks the OS (often via the brk() or mmap() system calls) for virtual address space; physical RAM pages are typically only committed when the program writes to them (demand paging), a memory-management function performed entirely by the kernel and its MMU cooperation, invisible to the application.
Cricket analogy: When a commentator's stat-tracking app requests memory for a season's ball-by-ball data, the OS reserves the address range immediately but only allocates real memory page-by-page as each over's data is actually written, like a stadium reserving seat numbers but only opening turnstiles as fans actually arrive.
Key Takeaways
- Core OS functions: process, memory, file/storage, device, and security management.
- Memory management includes virtual-to-physical address translation via the MMU.
- Batch OSes run jobs without interactive users; time-sharing OSes interleave many interactive users.
- Real-time OSes guarantee bounded response times for critical tasks, unlike general-purpose OSes.
- Distributed OSes coordinate resources spread across multiple networked machines.
Practice what you learned
1. Which of the following is NOT typically considered a core function of an operating system?
2. What distinguishes a real-time operating system (RTOS) from a general-purpose time-sharing OS?
3. In a time-sharing operating system, what is the main goal?
4. In the example program, which OS function is primarily illustrated by malloc() and touching the allocated buffer?
Was this page helpful?
You May Also Like
Introduction to Operating Systems
Learn what an operating system is, why it exists, and how it mediates between hardware and applications.
System Calls
Understand how applications request kernel services through system calls and the user-to-kernel mode transition.
OS Structure and Kernel Types
Compare monolithic, microkernel, and hybrid kernel architectures with real-world examples.