0% found this document useful (0 votes)
138 views

Operating System Ch-1

The document provides an introduction to operating systems, including definitions, purposes, types and structures. It defines an operating system as fundamental software that manages hardware and allows other programs to run. Operating systems provide services like memory management, processor management, file management, and a user interface. They can be single-user or multi-user depending on the number of simultaneous users, and include batch, time-sharing, distributed and network varieties. The document outlines the basic functions and history of operating systems.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
138 views

Operating System Ch-1

The document provides an introduction to operating systems, including definitions, purposes, types and structures. It defines an operating system as fundamental software that manages hardware and allows other programs to run. Operating systems provide services like memory management, processor management, file management, and a user interface. They can be single-user or multi-user depending on the number of simultaneous users, and include batch, time-sharing, distributed and network varieties. The document outlines the basic functions and history of operating systems.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 28

Chapter One

Introduction to Operating System


Learning Objectives :-
• Definition of an Operating system
• Purpose of an Operating system
• Types of operating systems and operating system
structure
• Operating system services
• System call in operating System

1
What is an Operating System?
❖ is a fundamental piece of software that runs in kernel mode

(supervisor mode).

❖ A kernel is the core component of the OS, using inter-process


communication & system calls it act as a bridge b/w App’s and
data processing which is performed at H/w level

❖ It has complete access to all H/W & can execute any


instruction the machine is capable of executing

2
❖ Kernel is responsible for low level task management such as
Disk management, Task Management & Memory
Management

❖ Most computers have two modes of operation:-


✔ Kernel mode

✔ User mode

❖ User Mode: Any user program runs in user mode can access
RAM & H/W.

❖ program runs in user mode is not allowed to do modifications


to OS, allowing will create damage to OS.
3
❖ Lowest level user mode software’s
✔ User interface programs(provide interactivity between user and
apps)

✔ Shell

✔ GUI (graphical user interface)

❖ It allows user to start other programs such as web browser,


email reader music reader

❖ OS runs on H/W & provides base for all other S/W

4
Difference between OS & S/W

❖ If a user does not like particular software then he / she can free
to get a different one / write design own software. But can’t
write a own interrupt handler (part of OS)

❖ OS differs from user programs


❖ OS are huge, complex, long lived
❖ The source code of Linux / windows or order of 5 million lines
of codes (1000 volumes) – additional things added 10 or 20
times to the total

❖ OS functions basically two unrelated functions


5
Purpose Operating system

• Some basic function of operating system are:

❖ Memory Management
❖ Processor Management
❖ File management
❖ Device Management
❖ Security Management
❖ User interfacing
❖ Coordination of communication
❖ Error detecting aids
6
Memory management refers to management of Primary Memory
or Main Memory.

✔ Allocating and de allocating memory to processes


✔ Managing multiple processes within memory
✔ keep track of which parts of memory are used by which
processes.

✔ Manage the sharing of memory between processes.


✔ Determining which processes to load when memory becomes
available.

7
Processor Management

✔ Keeps tracks of processor and status of process.

✔ Allocates the processor (CPU) to a process.

✔ De-allocates processor when a process is no longer required.


Device Management

✔ Keeps tracks of all devices.

✔ Decides which process gets the device when and for how much time.

✔ Allocates the device in the most efficient way.

✔ De-allocates devices.

8
File Management

▪ Keeps track of information, location, uses, status etc.


▪ Decides who gets the resources.
▪ Allocates the resources
▪ De-allocates the resources.
▪ responsible for archiving and backups.
User interface: Each operating system has a user interface a
program that accepts requests from users (processes) and
interprets them for the rest of the operating system.

9
▪ Communication: Processes may exchange information, on the
same computer or between computers over a network.

▪ Communications may be via shared memory or through


message passing (packets moved by the OS).

▪ Operating system also enables interpose communications.


Security -- By means of password and similar other techniques,
it prevents unauthorized access to programs and data.

Error detecting aids -- Production of dumps, traces, error


