Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Module 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 39

Module 1

Introduction to Operating
System

CO1: Understand the role of an operating system, its function and issues.

Ref.:- Principal of Operating system by Naresh Chauhan


1
What is Operating system?

• Operating System (OS) is system software that manages


computer hardware, software resources and provide
common services for computer programs.
• Basically OS is also one of the system software. E.g.
Windows, Linux, Mac, iOS .
• Operating system 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.

2
• A more common definition is that the operating system is
the one program running at all times on the computer
(usually called the kernel), with all else being application
programs.

• An operating system is concerned with the allocation of


resources and services, such as memory, processors,
devices, and information. The operating system
correspondingly includes programs to manage these
resources, such as a traffic controller, a scheduler, a
memory management module, I/O programs, and a file
system.

3
Objective of OS:
The objectives of the operating system are −

▪ To make the computer system convenient to use in an efficient manner.

▪ To hide the details of the hardware resources from the users.

▪ To provide users a convenient interface to use the computer system.

▪ To act as an intermediary between the hardware and its users, making it easier for the users to
access and use other resources.

▪ To manage the resources of a computer system.

▪ To keep track of who is using which resource, granting resource requests, and mediating
conflicting requests from different programs and users.

▪ To provide efficient and fair sharing of resources among users and programs.

4
Function of operating system:
Operating system performs following basic functions:

1. Booting: An operating system manages the startup of a device.

2. Loading and execution: An operating system starts and executes a program.

3. Drive/disk management: An operating system manages computer drives and divides disks.

4. Device control: An operating system enables you to allow or block access to devices.

5. Convenience: An OS makes a computer more convenient to use.

6. Efficiency: An OS allows the computer system resources to be used in efficient manner.

7. Ability to Evolve: An OS should be constructed in such a way as to permit the effective


development, testing, and introduction of new system functions at the same time without
interfering with service.

8. Throughput: An OS should be constructed so that It can give maximum throughput(Number


of tasks per unit time).
5
Major Functionalities of Operating System:

✔ Resource Management: When parallel accessing happens in the OS means when


multiple users are accessing the system the OS works as Resource Manager, Its
responsibility is to provide hardware to the user. It decreases the load in the
system. [Resources such as central processing unit (CPU), computer
memory, file storage, input/output (I/O) devices, and network
connections]
✔ Process Management: It includes various tasks like scheduling, termination of
the process. OS manages various tasks at a time. Here CPU Scheduling happens
means all the tasks would be done by the many algorithms that use for
scheduling.
✔ Storage Management: The file system mechanism used for the management of
the storage. Cluster File System(CFS), Common Internet File System(CIFS),
Network File System(NFS), etc. are some file systems. All the data stores in
various tracks of Hard disks that all managed by the storage manager.
6
✔ Memory Management: Refers to the management of primary
memory. The operating system has to keep track, how much memory
has been used and by whom. It has to decide which process needs
memory space and how much. OS also has to allocate and deallocate
the memory space.

✔ Security/Privacy Management: Privacy is also provided by the


Operating system by means of passwords so that unauthorized
applications can’t access programs or data. For example, Windows
uses Kerberos authentication to prevent unauthorized access to data.
Hence an Operating System performs all the basic tasks like managing
files, processes, and memory. Thus operating system acts as the
manager of all the resources, i.e. resource manager. Thus, the operating
system becomes an interface between user and machine.

7
Types of operating system are:

• Batch OS
• Multi programming OS
• Multi tasking or Time sharing OS
• Distributed OS
• Real Time OS (RTOS)
• Network OS

8
Batch Operating System

9
• operating system does not interact with the computer directly.
• There is an operator which takes similar jobs having the same requirement
and group them into batches.
• It is the responsibility of the operator to sort jobs with similar needs.
• Multiple users can share the batch systems.
• The idle time for the batch system is very less.
• It is easy to manage large work repeatedly in batch systems.

Disadvantages of Batch Operating System:


• The computer operators should be well known with batch systems Batch
systems are hard to debug
• It is sometimes costly.
• The other jobs will have to wait for an unknown time if any job fails.

10
Multi programming OS

11
Multiprogramming OS – The main memory consists of jobs waiting for
CPU time. The OS selects one of the processes and assigns it to the CPU.
Whenever the executing process needs to wait for any other operation
(like I/O), the OS selects another process from the job queue and assigns it
to the CPU. This way, the CPU is never kept idle and the user gets the
flavor of getting multiple tasks done at once.

Examples of time-sharing operating systems include Multics and Unix.

