Introduction to Operating System (OS)
Definition:
An Operating System (OS) is a system software that acts as an interface between user and
hardware. It manages computer hardware and software resources and provides services to
users and applications.
Functions of OS:
• Manages hardware resources (CPU, memory, I/O)
• Executes and manages processes
• Handles files and storage
• Provides user interface (CLI/GUI)
Examples: Windows, Linux, macOS, Android
Structure: users→ applications→ operating system → hardware
Types of Software
Software is broadly classified into two main categories:
1. System Software
2. Application Software
System Software: System software is a set of programs designed to control and manage
computer hardware and basic system operations. It acts as a bridge between hardware and user
applications.
Key Functions:
• Manages system resources like CPU, memory, I/O devices.
• Provides a platform for running application software.
• Controls and coordinates hardware components.
Examples:
• Operating Systems: Windows, Linux, macOS
• Device Drivers: Printer driver, Graphics card driver
• Utilities: Antivirus, Disk cleanup tools
• Firmware: Software built into hardware like BIOS.
Application Software
Application software is designed to perform specific user-oriented tasks such as word
processing, browsing the internet, or managing data.
Key Functions:
• Helps users complete specific tasks.
• Runs on top of the system software.
• Tailored for end-user needs.
Types:
a. General-Purpose Application Software:
• Used for everyday tasks.
• Examples: MS Word, Excel, PowerPoint, Google Chrome
b. Customized/Specific Application Software:
• Developed for a particular organization or task.
• Examples: Banking software, Hospital Management System, ERP Software
Examples: Web browsers, Media players, Office tools, Email clients, Games
Types os’s:
Os interfaces: CUI, GUI
based on user task: SUST, SUMT, MUMT
1. Batch Operating System: Executes batches of jobs without user interaction
Ex: early IBM systems.
Example Work:
• Payroll System in Banks or Government Offices
→ Employee salary is calculated and processed in batches without manual intervention.
Other Example:
• Electricity bill generation at the end of the month.
2. Time-Sharing Operating System: Multiple users can use system at the same time via
time slices
Ex: UNIX
Example Work:
• University Computer Labs
→ Many students use the same server system at the same time. Time-sharing allows
each student to get a small CPU time slice.
Other Example:
• Shared hosting websites (multiple users using one server).
Ex: IRCTC,ATM, movie tickets sites…(doctor -o.p relation)
3. Real-Time Operating System (RTOS): Responds quickly to input; used in embedded
systems
EX: RTlinux, vxworks
Example Work:
• Airbag system in a car
→ Must inflate the airbag within milliseconds of crash detection. Delay can be fatal.
Other Example:
• Heart rate monitoring system in hospitals.
4. Distributed Operating System: Manages a group of separate computers and makes them
appear as one system
Example Work:
• Google Search Engine
→ Query goes to multiple servers (located in different places), processed parallelly, and
result is shown quickly.
Other Example:
• Online multiplayer games like PUBG or Fortnite (game state synced across servers).
5. Network Operating System: Provides services over a network
Example Work:
• Office Network with File Sharing
→ Employees can access shared files and printers via a central server.
Other Example:
• School computer lab connected to a main server using Novell NetWare or Windows
Server.
6. Mobile Operating System: Designed for mobile devices
Example Work:
• Android OS running on your smartphone
→ Helps you make calls, use apps like WhatsApp, Instagram, pay via UPI, etc.
Other Example:
• iOS on iPhones for camera, App Store, messages.
7. Multiprogramming Operating System: Executes more than one program at the same time
Ex: LINUX,windows
Example Work:
• A developer compiling code while downloading files and playing music
→ All programs are loaded in memory and executed based on CPU scheduling.
8. Multitasking Operating System
Example Work:
• A user opening MS Word, Chrome browser, and File Explorer together on Windows 10
→ Switches between them and works simultaneously.
Operating System Concepts
These are basic ideas behind OS working:
1. Process: A running program. OS manages creation, execution, and termination.
2. Thread: A lightweight process. Multiple threads can run in one process.
3. Memory Management: Allocates and deallocates memory to processes.
4. File System: Organizes and manages data storage.
5. I/O System: Manages input/output devices like keyboard, mouse, printer.
6. Security: Protects data and resources from unauthorized access.
7. Concurrency: Handles multiple operations simultaneously using scheduling.
Operating System Services
Divided into 2 types: 1. User services 2. system services
User services:
1. Program Execution
The OS loads programs into memory and executes them. It provides the necessary
environment for program execution, including CPU scheduling, memory, and I/O.
2. User interface: interface makes very easy to communicate with the system, otherwise it
is difficulty to work with system,
CUI- command user interface, ex:DOS
GUI-graphical user interface, ex: windows, linux, mac…
3. I/O Operations
Since user programs cannot directly perform I/O, the OS provides a way to read/write
data to devices (like disks, printers, etc.) through I/O system calls.
4. Communication Services
Used in distributed systems or multi-tasking. The OS enables processes to communicate
via message passing (for processes on different systems) or shared memory (for
processes on the same system).
5. File System and Manipulation
Programs need to read/write/create/delete files. The OS provides these file-handling
services and ensures access control (permissions and security).
6. Error Detection
The OS constantly monitors the system to detect and handle errors in CPU, memory, I/O
devices, or software. It ensures correct and consistent operation.
The program or hardware (memory, i/o etc..) errors should be reported to user when os
not handled those errors
SYSTEM SERVICES
7. Resource Allocation
In multi-user or multi-tasking environments, the OS manages resources like CPU,
memory, and I/O devices, allocating them fairly and efficiently.
8. Accounting (Optional Service)
Some systems track the usage of CPU time, memory, I/O for each user or job to provide
billing or usage statistics.
9. Protection and Security
The OS ensures that all access to system resources is controlled. It protects data and
resources from unauthorized access using authentication and access control.
These services form the interface between the user (or application) and the hardware, and are
usually accessed through system calls provided by the OS.
Kernel:
➢ kernel is the system s/w and it’s part of the os.
➢ Kernel Lowest layer of os
➢ Kernel acts as interface b/w hardware and process of computer
➢ Kernel loads first in memory after os has been loaded and remains in memory until os is
shutdown
➢ The main functions of kernel are: device management, memory management, task
management
➢ Here the memory is divided into 2 spaces 1. User space: all the applications will get
executed, 2. Protected kernel space: device, memory, task management will be here. no
other application will access this space.
4. Introduction to System Call:
A system call is a way for a user program to request services from the operating system's
kernel.
It acts as an interface between user-level applications and the OS.
System call will act as an interface of s/w application and kernel.
Dig: 1 User application
System call
kernel
Hardware
System call provides the services of the os to the process via API
API-Application program interfaces
Whenever the process is being executed & if it requires any resource the process will
create a system call (interrupt), and sends to the kernel.
User mode Return to
user
Prog System call
execution
Kernal mode Execute
system call
Here system call table will be maintained, based on the priority each system call will be
executed and control passed to user space.
System calls are the only entry points to kernel space .
Types of System Calls in OS
System calls are commonly divided into 5 main categories:
1. Process Control System Calls
Used for creating, terminating, and managing processes.
Examples:
• fork() – create a new process
• exit() – terminate a process
• wait() – wait for a process to finish
• exec() – execute a new program
• getpid() – get process ID
2. File Management System Calls
Used to handle files and directories.
Examples:
• open() – open a file
• read() – read from a file
• write() – write to a file
• close() – close a file
• unlink() – delete a file
3. Device Management System Calls
Used to access or control I/O devices (like keyboard, printer, disk).
Examples:
• ioctl() – device control operations
• read() / write() – transfer data to/from a device
• open() / close() – open or close a device
4. Information Maintenance System Calls
Used to get or set system data and attributes.
Examples:
• gettimeofday() – get current time
• settimeofday() – set system time
• getuid() – get user ID
• alarm() – set a timer
• sleep() – delay process
5. Communication System Calls
Used for inter-process communication (IPC), networking, and messaging.
Examples:
• pipe() – create a communication pipe
• shmget() – allocate shared memory
• send() / recv() – send/receive messages
• socket() – create a network socket
Protection system calls are a special type of system call used to define or check permissions
related to accessing system resources.
These system calls are used to:
• Set permissions (read, write, execute)
• Change ownership of resources
• Control access rights for users or groups