messages, and other debugging and error detecting aids.
10
History of Operating system
1. First Generation (1940–55) Vacuum Tubes
2. Second Generation (1955–65) Transistors and
Batch Systems
3. Third Generation (1965–1980) ICs and
Multiprogramming
4. Fourth Generation (1980–Present) Personal
Computers, Tablets, Phones
5. Five Generation (1991-peresent ) Mobile
Computers

11
Types of operating systems

❖ Based on number of user Operating System can be classified into Single


user and multi user Operating system .
A single-user operating
✔ It is a system in which only one user can access the computer system at
a time.
✔ It provides the facilities to be used on one computer by only one user.
✔ Single keyboard and single monitor are used for the purpose of
interaction
✔ A single task is performed by one user at a time. Example- The Palm OS
for Palm handheld computers.
✔ Single user, multi-task: Several programs are run at the same time by a
single user. For example- Microsoft Windows.
✔ It has Simple attribute .
Example of Single OS : Windows 95, Windows NT Workstation and
Windows 2000 professional. 12
Con…

❖ A multi -user operating


✔ It allows more than one user to access a computer system at one
time.
✔ A multi-user operating system has been designed for more than
one user to access the computer at one time.
✔ Time sharing systems: These systems are multi-user systems in
which CPU time is divided among the users. The division is made
on the basis of a schedule.
✔ Most batch processing systems for the mainframe computers can
also be considered as multi user.
✔ It has complex attribute .
Example :Unix, Linux and mainframes such as the IBM AS400,
Ubuntu ,macOS , All linux based OS, Unix and Windows 10
13
Con…

Based on access and Activity operating system can be classified:-

1. Batch Operating System


2. Time-sharing Operating Systems
3. Distributed Operating System
4. Network Operating System
5. Real-Time Operating System
• Batch Operating System : The users of a batch operating system do
not interact with the computer directly.
⮚ Each user prepares his job on an off-line device like punch cards and
submits it to the computer operator .
⮚ To speed up processing, jobs with similar needs are batched together
and run as a group. 14
Con…

• The system put all of the jobs in a queue on the basis of first come

first serve and then executes the jobs one by one. The users collect

their respective output when all the jobs get executed.

• Disadvantages of Batch Operating system


• 1. Starvation

• 2. Not Interactive

15
Time-sharing Operating Systems

⮚ Time-sharing is a technique which enables many people,


located at various terminals, to use a particular computer
system at the same time.
⮚ Time-sharing or multitasking is a logical extension of
multiprogramming.
⮚ Processor's time which is shared among multiple users
simultaneously is termed as time sharing .
Advantage
disadvantage
▪ To Provides quick response ▪ Problem of reliability
▪ To Avoids duplication of ▪ Problem of data communication
software ▪ Question of security and integrity of user
▪ To Reduces CPU idle time programs and data

16
Distributed Operating System

▪ It use multiple central processor to serve multiple real time


application and multiple user.
▪ Data processing are distributed among the processors
accordingly to which one can perform each most efficiently.
▪ The processor communication with one another through
various communication line (such as high speed buses or
telephone lines ).
▪ Speedup the exchange of data with one another via electronic
mail.
▪ Reduction of the load on the host computer.
▪ Reduction of delays in data processing.

17
Network Operating System

▪ It runs on a server and provides the server capability to


manage data, users , groups , security , application and
other networking function .
▪ The primary purpose of Network operating system is to
allow share file and printer access among multiple
computer in a network , typically a local area network .
▪ Centralized server are highly stable .
▪ Remote access to server is possible from different
location and type of system
▪ Example of Network Operating system include Microsoft
window server 2003/2008 /2012, Unix Linux , Mac OS X
etc.
18
Con…

The advantages of network operating systems are following.


• Centralized servers are highly stable.
• Security is server managed.
• Upgrades to new technologies and hardware can be easily
integrated into the system.
• Remote access to servers is possible from different locations and
types of systems.
The disadvantages of network operating systems are following.
• High cost of buying and running a server.
• Dependency on a central location for most operations.
• Regular maintenance and updates are required.

19
Real-Time Operating System

▪ It defined as a data processing system in which the time


