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

OS Unit1 Intoduction

The document provides an overview of operating systems (OS), detailing their functions, types, and components. It covers process management, memory management, file management, and network management, along with various OS types such as batch, multiprogramming, time-sharing, and distributed systems. Additionally, it discusses real-time operating systems and their applications, emphasizing the importance of resource allocation and management in computing.

Uploaded by

shreyassupe346
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

OS Unit1 Intoduction

The document provides an overview of operating systems (OS), detailing their functions, types, and components. It covers process management, memory management, file management, and network management, along with various OS types such as batch, multiprogramming, time-sharing, and distributed systems. Additionally, it discusses real-time operating systems and their applications, emphasizing the importance of resource allocation and management in computing.

Uploaded by

shreyassupe346
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 89

OPERATING SYSTEM

INTRODUCTION

Reference Books

Operating System Concept, Peter Baer Galvin,Fifth Edition

Operation System Concept. Tanenbaum, Pearson Education.

Operating System Concepts and design, Milan Milonkovic, II


Edition, McGraw Hill
Objectives

➢ Introduction – What is OS? Different types of OS

➢ Process Management- Process concept , Process scheduling & CPU Scheduling

➢ Process Synchronization & Deadlock

➢ Memory Management(RAM)

➢ File management – Secondary storage management

➢ Disk Management system

➢ Protection and Security

➢ https://www.youtube.com/watch?v=LuDKfYv9VeI
Software

Software is a set of instructions or programs instructing a computer to do specific tasks

System Software Application Software

Controls and coordinates use of hardware An application can be self-contained or a


among various applications and users group of programs that performs a specific
function directly for an end user.
(Hardwares: CPU, Memory, I/O devices….)
What is OS

➢ An Operating system (OS) is a program that manages the computer hardware.

➢ It also provide a basis for application programs and acts as an intermediate between computer user and
computer hardware
Basic structure of Computer

Functions Of OS
It is an interface between User & Hardware
Allocation of resources
Management of memory,security,etc……
Basic structure of Computer…..cont..

Computer system can be divided into four components:

➢ Hardware – provides basic computing resources


➢ CPU, memory, I/O devices
➢ Operating system
➢ Controls and coordinates use of hardware among various applications and users
➢ Application programs – define the ways in which the system resources are used to solve the
computing problems of the users
➢ Word processors, compilers, web browsers, database systems, video games
➢ Users
➢ People, machines, other computers
Types of OS

➢ Batch Operating System

➢ Multi Programming OS

➢ Time sharing system

➢ Multi Processor system

➢ Distributed system

➢ Real time OS
Lets check ….?

Which is not application software?

o Windows NT

o Page maker

o Chrome Web browser

o Photoshop
Another one

Scenario:

A user opens MS-Word and start to type a letter, mean while power goes off.

Whether the file is available to user when he/she on the PC next time

oYES

oNO
Lets check ….?

Which is not application software?

o Windows NT

o Page maker

o Chrome Web browser

o Photoshop
Another one

Which of the following memory is non volatile?

o RAM

o ROM

o None of the above

o All the above


Batch OS

➢ The users of batch operating system do not interact with the computer directly. Each user prepares his job
(consisted of program, data, and some control information) 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. Thus, the
programmers left their programs with the operator. The operator then sorts programs into batches with
similar requirements.
Batch OS….cotn

Memory layout of a simple batch system

➢ Advantages:
➢ Increased performances as a new get started as soon as the previous job finished without any
manual intervention.
➢ Disadvantage
➢ Lack of interaction between the user and job.
➢ CPU is often idle, because the speeds of the mechanical I/O devices are slower than CPU.
Multi Programming

➢ When two or more programs are in memory at the same time, sharing the processor is referred
to the multiprogramming operating system.

➢ A computer running excel and Firefox browser simultaneously is


an example of multiprogramming.
Multi Programming system

In this types the operating systems picks


up and begins to execute one of the jobs
from the memory. If any of this job needs
an I/O operation then the operating system
switches to another job (CPU and OS are
always busy).

If several jobs are ready to run at the same


time, then the OS chooses the job to run
through the process of CPU Scheduling

