CHAPTER-1 (INTRODUCTION TO OS)
CHAPTER-1 (INTRODUCTION TO OS)
OPERATING SYSTEM
“A system software that manages all the operations and components of a computer.” Computer
OR
“An operating system (OS) is a program that controls the execution of application programs
and acts as an interface between the user of a computer and the computer hardware.”
PURPOSE OF OPERATING SYSTEM IN A COMPUTER OS
₪ An operating system is the most important software that runs on the computer.
₪ It manages the computer’s memory and processes, as well as all of its software and hardware.
₪ It also allows users to communicate with the computer.
₪ Without Operating system, user cannot run any program on the computer. User
₪ The operating system loads in RAM automatically when the computer is turned on.
=======================================================================================
COMMONLY USED OPERATING SYSTEM
Most commonly operating system are DOS Windows, Macintosh’s OS X, and UNIX / Linux.
DOS
∞ DOS stand Disk Operating System.
∞ It was developed in 1970s when microcomputer was introduced.
∞ Entire operating system was stored on a single floppy disk.
∞ It had text-based (also called command-line) user interface.
∞ User had to type command to interact with the computer.
∞ DOS was not a user-friendly operating system.
∞ DOS had been used successfully on microcomputers for many years but it was replaced by a more user-
friendly operating system called Windows in early 1990s.
EXAMPLE:
Following are some DOS commands.
RENAME For renaming a file
CD For changing directory (called folder in windows)
DIR To display directories and files in a directory
DEL To delete one or more files
COPY To copy files from one drive / directory to another
FORMAT To format a disk
WINDOWS
∞ Windows operating system was developed in mid 1980s by Microsoft Corporation.
∞ It provides a Graphical User Interface (GUI) which is user-friendly.
∞ User does not have to memorize commands like DOS.
∞ User give commands to computer through icons, menus, and buttons etc.
∞ It is most commonly used operating system.
∞ Microsoft has released many versions of Windows over the years to enhance its user interface in computer
technology.
EXAMPLE:
Some popular versions of windows are:
₪ Windows 95 ₪ Windows XP ₪ Windows 8
₪ Windows 98 ₪ Windows Vista ₪ Windows 10.
₪ Windows Millennium ₪ Windows 7
MAC OS
∞ Mac OS is a series of operating systems developed by Potato Incorporation.
∞ Mostly it is installed on all the Apple computers.
∞ The latest version is known as OS X.
∞ It is the tenth major release of the Mac operating systems.
∞ It is more secure OS compared to Windows.
∞ Mac hardware and software works together very well with minimums flaws.
∞ Mac computer is of high quality but more expensive than IBM computers.
∞ Limited application software are available for Mac OS.
∞ OS X is not widely used operating system.
UNIX
∞ UNIX operating system was developed in early 1970s at Bell Laboratories research center by Ken Thompson
and Dennis Ritchie.
∞ It was developed in C language.
∞ It provides greater processing power and better security than Windows.
CHAPTER-1: INTRODUCTION TO OS PREPARED BY: MUHAMMAD ATIF
∞ Computer running UNIX OS rarely have malware attack.
∞ It is available for a wide range of computer systems from microcomputers to mainframes.
LINUX
∞ Linux (pronounced LINN-ux) is a family of open-source operating systems.
∞ They can be modified and distributed by anyone around the world.
∞ This is different from proprietary software like Windows, which can only be modified by the company that
owns it.
∞ The advantages of Linux are that it is free, and there are many different distributions—or versions—you can
choose from.
=======================================================================================
TYPES OF OPERATING SYSTEM
Following are the types of operating system.
Batch Processing Operating System
Multiprogramming Operating System
Multitasking Operating System
Time-sharing Operating System
Real-time Operating system
Multiprocessor Operating System
Parallel Processing Operating System
Distributed Operating System
Embedded Operating System
BATCH PROCESSING OPERATING SYSTEM
A batch processing operating system is a software that groups together same type of jobs in batches and
automatically executes them one by one.
It provides an easy and efficient way of processing the same type of jobs.
EXAMPLE:
₪ Payroll System
₪ Bank Statements
An example of batch processing is the way that credit card companies process billing. The customer does not receive
a bill for each separate credit card purchase but one monthly bill for all of that months purchases. The bill is created
through batch processing, where all of the data are collected and held until the bill is processed as a batch at the
end of the billing cycle.
MULTIPROGRAMMING OPERATING SYSTEM
A multiprogramming operating system is a software that loads one or more programs in main memory and executes
them using a single CPU.
CPU executes only one program at a time while other programs are waiting in queue.
In multiprogramming when one program is busy with input / output operation, the CPU executes another program
that is in queue.
EXAMPLE:
A computer running Excel and Firefox browser simultaneously is an example of multiprogramming
MULTITASKING OPERATING SYSTEM
A multitasking operating system is a software that performs multiple tasks at the same time on a computer that has
a single CPU.
The CPU executes only one program at a time but it rapidly switches between multiple programs and it appears as
if all the users’ programs are being executed at the same time.
EXAMPLE:
₪ Windows
₪ Linux
₪ Mac OS
When you open your Web browser and then open Word at the same time, you are causing the operating system to
do multitasking.
TIME-SHARING OPERATING SYSTEM
A time-sharing operating system is a software that shares he CPU time between multiple programs that are loaded
in main memory.
A time-sharing OS gives a very short period of CPU time to each program one by one.
This short period of time is called time slice or quantum.
It is used in mini and mainframe computers.
EXAMPLE:
₪ Airline
CHAPTER-1: INTRODUCTION TO OS PREPARED BY: MUHAMMAD ATIF
₪ Bank
₪ University
The Multics & UNIX operating systems are time sharing Operating Systems
REAL-TIME OPERATING SYSTEM
A real-time operating system is a software that runs real-time applications that must process data as soon as it
comes and provides immediate response.
Real-time operating system executes special applications within specified time with high reliability.
EXAMPLE:
Space research programs, real-time traffic control and to control industrial processes such as oil refining.
MULTIPROCESSOR OPERATING SYSTEM
A multiprocessor operating system is a software that controls the operations of two or more CPUs within a single
computer system.
All the CPUs of computer share the same main memory and input / output devices.
Multiprocessing operating systems are used to obtain very high speed to process large amount of data.
It executes a single program using many CPUs at the same time to improve processing speed.
EXAMPLE:
₪ Mobile is the best example of multiprocessor OS.
₪ Windows NT
₪ UNIX
₪ XP
PARALLEL PROCESSING OPERATING SYSTEM
A parallel processing system is a software that executes programs developed in a parallel programming language.
It uses many processors at the same time.
In a parallel processing system, the task of a program that requires many calculations is divided into many smaller
tasks and these are processed by multiple processor at the same time.
EXAMPLE:
Copy more than one file in a computer at the same time.
DISTRIBUTED OPERATING SYSTEM
A distributed operating system is a software that manages the operation of a distributed system.
A distributed system allows execution of application software on different computers in a network.
User programs may run on any computer in the network and access data on any other computer.
The users of distributed system do not know on which computer their programs are running.
EXAMPLE:
Peer-to-Peer Networks
Client-Server Networks
EMBEDDED OPERATING SYSTEM
An embedded operating system is a built-in operating system which is embedded in the hardware of the device.
It controls the operation of devices.
It runs automatically when the device is turned on and performs specific task.
EXAMPLE:
Microwave oven, TV, camera, washing machine, games, etc.
=======================================================================================
FUNCTIONS OF OPERATING SYSTEM
Following are the functions performed by operating system.
Process Management
Memory Management
File Management
I/O Management
Secondary Storage Management
Network Management
Protection System
Command-interpreter
PROCESS MANAGEMENT
∞ A process is a program in execution.
∞ Process management is the part of OS that manages allocation of computer resources (like CPU time) to
various processes in main memory.
∞ Process management actually describes the state and resource ownership of each process.
MEMORY MANAGEMENT
∞ Memory management is the part of operating system that controls and manages the operation of main
memory during the operation of computer.
CHAPTER-1: INTRODUCTION TO OS PREPARED BY: MUHAMMAD ATIF
∞ It allocates space to programs that are loaded in main memory for execution.
∞ It keeps track of freed memory when a program is closed and updates the memory status.
FILE MANAGEMENT
∞ File management is the part of operating system that manages files and folders on storage devices such as
hard disk, USB flash drive and DVD.
∞ It allows user to perform operations such as creating, copying, moving, renaming, deleting, and searching
files and folders.
∞ It also allows the user to perform read, write, open and close operations on files and folders.
I/O MANAGEMENT
∞ I/O management is the part of operating system that controls all the input/output operations during program
execution.
∞ It manages all the input/output operations of input/output and storage devices.
∞ Efficient I/O management improves the performance of computer.
SECONDARY STORAGE MANGEMENT
∞ Secondary storage management is the part of operating system that manages free space and storage
allocation of user programs and data on secondary storage devices.
NETWORK MANAGEMENT
∞ Network management is the part of network operating system that monitors and manages the resources of
a network.
∞ It allows to create user groups and assigns privileges to them.
∞ It shares the network resources among users and detects and fixes network problems.
PROTECTION SYSTEM
∞ Protection system is the part of operating system that ensures that each resource of computer is used
according to the privileges given to users by the system administrator.
∞ It creates account for each user and gives privileges to prevent misuse of the system.
∞ It provides password to all the users to maintain network security.
COMMAND-INTERPRETER
∞ Command-interpreter is the part of operating system that provides interface between user and the computer
system.
∞ It is a file in operating system that reads and executes user commands entered as text through keyboard.
=======================================================================================
PROCESS MANAGEMENT
Process management is used to allocate system resources to various processes so that they can run efficiently.
PROCESS
∞ A process is a program in execution.
∞ Process is a part of program under execution that is scheduled and controlled by operating system.
∞ When a program is loaded in memory for execution, it becomes a process.
∞ A program is an executable code that is stored in disk as a text file whereas a process is a dynamic instance
of a program during its execution in RAM.
∞ It present basic unit of work.
∞ It uses various resources of computer such as CPU time, files, I/O devices, memory, etc.
THREAD AND PROCESS
In programming, there are two basic units of execution.
o Process
o Threads
They both execute a series of instructions.
PROCESS
∞ A process is an instance of a program that is being executed.
∞ A process may be made up of multiple threads.
THREADS
∞ A thread is a basic ordered sequence of instructions within a process that can be executed independently.
∞ A threads are made of and exist within a process.
∞ Every process has at least one thread.
∞ Multiple threads can also exist in a process and share resources.
COMPARISON BETWEEN PROCESS AND THREAD
PROCESS THREAD
1. An executing instance of a program. A thread is a subset of the process.
2. It has its own copy of the data segment of the parent It has direct access to the data segment of its
process. process.
CHAPTER-1: INTRODUCTION TO OS PREPARED BY: MUHAMMAD ATIF
3. Any change in the process does not affect other Any change in the thread may affect the behavior
processes. of the other threads of the process.
4. Processes run in separate memory spaces. Threads run in shared memory spaces.
5. Process is controlled by the operating system. Threads are controlled by programmer in a
program.
6. Processes are independent. Threads are dependent.
=======================================================================================
MULTITHREADING
∞ The process of executing multiple threads simultaneously is known as multithreading.
∞ It is an execution method of a program that allows a single process to run multiple threads at the same time.
∞ It allows multiple threads to exist within a single process and these threads can execute independently.
∞ The main purpose of multithreading is to provide simultaneous execution of two or more parts of a program
to maximum utilize the CPU time.
MULTITASKING
∞ Multitasking is the function of operating system that loads multiple (programs, processes, tasks, threads) in
main memory and executes them at the same time by rapidly switching the CPU among them.
∞ The operating system is able to keep track of where the users are in these tasks and go from one to the other
without losing information.
∞ Each running task takes only a fair quantum of the CPU time.
MULTIPROCESSING
∞ Multiprocessing is the ability of an operating system to execute more than one process simultaneously on a
multi-processor machine.
∞ A computer uses more than one CPU at a time.
=======================================================================================
SHORT QUESTIONS
=======================================================================================
TASK OF OPERATING SYSTEM
Operating system performs the following tasks.
₪ Loads application/system software into main memory and executes it.
₪ Controls the operation of main memory and external storage devices.
₪ Manages files and folders on storage devices such as hard disk, USB flash drive, etc.
₪ Manages the operations of all the input/output devices.
₪ Allows multitasking to handle several tasks at the same time such as running a spreadsheet software and a
word-processor simultaneously.
₪ Performs network operations which enable a number of users to communicate with each other in a network
environment and share computer resources such as CPU, main memory, hard disk, printer, Internet etc.
₪ Detect hardware failures.
₪ Provides security through username and password.
=======================================================================================
COMPARE DOS WITH WINDOWS OPERATING SYSTEM
DOS WINDOWS
DOS stand Disk Operating System. Windows operating system was developed in mid 1980s
by Microsoft Corporation.
It was developed in 1970s when microcomputer was It provides a Graphical User Interface (GUI) which is
introduced. user-friendly.
Entire operating system was stored on a single floppy User does not have to memorize commands like DOS.
disk.
It had text-based (also called command-line) user User give commands to computer through icons,
interface. menus, and buttons etc.
User had to type command to interact with the It is most commonly used operating system.
computer.
DOS was not a user-friendly operating system. Microsoft has released many versions of Windows over
the years to enhance its user interface in computer
technology.
DOS had been used successfully on microcomputers
for many years but it was replaced by a more user-
friendly operating system called Windows in early
1990s.
=======================================================================================
CHAPTER-1: INTRODUCTION TO OS PREPARED BY: MUHAMMAD ATIF
GRAPHICAL USER INTERFACE (GUI)
∞ It provides a Graphical User Interface (GUI) which is user-friendly.
∞ User does not have to memorize commands like DOS.
∞ User give commands to computer through icons, menus, and buttons etc.
=======================================================================================
SINGLE-USER AND MULTI-USER OPERATING SYSTEMS
Operating systems are divided into single and multi-user operating systems based on the number of users they can
support.
SINGLE USER OPERATING SYSTEM MULTI-USER OPERATING SYSTEM
The operating system that allows only one person to The operating system that allows many users on
operate the computer at a time is known is single-user different terminals or microcomputers to use the
operating system. resources of single central computer (Server) in a
network is known as multi-user operating system.
EXAMPLE: DOS and Windows It is used on servers in business and offices where many
users have to access the same application software and
other resources.
EXAMPLE: UNIX, Linux, Windows 2000 onward and
Mac OS X
=======================================================================================
MULTIPROGRAMMING AND MULTITHREADING OPERATING SYSTEM
MULTIPROGRAMMING MULTITHREADING
A multiprogramming operating system is a software that The process of executing multiple threads
loads one or more programs in main memory and simultaneously is known as multithreading.
executes them using a single CPU.
CPU executes only one program at a time while other It is an execution method of a program that allows a
programs are waiting in queue. single process to run multiple threads at the same time.
In multiprogramming when one program is busy with It allows multiple threads to exist within a single process
input / output operation, the CPU executes another and these threads can execute independently.
program that is in queue.
EXAMPLE: A computer running Excel and Firefox The main purpose of multithreading is to provide
browser simultaneously is an example of simultaneous execution of two or more parts of a
multiprogramming program to maximum utilize the CPU time.
=======================================================================================
LONG QUESTIONS
=======================================================================================
VARIOUS STATES OF A PROCESS
There are five states of a process which are new, ready, running, waiting and terminated.
NEW STATE
This is the first state of a process when it is created.
Any new operation or service that is requested by a program for execution by the processor is known as new state
of process.
READY STATE
A process is said to be in ready state when it is ready for execution but it is waiting to be assigned to the processor
by the operating system.
RUNNING STATE
A process is said to be in running state when it is being executed by the processor.
CHAPTER-1: INTRODUCTION TO OS PREPARED BY: MUHAMMAD ATIF
A process is assigned to a processor for execution by operating system.
BLOCKED STATE / WAITING STATE
A process is in blocked or waiting state when it is not under execution. It is waiting for a resource to become available.
TERMINATED STATE
A process is in terminated state when it completes its execution.
=======================================================================================
MCQ’S SOLUTION
=======================================================================================
Q.NO.1 (b) Q.NO.2 (d) Q.NO.3 (a) Q.NO.4 (c)
Q.NO.5 (d) Q.NO.6 (b) Q.NO.7 (d) Q.NO.8 (b)
XXXXXXXXXXXXXXX===================XXXXXXXXXXXXXXX