interval required to process and respond to input .
▪ The time taken by the system to respond to an input and
display of required updated information is termed as the
response time.
▪ A real-time operating system must have well-defined a fixed
time constraints, otherwise the system will fail.
▪ There are two types of real-time operating systems
Hard real-time systems: It guarantee that critical task
complete on time .In hard real time system, secondary
storage is limited or missing and the data is stored in ROM.
Soft real-time systems : soft real time system are less
restrictive . A critical real-time task gets priority over other
tasks and retains the priority until it completes.
20
Operating system services
❖ An Operating System provides services to both the users and to
the programs.
❖ Operating system has the following system services.
Program execution – system capability to load a program into memory and
to run it.
I/O operations – since user programs cannot execute I/O operations
directly, the operating system must provide some means to perform I/O.
File-system manipulation – program capability to read, write, create, and
delete files.
Communications – exchange of information between processes executing
either on the same computer or on different systems tied together by a
network.
Error detection – ensure correct computing by detecting errors in the CPU
and memory hardware, in I/O devices, or in user programs.

21
Con…
Additional functions exist not for helping the user, but rather for
ensuring efficient system operations.
▪ Resource allocation – allocating resources to multiple users or
multiple jobs running at the same time.
▪ Accounting – keep track of and record which users use how
much and what kinds of computer resources for account billing
or for accumulating usage statistics.
▪ Protection – ensuring that all access to system resources is
controlled. Protection refers to mechanism or a way to control
the access of programs, processes, or users to the resources
defined by computer systems. The ff major activities of
protection :-
✔ OS ensures that all access to system resources is controlled.
✔ OS ensures that external I/O devices are protected from invalid access
attempts.
✔ OS provides authentication feature for each user by means of a password.
22
System Call in Operating System
• System calls provide the interface between a running program
and the operating system.
• System call is the programmatic way in which a computer
program requests a service from the kernel of the operating
system it is executed on.
• A computer program makes a system call when it makes a request
to the operating system’s kernel.
• System call provides the services of the operating system to the
user programs via Application Program Interface(API).
▪ Generally available as assembly-language instructions.
▪ Languages defined to replace assembly language for systems
▪ Programming allow system calls to be made directly (e.g., C, C+
+)
▪ All programs needing resources must use system calls. 23
Con…
• Three general methods are used to pass parameters between a running
program and the operating system.
▪ Pass parameters in registers.
▪ Store the parameters in a table in memory, and the table address is
passed as a parameter in a register.
▪ Push (store) the parameters onto the stack by the program, and pop
off the stack by operating system.

24
Con…
• Types of system calls
▪ Process control
▪ File management
▪ Device management
▪ Information maintenance
▪ Communications
• Process control:-A running program needs to be able to stop
execution either normally or abnormally.
• File Management:- Some common system calls are create, delete,
read, write, reposition, or close. Also, there is a need to determine
the file attributes – get and set file attribute.
• Information Management:- Some system calls exist purely for
transferring information between the user program and the
operating system. An example of this is time, or date.
25
Con…
• Device Management:- Process usually require several resources to
execute, if these resources are available, they will be granted and
control returned to the user process. These resources are also
thought of as devices. Some are physical, such as a video card, and
others are abstract, such as a file.
• Communication:- There are two models of inter process
communication, the message-passing model and the shared
memory model.
✔ Message-passing uses a common mailbox to pass messages
between processes.
✔ Shared memory use certain system calls to create and gain access
to create and gain access to regions of memory owned by other
processes. The two processes exchange information by reading and
writing in the shared data.
26
Con…
Examples of Windows and Unix System Calls –
Windows Unix
CreateProcess() fork()
Process Control ExitProcess() exit()
WaitForSingleObject() wait()
CreateFile() open()
ReadFile() read()
File Manipulation
WriteFile() write()
CloseHandle() close()
SetConsoleMode() ioctl()
Device Manipulation ReadConsole() read()
WriteConsole() write()
GetCurrentProcessID() getpid()
Information Maintenance SetTimer() alarm()
Sleep() sleep()
CreatePipe() pipe()
Communication CreateFileMapping() shmget()
MapViewOfFile() mmap()
27
End of Chapter 1
Operating System

28

You might also like