Job1 Job2 Job3 Job4 Job5


Multi Programming OS

➢ Several programs in memory at the same time require some form of memory management and
resource scheduling.

CPU
Multi Programming system

Advantages:

• CPU is active all the time and never become idle.

• The system looks to be fast as all the tasks runs in parallel.

• Multiprogramming systems supports multiple users.

• Resources are used efficiently.

Disadvantages:

• It becomes difficult to program a system because of complicated schedule handling.

• Due to high load of tasks, long time jobs have to wait for a long time.
Time sharing system
➢ 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.
➢ Multiple jobs are executed by the CPU switching
between them, but the switches occur so
frequently that the users may interact with each
program while it is running.
Time sharing system……

The operating system uses CPU scheduling and multiprogramming


to provide each user with a small portion of a time.

Time slice is defined by the OS, for sharing CPU time between
processes. CPU is taken away from a running process when the
allotted time slice expires.

The main difference between Multiprogramming and Time-Sharing


Systems is that in case of Multiprogramming, the objective is to
maximize processor(CPU) use, whereas in Time-Sharing Systems,
the objective is to minimize response time.

Note: response time is a time taken to OS to assign CPU to


process(job) when it request for it.
Advantages of Timesharing operating systems are as follows −

➢Provides the advantage of quick response.

➢Avoids duplication of software.

➢Reduces CPU idle time.

Disadvantages of Time-sharing operating systems are as follows −

➢Problem of reliability.

➢Question of security and integrity of user programs and data.


Multiprocessor System
➢ Multiprocessor Operating System refers to the use of two
or more central processing units (CPUs) within a single
computer system.

➢ These multiple CPUs are in a close communication


sharing the computer bus, memory and other peripheral
(I/O) devices.

➢ Alternatively known as an address bus, data bus, or local


bus, a bus is a connection between components or
devices connected to a computer.

➢ For example, a bus carries data between a CPU and the


system memory via the motherboard.

➢ These types of systems are used when very high speed is


required to process a large volume of data like satellite
control, weather forecasting etc.
Advantages of Multiprocessor System

Increased throughput : By increasing the number of processors we get more work done in
less time.

Economy of scale: Multi processor system can save more money than single processor
system, because they can share peripherals(I/O), mass storage & power supply.

Increased reliability: If functions distributed properly among several processors, then the
failure of one processor will not halt the system only slow it down. This ability to continue
providing services or surviving hardware is called graceful degradation.
Types of multiprocessor system

1) Symmetric multiprocessing system (SMP)

Systems that treat all CPUs equally are called symmetric multiprocessing (SMP) systems.

Each processor runs an identical copy of the OS, and these copies communicate with each other
as needed.
2) Asymmetric multiprocessing system

A master processor(CPU) controls the system, the other processor either look to the
master for instruction or have predefined tasks. This theme defines a master slave relationship.
Disadvantages of Multiprocessor Systems

➢ Complicated Operating System Required


➢ In multiprocessor system peripherals, memory etc are shared.
➢ So, it is much more complicated to schedule resources to processes.
➢ Hence, a more complex and complicated operating system is required in
multiprocessor systems.

➢ Large Main Memory Required


➢ All the processors in the multiprocessor system share the memory. So a much
larger pool of memory is required as compared to single processor systems.
Distributed system
➢ Distributed Operating System is a model where
distributed applications are running on multiple
computers linked by communications(network).
➢ A distributed application is a program that runs on
more than one computer and communicates
through a network.
➢ The distributed system run on a Distributed
Operating System to provide an illusion to the end
user such that the entire network is working like a
single system.
➢ Distributed system perform load balancing by
distributing the computational tasks(load)
between computers.
Distributed system …..

➢ These systems are referred as loosely coupled systems where each processor has its own
local memory and processors communicate with one another through various communication
lines.

➢ By loosely coupled systems, means that such computers possess no hardware connections at
the CPU - memory bus level(no memory sharing).

➢ The Distributed OS involves a collection of autonomous computer systems, capable of


communicating and cooperating with each other through a LAN / WAN.
Advantages

➢ With resource sharing facility, a user at one site may be able to use the resources available at
another.