12
Multi tasking OS/Time sharing OS:
• The time-sharing operating system, also known as a multitasking OS, works
by allocating time to a particular task and switching between tasks
frequently. Unlike the batch system, the time-sharing system allows users to
complete their work in the system simultaneously. It allows many users to
be distributed across various terminals to minimize response time.

13
Advantages of time-sharing operating systems include:
• There's a quick response during task performance.
• It minimizes the idle time of the processor.
• All tasks get an equal chance of being accomplished.
Disadvantages of this system are:
• The user's data security might be a problem.
• System failure can lead to widespread failures.
• Problems in data communication may arise.
• The integrity of user programs is not assured.

14
Distributed Operating System

Reference video:
https://www.youtube.com/watch?v=NYBKXzl5bWU 15
• Various autonomous interconnected computers communicate with
each other using a shared communication network.
• Independent systems possess their own memory unit and CPU.
• These system’s processors differ in size and function. The major
benefit of working with these types of the operating system is that it
is always possible that one user can access the files or software
which are not actually present on his system but some other system
connected within this network i.e., remote access is enabled within
the devices connected in that network.

• Examples of Distributed Operating System are- LOCUS, etc.

16
Advantages of Distributed Operating System:
• Failure of one will not affect the other network communication, as all systems are
independent from each other
• Since resources are being shared, computation is highly fast and durable.
• Load on host computer reduces.
• These systems are easily scalable as many systems can be easily added to the network
• Delay in data processing reduces

17
Disadvantages of Distributed Operating System:

• These types of systems are not readily available as they are very expensive.
Not only that the underlying software is highly complex

18
Real Time Operating System

• It’s OS specially designed to run application with very precise timing and high
degree of reliability
• These types of OS serve real-time systems. The time interval required to process
and respond to inputs is very small. This time interval is called response time.
• Real-time systems are used when there are time requirements that are very
strict like missile systems, air traffic control systems, robots, etc.

Two types of Real-Time Operating System which are as follows:


• Hard Real-Time System: These OS are meant for applications where time
constraints are very strict and even the shortest possible delay is not acceptable.
These systems are built for saving life like automatic parachutes or airbags which
are required to be readily available in case of any accident.
• Soft Real-Time Systems: These OSs are for applications where for
time-constraint is less strict.
19
Examples of operating system

20
Advantages of RTOS:
• Maximum Consumption: Maximum utilization of devices
and system, thus more output from all the resources
• Task Shifting: The time assigned for shifting tasks in these
systems are very less. For example, in older systems, it
takes about 10 microseconds in shifting one task to another,
and in the latest systems, it takes 3 microseconds.
• Focus on Application: Focus on running applications and
less importance to applications which are in the queue.
• Real-time operating system in the embedded
system: Since the size of programs are small, RTOS can
also be used in embedded systems like in transport and
others.
• Error Free: These types of systems are error-free.
• Memory Allocation: Memory allocation is best managed in
these types of systems.
21
Disadvantages of RTOS:
• Limited Tasks: Very few tasks run at the same time and their concentration
is very less on few applications to avoid errors.
• Use heavy system resources: Sometimes the system resources are not so
good and they are expensive as well.
• Complex Algorithms: The algorithms are very complex and difficult for the
designer to write on.
• Device driver and interrupt signals: It needs specific device drivers and
interrupts signals to respond earliest to interrupts.
• Thread Priority: It is not good to set thread priority as these systems are
very less prone to switching tasks.

22
Network Operating System

23
• These systems run on a server and provide the capability to manage data,
users, groups, security, applications, and other networking functions.
• These types of operating systems allow shared access of files, printers,
security, applications, and other networking functions over a small private
network.
• One more important aspect of Network Operating Systems is that all the
users are well aware of the underlying configuration, of all other users within
the network, their individual connections, etc.

Examples of Network Operating System are: Microsoft Windows


Server 2003, Microsoft Windows Server 2008, UNIX, Linux, Mac OS
X, Novell NetWare, and BSD, etc.
24
Advantages of Network Operating System:
• Highly stable centralized servers
• Security concerns are handled through servers
• New technologies and hardware up-gradation are easily integrated into the
system.
• Server access is possible remotely from different locations and types of
systems
Disadvantages of Network Operating System:
• Servers are costly
• User has to depend on a central location for most operations
• Maintenance and updates are required regularly

25
Evolution of Operating(self study)
System:http://lilly021.com/the-evolution-of-the-operating-syste
m/

26
System calls

