Operating Systems
Fundamental Concepts of Operating Systems
- Hardware and Machinery: Hardware is described as finely designed machinery. However, a machine is ultimately just a machine and must be made to work. In the context of computers, this is either done by the user or by the Operating System (OS), which acts as the entity that "does it for us."
- Definition of Operating System: An Operating System is a program that acts as an intermediary or interface between a computer user and the computer hardware (all computer resources). It is an essential component that controls all other components of the computer system.
- Primary and Secondary Goals:
- Primary Goal: To make the computer system convenient for the user to use.
- Secondary Goal: To use computer hardware in an efficient manner.
Major Components of a Computer System
- The Hardware: Provides the basic computing resources.
- The Operating System: Controls and coordinates the use of hardware among various application programs for various users.
- The Application Program Routines: These define the ways in which resources are used to solve computing problems. Examples include:
- Compilers
- Linkers
- Database Management Systems (DBMS)
- Utility programs
- The Humanware: Refers to the users of the system.
Services Provided by an Operating System
- Program Execution: The OS is responsible for executing both user programs and system programs (special programs required for machine functioning).
- Handling Input/Output (I/O) Operations: The OS manages various inputs (keyboard, mouse) and outputs (printer, monitor). Different devices require unique handling; for example, mouse input is handled differently than keyboard input, and printer output is handled differently than monitor output.
- Manipulation of File System: This involves making decisions regarding where files are stored (e.g., hard disk or flash drive) and how they are stored.
- Error Detection and Handling: The OS identifies any occurring errors and manages them properly.
- Resource Allocation: Aims at the proper use of available resources. For instance, if multiple files are queued for printing, the OS decides the order and method of the task.
- Accounting: The OS maintains a record of functioning and errors that have occurred.
- Information and Resource Protection: The OS ensures that resources and information are used correctly and foils any unauthorized or incorrect attempts to access them.
- Providing User Interface: This allows users to interact with the system via graphical elements or text commands.
The Anatomy of an Operating System: Shell and Kernel
An Operating System is broadly divided into two parts:
- The Shell: This is the part responsible for interacting with the user. It acts as a command interpreter that takes user commands, translates them into machine language, and passes them to the Kernel.
- The Kernel: This is the core part of the OS. It functions at the most basic level, communicating directly with the hardware and managing resources like the CPU and memory. It carries out tasks such as:
- Process management
- Device I/O management
- File systems
- Interrupt and event handling
- Memory management
- Timer management
Types of Kernels
- Monolithic Kernel: A single module that carries out all the aforementioned tasks of the kernel.
- Microkernel: A minimalist module that handles only basic functions and uses separately written specialized software (like device drivers or file systems) for other services.
Functions of the Operating System
OS functions are categorized into three areas:
- Essential Functions: Ensure effective utilization of resources.
- Monitoring Functions: Collect information related to system performance.
- Service Functions: Enhance facilities provided to the user.
Specific Major Functions
- Processor Management: Allocates the CPU to various running programs (processes). It prepares, schedules, controls, and monitors "jobs" (collections of related programs and data).
- Memory Management: Manages computer memory by allocating space to running processes and de-allocating it upon completion.
- File Management: Governs the permanent storage and retrieval of data from external storage devices, ensuring data is saved in correct locations.
- Device Management: Responsible for the smooth reading of data from input devices and sending data to the correct output devices.
- User Interface: Establishes standard communication via commands that control the hardware.
The Need for an Operating System
- The Secretary Metaphor: The OS is like a secretary to a boss. The user (boss) gives orders, and the OS (secretary) decides "How to do?", "What to do?", and "When to do?".
- Specific Reasons for Necessity:
- Facilitates convenient access to hardware in the user's language.
- Improves efficiency by managing CPU and memory for optimal performance.
- Provides security through authorized user accounts.
- Emulates features not available in hardware, such as Virtual Memory (giving the impression of having more memory than is physically present).
Device Drivers
- Definition: A device driver is a group of files or a specially written program that enables hardware devices to communicate with the operating system.
- Purpose: Every peripheral device (printer, display, CD-ROM, USB stick, Bluetooth device) is unique. The OS kernel must "speak" to them in a specific way. Since including code for every possible device would make the OS too large and complex, drivers are written separately.
- Requirement: Every installed hardware device requires a different driver to provide specific instructions to the OS.
Types of Operating Systems (by Processing Method)
- Single User OS: Supports only one user at a time.
- Single Task OS: Runs one application at a time (e.g., MS-DOS, mobile OS).
- Single User, Multitasking OS: One user can run multiple applications simultaneously (e.g., Windows Vista, Windows , Windows , Linux, MacOS Leopard).
- Multiprogram OS: A multi-user OS where more than one user program is loaded and active in the main store simultaneously. Examples include Unix, Linux, and IBM AS400.
- Time Sharing OS: Uses a time-sharing technique where each program gets a fair share of CPU time (represented as or ). If time elapses or an I/O request occurs, the CPU shifts to the next job. Examples: BSD Unix, NOS/VE, GEnie.
- Real Time OS (RTOS): Jobs have fixed deadlines. Performance is measured by the ability to meet these deadlines. Examples: LynxOS, OSE, RT Linux.
- Multiprocessing OS: Handles more than one processor (). It handles load sharing for identical processors or controls slave processors via a main processor for unidentical ones. Examples: Unix, Linux, Windows NT.
- Distributed OS: Designed to share workloads over multiple servers at multiple locations (decentralized architecture). Common in reservation systems. Examples: Unix, Linux, DCE, X/Open.
Operating Systems by Interface Type
- Command Line Interface (CLI): An older style where users type commands at a prompt using a keyboard. Examples: DOS, Unix.
- Interactive Operating System Interfaces: Allow commands via pointing or touching.
- Graphical User Interface (GUI): Uses visual elements. Often called WIMP interfaces (Windows, Icons, Menus, Pointers). First created by Xerox in and further developed by Apple for the Macintosh. Examples: Windows, Mac OS.
- Touchscreen Interface: Also known as Post-WIMP interfaces. Access is via touch and finger gestures (pinching, rotating, swiping). Used in mobile phones, tablets (IPad), and modern car dashboards. Examples: Windows , Windows , Android, iOS.
- Note: All WIMPS are GUIs, but some GUIs are not WIMPS.
Commonly Used Operating Systems
- Linux: An open-source system originally written by Linus Torvalds. It is free to use, modify, and redistribute. It is a key part of the LAMP stack (Linux, Apache, MySQL, PHP).
- Microsoft Windows: A family of GUI operating systems introduced in November . It eventually overtook Mac OS in market dominance. Windows is a notable client version.
- BOSS (Bharat Operating System Solutions): An Indian distribution of GNU/Linux based on Debian. It includes specialized software like BharateeyaOO and is localized for Indian languages.
- Solaris: A Unix-based OS introduced by Sun Microsystems in as the successor to SunOS.
- Mobile Operating Systems:
- Android: Linux-based platform released under the Apache v2 open-source license by Google and the Open Handset Alliance (OHA).
- Symbian: Primarily used on Nokia smartphones for and requirements.
- Windows Phone: Developed by Microsoft as the successor to Windows Mobile ( and are versions).
- Apple iOS: Exclusive to Apple devices (iPhone, iPad, iPod touch). Known as iPhone OS before June .
- RIM BlackBerry OS: Developed by Research In Motion (RIM). Its latest OS is called QNX.
File Systems
- Definition: The component of the OS responsible for organizing and retrieving files from storage devices. It sets up a structure (like a hierarchical tree) and rules for reading/writing.
- Hierarchical File System: Uses directories/folders to organize files into a tree structure. For a file
File4.txtinSubfolder1BunderFolder1, the path is/Folder1/Subfolder1B/File4.txt. - Functions of a File System:
- Creating a storage structure.
- Specifying naming conventions (e.g., MS-DOS allowed a primary name of max characters and an extension of max characters).
- Providing access/retrieval methods.
Summary of Functions
- Processor Management: Target is maximum throughput.
- Storage Management: Target is minimum wastage and program protection.
- Information Management: Target is providing, processing, and maintaining information.