➢ Reliable - Failure of one site in a distributed system doesn’t affect the others, the remaining
sites can potentially continue operating.

➢ Reduction of the load on the host computer.

➢ Reduction of delays in data processing.


Distributed Operating System is a model where distributed applications
are running on multiple computers linked by communications.

A distributed operating system is an extension of the network operating


system that supports higher levels of communication and integration of
the machines on the network.
This system looks to its users like an ordinary centralized operating
system but runs on multiple, independent central processing units
(CPUs).
These systems are referred as loosely coupled systems where each
processor has its own local memory and processors communicate with
one another through various communication lines, such as high speed
buses or telephone lines.

By loosely coupled systems, we mean that such computers possess no


hardware connections at the CPU – memory bus level, but are connected
by external interfaces that run under the control of software.
Examples of distributed systems / applications of distributed computing :

• Intranets, Internet, WWW, email.

• Telecommunication networks: Telephone networks and Cellular networks

• Network of branch office computers -Information system to handle automatic processing of


orders

• Real-time process control: Aircraft control systems

• Electronic banking

• Airline reservation systems

• Sensor networks
Distributed operation system (DOS): An operating system that runs over
multiple devices usually connected by a network medium.
Real-time operating system (RTOS): An operating system that can respond to
and schedule events in a precious time; i.e. time response is highly predictable.
Real Time System
➢ The real-time operating system used for a real-time application
➢ Those applications where data processing should be done in the fixed and small quantum of time.
➢ Real time system means that the system is subjected to real time, i.e., response should be
guaranteed within a specified timing constraint or system should meet the specified deadline.
➢ Ex: Controlling traffic signal, home appliance are application of Real Time operating system
➢ In real time operating system there is a little swapping of programs between primary and
secondary memory.
➢ Most of the time, processes remain in primary memory in order to provide quick response,
therefore, memory management in real time system is less demanding compared to other
systems.
Types of Real Time operating systems.

➢ Hard real-time systems

➢ A hard real-time system has time-critical deadlines that must be met, otherwise system
failure can occur.

➢ In hard real-time systems secondary storage is limited or missing with data stored in ROM.

➢ Examples: – air traffic control – vehicle subsystems control – Nuclear power plant control
➢ Soft real-time systems

➢ Soft real time by default as “Not Hard Real Time” ,Missing some deadlines by some amount
under some circumstances may be acceptable rather than failure.

➢ Soft real time means systems which have reduced constraints on “lateness” but still must
operate very quickly and repeatable.

➢ Examples: – multimedia s, telecom (cellular) networks, – web sites and services – computer
games.
Operating System Components
• An operating system is a large and complex system that can only be
created by partitioning into small pieces.

• These pieces should be a well-defined portion of the system, which


carefully defined inputs, outputs, and functions.

• Although Mac, Unix, Linux, Windows, and other OS do not have the
same structure, most of the operating systems share similar OS
system components like File, Process, Memory, I/O device
management.
Process Management
• The process management component is a procedure for managing the many
processes that are running simultaneously on the operating system.

• Every software application program has one or more processes associated with them
when they are running.

• For example, when you use a browser like Google Chrome, there is a process running
for that browser program. The OS also has many processes running, which
performing various functions.

• All these processes should be managed by process management, which keeps


processes for running efficiently. It also uses memory allocated to them and shutting
them down when needed.
Functions of process management in OS

o Process creation and deletion.

o Suspension and resumption.

o Synchronization process

o Communication process
Process Synchronization means sharing system resources by processes in such a way
that, Concurrent access to shared data is handled thereby minimizing the chance of
inconsistent data.
Main Memory management
• Main Memory is a large array of storage or bytes, which has an address.

• The memory management process is conducted by using a sequence of reads or


writes of specific memory addresses.

• In order to execute a program , it should be mapped to absolute addresses and


loaded inside the Memory.

• However, it is mainly based on the hardware design of the system. It is costly and
hence has a lower storage capacity.
Functions of Memory management in OS

• It helps you to keep track of primary memory.

• Determine what part of it are in use by whom, what part is not in use.

• In a multiprogramming system, the OS takes a decision about which process will get
Memory and how much.