• In computing, a 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 system call is a way for programs to interact with the operating system.
• 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).
• It provides an interface between a process and operating system to allow user-level
processes to request services of the operating system.
• System calls are the only entry points into the kernel system. All programs needing
resources must use system calls.

27
Services Provided by System Calls :
1.Process creation and management
2.Main memory management
3.File Access, Directory and File system management
4.Device handling(I/O)
5.Protection
6.Networking, etc.

Types of System Calls : There are 5 different


categories of system calls –
1. Process control: end, abort, create, terminate,
allocate and free memory.
2. File management: create, open, close, delete,
read file etc.
3. Device management
4. Information maintenance
5. Communication

28
Examples of Windows and Unix System CallsSystem
– calls Windows Unix
CreateProcess() fork()
Process
ExitProcess() exit()
Control
WaitForSingleObject() wait()
CreateFile() open()
File ReadFile() read()
Manipulation WriteFile() write()
CloseHandle() close()
SetConsoleMode() ioctl()
Device
ReadConsole() read()
Manipulation
WriteConsole() write()
GetCurrentProcessID() getpid()
Information
SetTimer() alarm()
Maintenance
Sleep() sleep()
CreatePipe() pipe()
Communicati
CreateFileMapping() shmget()
on
MapViewOfFile() mmap()
SetFileSecurity() chmod()
Protection InitlializeSecurityDescriptor() umask()
SetSecurityDescriptorGroup() chown()

29
Structure of operating system
❑ An operating system allows the user application programs to interact with the
system hardware. Since the operating system is such a complex structure, it
should be created with utmost care so it can be used and modified easily.

Various Structure / architecture of operating system are:


Simple structure
Monolithic structure
Layered structure
Microkernel

30
Simple Structure
• It is MS-DOS structure
• The interfaces and levels of functionality are not well
separated.
• All Application program has direct access to BIOS.
• Any harmful program or malicious program may crashes the
operating system.
Advantages of Simple structure:
• It delivers better application performance because of the
few interfaces between the application program and the
hardware.
• Easy for kernel developers to develop such an operating
system.

Disadvantages of Simple structure:


• The structure is very complicated as no clear boundaries 31
Monolithic Structure

32
Features of Monolithic System
The monolithic operating system provides the following features to the users, such as:
Simple structure: This type of operating system has a simple structure. All the components
needed for processing are embedded into the kernel.
Works for smaller tasks: It works better for performing smaller tasks as it can handle limited
resources.
Communication between components: All the components can directly communicate with
each other and also with the kernel.
Fast operating system: The code to make a monolithic kernel is very fast and robust.
Limitation:
• Adding and removing features from monolithic OS is very difficult. All the code needs to be
rewritten and recompiled to add or remove any feature.
• Debugging is difficult in case of failure.

33
Layered structure
Why Layering in Operating System?
• Layering provides a distinct advantage in an operating
system. All the layers can be defined separately and interact
with each other as required. Also, it is easier to create,
maintain and update the system if it is done in the form of
layers.
• Change in one layer specification does not affect the rest of
the layers.
• Each of the layers in the operating system can only interact
with the layers that are above and below it.
• The lowest layer handles the hardware and the uppermost
layer deals with the user applications.

34
Details about the six layers are:
Hardware
This layer interacts with the system hardware and coordinates with all the peripheral
devices used such as printer, mouse, keyboard, scanner etc. The hardware layer is the
lowest layer in the layered operating system architecture.

CPU Scheduling
This layer deals with scheduling the processes for the CPU. There are many scheduling
queues that are used to handle processes. When the processes enter the system, they
are put into the job queue. The processes that are ready to execute in the main
memory are kept in the ready queue.

35
Memory Management
Memory management deals with memory and the moving of processes from disk
to primary memory for execution and back again. This is handled by the third layer
of the operating system.
Process Management
This layer is responsible for managing the processes i.e assigning the processor to a
process at a time. This is known as process scheduling. The different algorithms
used for process scheduling are FCFS (first come first served), SJF (shortest job
first), priority scheduling, round-robin scheduling etc.
I/O Buffer
I/O devices are very important in the computer systems. They provide users with
the means of interacting with the system. This layer handles the buffers for the I/O
devices and makes sure that they work correctly.
36
User Programs
This is the highest layer in the layered operating system. This layer deals with the
many user programs and applications that run in an operating system such as
word processors, games, browsers etc.

37
Microkernel

38
Question:-Difference between Microkernel and monolithic operating system

39

You might also like