CSC114 ยท 2074 ยท 10 marks
What is the objective of using operating system? How operating system performs process, memory and file management activities?
What is the objective of using operating system? How operating system performs process, memory and file management activities?[10]
Quick answer
An Operating System (OS) is system software that acts as an interface between the user and the computer hardware. It manages all the hardware and software resources of a computer system.
Operating System: Objectives and Management Activities
Definition of Operating System
Objectives of Using an Operating System
The main objectives of using an operating system are:
-
Resource Management: The OS manages hardware resources such as CPU, memory, storage, and input/output devices efficiently among multiple users and processes.
-
Process Execution: The OS provides an environment in which programs (processes) can be created, executed, and terminated in an orderly manner.
-
Convenience: The OS makes the computer system convenient to use by providing a user-friendly interface, so users do not need to deal directly with hardware.
-
Efficiency: The OS ensures that the computer hardware is used in an efficient manner, maximizing throughput and minimizing idle time.
-
Security and Protection: The OS protects data and programs from unauthorized access and ensures that one process does not interfere with another.
-
Error Detection and Handling: The OS constantly monitors the system for errors in hardware and software and takes appropriate action.
-
Communication: The OS facilitates communication between processes and between the user and the system through standard interfaces.
-
File Management: The OS organizes, stores, retrieves, and manages files on storage devices in a systematic way.
How the Operating System Performs Management Activities
1. Process Management
A process is a program in a state of execution. It is a unit of work for the operating system. A process can be created, executed, and stopped. The process management system allocates the resources required by a process during process creation and process execution.
The OS performs the following process management activities:
- Process Creation: When a user runs a program, the OS creates a process for it and allocates necessary resources (CPU time, memory, files).
- Process Execution: The OS schedules the process for execution using scheduling algorithms (e.g., Round Robin, FCFS). The CPU executes the instructions of the process.
- Process States: During execution, a process passes through various states:
- New: The process is being created.
- Ready: The process is waiting to be assigned to the CPU.
- Running: The process is currently being executed by the CPU.
- Waiting/Blocked: The process is waiting for some event (e.g., I/O completion).
- Terminated: The process has finished execution.
- Process Termination: Once execution is complete, the OS stops the process and frees all allocated resources.
- Process Synchronization and Communication: The OS ensures that multiple processes can communicate and synchronize without conflict.
2. Memory Management
In a computer, multiple processes execute at the same time, and every process requires a certain amount of memory to execute. This memory is made available by the memory management system of the OS. On completion of a process's execution, the memory is de-allocated and made available to another process.
The OS performs the following memory management activities:
-
Memory Allocation: The OS keeps track of which blocks of memory are free (called holes) and which are occupied. When a process needs memory, the OS allocates a suitable block to it.
- In a single-user OS, allocated memory is freed and made available to any other process after execution.
- In a multi-user OS, the OS tracks memory allocation for multiple processes simultaneously, handling memory protection and sharing.
-
Memory De-allocation: When a process finishes execution, the OS frees the memory it was using and makes it available for other processes.
-
Memory Protection: The OS ensures that one process cannot access the memory space of another process, preventing data corruption.
-
Virtual Memory: When the physical memory (RAM) is insufficient for all running processes, the OS creates virtual memory. This technique uses a portion of the hard disk as an extension of RAM, allowing processes to be allocated memory even when physical RAM is full.
When the OS keeps track of processes, sometimes the memory space available becomes less than what those processes need. In that case, the OS creates virtual memory so that processes are allocated memory properly.
3. File Management
The OS performs the following file management activities:
- File Creation and Deletion: The OS allows users and programs to create new files and delete existing ones on storage devices.
- File Organization: Files are organized into a hierarchical directory (folder) structure, making it easy to locate and manage them.
- File Access Control: The OS controls who can read, write, or execute a file, providing security and protection of data.
- File Storage Management: The OS manages how files are stored on physical storage devices (hard disk, SSD), keeping track of used and free storage blocks.
- File Retrieval: The OS provides mechanisms to search for and retrieve files quickly when requested by users or programs.
- Backup and Recovery: The OS may support backup utilities to protect files from accidental loss or corruption.
Summary Table
| Management Activity | Key Function |
|---|---|
| Process Management | Create, schedule, execute, and terminate processes; manage process states |
| Memory Management | Allocate/de-allocate memory, memory protection, virtual memory |
| File Management | Create, organize, protect, store, and retrieve files |
In conclusion, the operating system serves as the backbone of a computer system. Its objectives are to provide convenience, efficiency, security, and proper resource management. Through process management, memory management, and file management, the OS ensures that all hardware and software resources are used optimally and that multiple users and programs can work simultaneously without conflict.
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.