• Allocates the memory when a process requests

• It also de-allocates the Memory when a process no longer requires or has been
terminated.
Secondary-Storage Management

• The most important task of a computer system is to execute programs. These


programs, along with the data, helps you to access, which is in the main memory
during execution.

• This Memory of the computer is very small to store all data and programs
permanently. The computer system offers secondary storage to back up the main
Memory. Today modern computers use hard drives/SSD as the primary storage of
both programs and data.

• However, the secondary storage management also works with storage devices, like
a USB flash drive, and CD/DVD drives.
Functions of Secondary storage management in OS:

Here, are major functions of secondary storage management in OS:

• Storage allocation

• Free space management

• Disk scheduling
File Management

• A file is a set of related information which should define by its creator. It


commonly represents programs, both source and object forms, and data. Data
files can be numeric, alphabetic, or alphanumeric.

Function of file management in OS:

The operating system has the following important given activities in connections with file
management:

• File and directory creation and deletion.


• For manipulating files and directories.
• Mapping files onto secondary storage.
• Backup files on stable storage media.
Functions of I/O management in OS
• It offers buffer caching system.
• It provides general device driver code.
• It provides drivers for particular hardware devices.
• I/O helps you to knows the individualities of a specific device.
Network Management

• Network management is the process of administering and managing


computer networks.

• It includes performance management, fault analysis, provisioning of


networks, and maintaining the quality of service.

• A distributed system is a collection of computers/processors that never


share their own memory or a clock.

• In this type of system, all the processors have their local Memory, and the
processors communicate with each other using different communication
lines, like fiber optics or telephone lines.
Functions of Network management:

• Distributed systems help you to various computing resources in size and function.
They may involve microprocessors, minicomputers, and many general-purpose
computer systems.

• A distributed system also offers the user access to the various resources the network
shares.

• It helps to access shared resources that help computation to speed-up or offers data
availability and reliability.
Protection
• Considering a computer system having multiple users and concurrent execution of
multiple processes, the various processes must be protected from each other's
activities.

• Protection refers to a mechanism or a way to control the access of programs,


processes, or users to the resources defined by a computer system.

Following are the major activities of an operating system with respect to protection:

• The OS ensures that all access to system resources is controlled.


• The OS ensures that external I/O devices are protected from invalid access attempts.
• The OS provides authentication features for each user by means of passwords.
• When Computers are interconnected via communication links, we have computer
communication networks such as LANs , WANs and MANs and Distributed System as
well.
• The network management component has to provide sharing of resources, network
configuration support and etc….
• Operating system usually generalizes network access with the help of network
interface device driver.
Command Interpreter System

• A command interpreter is an interface of the operating system with the user.

• The user gives commands which are executed by operating system (usually by
turning them into system calls).

• The main function of a command interpreter is to get and execute the next user
specified command.
OS services
OS services

Following are few common services provided by operating systems.

• Program execution

• I/O operations

• File System manipulation

• Communication

• Error Detection

• Resource Allocation

• Protection
Program execution

Following are the major activities of an operating system with respect to program
management.
• Loads a program into memory.
• Executes the program.
• Handles program's execution.
• Provides a mechanism for process synchronization.
• Provides a mechanism for process communication.
• Provides a mechanism for deadlock handling.
I/O Operation
• I/O means any file or any specific I/O device.
• Program may require any I/O device while running. So operating
system must provide the required I/O devices.

File system manipulation


• creating a file, deleting a file
• opening a file, closing a file
• Allow file manipulation such as Reading a file, Writing a file,
Appending a file etc..
Communication
• Operating system manages communications between processes
either on the same computer system or between different
computer system on a computer network(distributed system).

Following are the major activities of an operating system with respect


to communication.
• Two processes often require data to be transferred between
them.
• Communication may be implemented by two methods either by
Shared Memory or by Message Passing.
Error handling
• Accomplish the task of error detection and recovery if any.
• Ex: Paper jam or out of paper in a printer.

• Keep track status of CPU, Memory, I/O devices, Storage devices, File system etc.

• Abort execution in case of Power fluctuations etc.

• Report and/or deliver error message in case of arithmetic over flow, divide by
zero errors etc.
Resource Management

• If there is more than one user or jobs running at the same time, then resources
must be allocated to each of them.

• Operating system manages different types of resources (i.e. main memory, CPU
cycles and file storage) require special allocation code.

• There are some resources which require only general request and release code.
• For allocating CPU, CPU scheduling algorithms are used for better utilization of
CPU.
Protection

Protection refers to mechanism or a way to control the access of programs,


processes, or users to the resources defined by computer systems.

Activities of an operating system with respect to 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.
A virtual machine (VM)

• A virtual machine (VM) is a virtual environment which functions as a virtual


computer system with its own CPU, memory, network interface, and storage,
created on a physical hardware system.

• VMs are isolated from the rest of the system, and multiple VMs can exist on
a single piece of hardware, like a server. That means, it as a simulated image
of application software and operating system which is executed on a host
computer or a server.

• It has its own operating system and software that will facilitate the
resources to virtual computers.
Characteristics of virtual machines

• Multiple OS systems use the same hardware and partition resources


between virtual computers.
• Separate Security and configuration identity.
• Ability to move the virtual computers between the physical host computers
as holistically integrated files.
Benefits of virtual machines

• The multiple Operating system environments exist simultaneously on the same


machine, which is isolated from each other.

• Virtual machine offers an instruction set architecture which differs from real
computer.

• Using virtual machines, there is easy maintenance, application provisioning,


availability and convenient recovery.
System calls
System calls

Kernel Mode
When CPU is in kernel mode, the code being
executed can access any memory address and any
hardware resource.

Kernel mode is a very privileged and powerful


mode.

If a program crashes in kernel mode, the entire


system will be halted
System calls cont........

User Mode
• When CPU is in user mode, the programs don’t have direct access to memory and
hardware resources.

• In user mode, if any program crashes, only that particular program is halted.

• That means the system will be in a safe state even if a program in user mode
crashes.

• Hence, most programs in an OS run in user mode.


When the system call is made?
• When a program in user mode requires access to RAM or a hardware resource, it
must ask the kernel to provide access to that resource.
This is done via something called a system call.

Definition: System Calls provide the Interface between a process and the
Operating System.

• These calls are generally available as Assembly language instruction.


Categories of System Calls System calls can be grouped into five
major categories as follows.

• Process control

• File management

• Device management

• Information Maintenance

• Communication.
Process control
Some system calls under process control are:
• end, abort : A running program halt its execution either normally(end) or abnormally(abort)

• load, execute: A process or job executing may want to load and execute another program.
• create process, terminate process
• if calling process and called process both continue execution concurrently, then new Create process
system call is made.
• A running process is terminated if any error occur or is no longer needed.

• get process attribute, set process attribute


• Controlling the execution of process require the ability to determine or set the attribute of a process.

• wait for time


• wait event, signal event
• allocate and free memory
File management

Some system calls under file management are:

• create file, delete file – require file name and attribute of a file

• open , close – Once file is created open() is used to access it

• read, write, reposition.

• get file attributes, set file attributes


Device management

• The various resouuces controlled by OS can be thought of as devices.

• Some of these are physical devices like disk drive, I/O

• Abstract or virtual devices like files

• request device, release device

• read, write, reposition

• get devise attributes , set devise attribute


Information Maintenance

• Many system calls exist for transferring the information between the user
program and the OS.

• get time or date, set time or date

• get system data, set system data


• Number of current users, OS version, the amount of free memory or dis space etc….

• get process,file,or devise attribute

• set process,file,or devise attribute


Communication

Two models of communication


• Message passing
• shared memory
• Message passing model allows multiple processes
to read and write data to the message queue
without being connected to each
other. Messages are stored on the queue until
their recipient retrieves them. Message queues
are quite useful for interprocess communication
and are used by most operating systems
Communication cont…..

• In message passing before communication can take place connection should be


established.

• The get hostid and processid system call help to open the connection between the
processes, which are either on same system or on different system.
• open connection and close connection

• The recipient process must give the permission for communication with an accept
connection call

• Exchange of messages are done by read message and write message system calls

• In shared memory model, processes use map memory system call to gain access to
region of memory owned by other process.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy