0% found this document useful (0 votes)
19 views67 pages

OS Chapter1

The document provides an overview of operating systems, detailing their evolution through different generations from vacuum tube-based systems to artificial intelligence-based systems. It outlines the objectives, types, and modes of operation of operating systems, as well as their structure, including monolithic and microkernel architectures. Additionally, it discusses the services provided by operating systems and their role as resource managers in computing environments.

Uploaded by

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

OS Chapter1

The document provides an overview of operating systems, detailing their evolution through different generations from vacuum tube-based systems to artificial intelligence-based systems. It outlines the objectives, types, and modes of operation of operating systems, as well as their structure, including monolithic and microkernel architectures. Additionally, it discusses the services provided by operating systems and their role as resource managers in computing environments.

Uploaded by

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

Chapter 1

Operating System Overview

1
Computer Generations with its
Technology

Generations Time-Period Technology Used


1st Generation 1940s – 1950s Vacuum Tube Based
2nd Generation 1950s – 1960s Transistor Based
3rd Generation 1960s – 1970s Integrated Circuit Based
4th Generation 1970s – Present Microprocessor Based
5th Generation Present – Future Artificial Intelligence Based...
Operating System
⚫An interface between applications(user) and
hardware
⚫A program that controls the execution of
application programs
⚫Purpose of OS is to provide an environment in
which a user can execute programs in
convenient and efficient manner

3
Operating System Objectives

⚫Convenience
⚫Makes the computer more convenient to use
⚫Efficiency
⚫Allows computer system resources to be used in an
efficient manner
⚫Ability to evolve
⚫Permit effective development, testing, and
introduction of new system functions without
interfering with service

4
Layers of Computer System

5
Operating
Systems and
their logos
Evolution of OS
Generation of Operating System
➔ The First Generation (1940 to early 1950s)
◆ We can only write a program for each task in absolute machine language.
◆ The programmer can perform and solve only simple mathematical
calculations and this calculation does not require an operating system.
➔ The Second Generation (1955 - 1965)
◆ General Motors has developed OS for the IBM computer
◆ based on a single stream batch processing system because it collects all
similar jobs in groups or batches and then submits the jobs to the
operating system using a punch card to complete all jobs in a machine
◆ At each completion of jobs (either normally or abnormally), control
transfer to the operating system that is cleaned after completing one job
and then continues to read and initiates the next job in a punch card. After
that, new machines were called mainframes, which were very big and used
by professional operators.
Generation of Operating System
➔ The Third Generation (1965 - 1980)
◆ a new operating system that could simultaneously perform multiple tasks in
a single computer program called multiprogramming
◆ multiprogramming plays a very important role in developing operating
systems that allow a CPU to be busy every time by performing different
tasks on a computer at the same time

➔ The Fourth Generation (1980 - Present Day) :


◆ Microsoft created the first window operating system in 1975
◆ MS-DOS in 1981, difficult for the person to understand its cryptic
commands
◆ In 1980s, the operating system was developed by Steve Jobs (co-
Types of Operating System

1. Batch Operating System


2. Time-Sharing Operating System
3. Embedded Operating System
4. Multiprogramming Operating System
5. Network Operating System
6. Distributed Operating System
7. Multiprocessing Operating System
8. Real-Time Operating System
Modes of operation
User mode and kernel mode

❑User Mode
⚫User program executes in user mode
⚫Certain instructions may not be executed
⚫System call executes in kernel mode

❑Kernel mode
⚫Monitor executes in system (kernel) mode
⚫Privileged instructions are executed
11
Evolution of an Operating System
⚫Hardware upgrades plus new types of
hardware
⚫New services
⚫Fixes

12
OS as Resource manager
⚫Responsible for managing resources (like Processor,
memory, I/O devices, etc.)
⚫Functions same way as ordinary computer software
⚫It is program that is executed
⚫Operating system relinquishes control of the
processor
⚫Main memory allocation by jointly OS and Memory
management hardware.
13
14
Kernel
⚫Core Portion of OS that is in main memory
⚫Contains most frequently used functions
⚫Also called the nucleus
⚫It is first layer of software loaded into memory when a
system boots or starts up
⚫It provides access to various common core services to
all other system and application programs
⚫Kernel acts as a bridge between applications and data
processing performed at hardware level using inter-
process communication and system calls.
15
Evolution of Operating Systems
⚫Serial Processing
⚫No operating system
⚫Machines run from a console with display
lights, toggle switches, input device, and
printer
⚫Schedule time
⚫Setup included loading the compiler, source
program, saving compiled program, and
loading and linking
16
Evolution of Operating Systems
⚫ Simple Batch Systems
⚫Monitors
⚫ Software that controls the sequence of events
⚫ Batch jobs together
⚫ Program branches back to monitor when finished

17
Multiprogramming Techniques

⚫Special Techniques Used in OS


⚫Batch System and Time Sharing System
both systems used the Technique
⚫Reducing the waiting period (CPU idle
time)
❑Hardware Features
⚫Interrupts
⚫Early computer models did not have this 18
I/O Devices Slow

19
Uniprogramming
⚫Processor must wait for I/O
instruction to complete before
proceeding

20
Multiprogramming
⚫When one job needs to wait for
I/O, the processor can switch to
the other job

21
Multiprogramming

22
Batch System Vs Time sharing system
1. User did not directly 1. It provides direct
interact with communication
computer system between user and
2. Maximum response system
time 2. Minimum response
3. Job control time
languages 3. Commands entered
commands provides at the terminal
with the job
23
Time Sharing
⚫Using multiprogramming to handle multiple
interactive jobs
⚫Processor’s time is shared among multiple users
⚫Multiple users simultaneously access the system
through terminals

24
Time-Sharing
⚫Batch multiprogramming does not support interaction with users.
⚫Time-sharing extends Batch Multiprogramming to handle multiple
interactive jobs –
It’s Interactive Multiprogramming.
⚫Multiple users simultaneously access the system through
terminals.
⚫Processor’s time is shared among multiple users.

Opeating System for Computational Devices


Time-sharing Architecture

Opeating System for Computational Devices


Why Time-sharing?
⚫In Time-sharing (multitasking) the CPU switches jobs
so frequently that users can interact with each job
while it is running, creating interactive computing:
⚫Response time should be < 1 second.
⚫Each user has at least one program (process) executing
in memory.
⚫CPU scheduling supports several jobs ready to run at
the same time.
⚫If processes don’t fit in memory, swapping moves them
in and out to run.
⚫Virtual memory allows execution of processes not
completely inOpeating
memory.System for Computational Devices
Why did Time-Sharing work?
⚫Because of slow human reaction time, a typical user needs 2
seconds of processing time per minute.
⚫Then many users should be able to share the same system
without noticeable delay in the computer reaction time.
⚫The user should get a good response time.
⚫It fit the economic basis of the mainframe computer
installation.

Opeating System for Computational Devices


Services Provided by the Operating System
⚫Program development
⚫Editors and debuggers
⚫Program execution
⚫Access to I/O devices
⚫Controlled access to files
⚫System access

29
Services Provided by the Operating System
⚫Error detection and response
⚫Internal and external hardware errors
⚫Memory error
⚫Device failure
⚫Software errors
⚫Arithmetic overflow
⚫Access forbidden memory locations
⚫Operating system cannot grant request of
application
30
Services Provided by the OS
⚫Accounting
⚫Collect usage statistics
⚫Monitor performance
⚫Used to anticipate future enhancements
⚫Used for billing purposes

31
Operating System Structure
⚫View the system as a series of levels
⚫Each level performs a related subset of functions
⚫Each level relies on the next lower level to
perform more primitive functions
⚫This decomposes a problem into a number of
more manageable subproblems

32
Monolithic OS
★ The monolithic operating system is a very basic
operating system in which file management, memory
management, device management, and process
management are directly controlled within the kernel.

➔ Advantage
★ It can provide high performance, since system calls can
be made directly to the kernel without the overhead of
message passing between user-level processes.

➔ Disadvantages
★ If any service fails in the monolithic kernel, it leads to the
failure of the entire system.
★ To add any new service, the entire operating system needs to
be modified by the user.
Operating System Layers
Layered Structure
Unix OS
Layered OS

⚫The operating system is divided into a number of


layers (levels), each built on top of lower layers. The
bottom layer is the hardware; the highest (layer M) is
the user interface.
⚫With modularity, layers are selected such that each
uses functions (operations) and services of only
lower-level layers.
⚫Aids in maintainability, and ease and speed of
development.
⚫Layer 1: The bottom layer should always try to hide
the complex details of the hardware
⚫Layer 2: This layer should handle interrupts, context
switching, and the MMU, so above this level, the code is
mostly machine independent.
⚫Layer 3: manage threads, including scheduling and
inter thread synchronization
⚫Layer 4: we might find the device drivers, each one
running as a separate thread, with its own state,
program counter, registers, etc., within the kernel
address space.
⚫Above the Layer 4, we would expect to find virtual
memory, one or more file systems, and the system
call handlers.

⚫If the virtual memory is at a lower level than the


file systems, then the block cache can be paged out,
allowing the virtual memory manager to
dynamically determine how the real memory should
be divided among user pages and kernel pages,
40
41
43
Microkernel OS
Microkernel OS
★ A microkernel is divided into two parts, kernel space, and user space. Both parts
communicate with each other through IPC (Inter-process communication).
★ Microkernel advantage is that if one server fails, then the other server takes control
of it.
★ microkernel is solely responsible for the most important services of the OS
○ Inter process-Communication
○ Memory Management
○ CPU-Scheduling
Advantages of a microkernel architecture:
1. Better system stability, as crashes in user-level processes do not affect the entire system
2. More modular and flexible, making it easier to customize the operating system
3. Simplified development process, as services are developed and tested as independent user-
level processes
Disadvantages :
➔ Limited performance optimization due to separation of kernel and user-level processes
➔ Higher memory usage compared to a monolithic kernel
Operating System Structure

46
Sr.
Parameters Microkernel Monolithic kernel
No.

In microkernel, user services and In monolithic kernel, both user


1. Address Space kernel services are kept in services and kernel services are kept
separate address space. in the same address space.

Design and
2. OS is complex to design. OS is easy to design and implement.
Implementation

Monolithic kernel is larger than


3. Size Microkernel are smaller in size.
microkernel.

4. Functionality Easier to add new functionalities. Difficult to add new functionalities.

To design a microkernel, more Less code when compared to


5. Coding
code is required. microkernel
Failure of one component does Failure of one component in a
6. Failure not affect the working of micro monolithic kernel leads to the failure
kernel. of the entire system.

7. Processing Speed Execution speed is low. Execution speed is high.

It is not easy to extend monolithic


8. Extend It is easy to extend Microkernel.
kernel.

To implement IPC messaging


Signals and Sockets are utilized to
9. Communication queues are used by the
implement IPC in monolithic kernels.
communication microkernels.

10. Debugging Debugging is simple. Debugging is difficult.


Extra time and resources are
11. Maintain It is simple to maintain.
needed for maintenance.

Message passing Message forwarding and context Message passing and context
12. and Context switching are required by the switching are not required while the
switching microkernel. kernel is working.

The kernel only offers IPC and


The Kernel contains all of the
13. Services low-level device management
operating system’s services.
services.
Modern Operating Systems
⚫Microkernel architecture
⚫Assigns only a few essential functions to the
kernel
⚫Address spaces
⚫Inter-process communication (IPC)
⚫Basic scheduling
▪ A Microkernel interacts with local & Remote server
processes in a same way, facilitating conduction of
distributed system.
50
Some Monolithic Kernels
⚫ Unix kernels
⚫BSD ⚫ Unix-like kernels
⚫FreeBSD ⚫Linux
⚫MacOSX ⚫Android
⚫NetBSD ⚫ DOS
⚫NeXTSTEP ⚫DR-DOS
⚫OpenBSD ⚫MS-DOS
⚫Solaris 1 / SunOS ⚫Microsoft Windows 9x series
1.x-4.x (95, 98, Windows 98SE, Me)
⚫UNIX System V ⚫ Mac OS kernel, up to Mac OS 8.6
⚫AIX
⚫ OpenVMS
⚫HP-UX
⚫ XTS-400
⚫OpenSolaris
⚫Solaris 2.x-10
Modern Operating Systems
⚫ Object-oriented design
⚫Used for adding modular extensions to a small kernel
⚫Enables programmers to customize an operating system without disrupting system
integrity
⚫The Windows application programming interface (API) is the programming interface
to the Microsoft Windows operating system family. It provides services used by all
Windows-based applications to enable applications to provide a Graphical User
Interface (GUI), access system resources, incorporate audio and much more.
⚫ Encapsulation
⚫Object consists of one or more data items and one or more procedures
⚫ Object class or instance
⚫Create specified instances of an object
⚫ Inheritance
⚫Support to some extent in the Executive
⚫ Polymorphism
52
UNIX
⚫Hardware is surrounded by the operating system
software
⚫Operating system is called the system kernel
⚫Comes with a number of user services and
interfaces
⚫Shell
⚫Components of the C compiler

53
UNIX

54
UNIX
Kernel

55
Modern UNIX Kernel

56
Shell
❖ Your interface to the operating system is called a shell.
The shell is the outermost layer of the operating
system.
❖ The shell manages the interaction between you and the
operating system by prompting you for input,
interpreting that input for the operating system, and
then handling any resulting output from the operating
system.
❖ BASH (Bourne Again SHell) – It is used as default login
shell in Linux systems and in macOS. It can also be
installed on Windows OS.
❖ CSH (C SHell) – The C shell’s syntax and its usage are
very similar to the C programming language.
❖ KSH (Korn SHell) – The Korn Shell was also the base for
System Call
⚫OS provides series of application programming
interfaces (API) calls which application programmers
use to accomplish detailed h/w manipulation and
other operation.

⚫The API provides system calls by which a user


program instructs the OS to do the work.

58
Applicatio Applicatio Applicatio
Application
n n n
_ _ _ _ _ _ _ _ _ _ _ _ __ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
___ System Call
Interface

Fig: Interaction between application and OS OS


component 59
System Call
⚫It provides the interface between kernel (OS ) and
application programs (process).
⚫These are generally available as assembly language.
⚫Mostly system call mechanism are machine
dependent.
⚫Processes executes functions calls defined by the API
to access services provided by a lower layer of the
system.
⚫The function calls may issue system calls to request
services from the OS. 60
⚫ 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).
Transition from User to Kernel Mode
⚫ Timer to prevent infinite loop / process hogging resources
⚫Set interrupt after specific period
⚫Operating system decrements counter
⚫When counter zero generate an interrupt
⚫Set up before scheduling process to regain control or terminate
program that exceeds
Difficulties with Designing System Software

⚫Improper synchronization
⚫Ensure a process waiting for an I/O device receives the
signal
⚫Failed mutual exclusion
⚫Non-determinate program operation
⚫Program should only depend on input to it, not on the
activities of other programs
⚫Deadlocks
64
Summary
1 Operating system Overview
1.1 Introduction, Objectives, Functions and
Evolution of Operating System
1.2 Operating system structures: Layered,
Monolithic and Microkernel
1.3 Linux Kernel, Shell and System Calls

65
Quiz
testmoz.com/13392472
Thank you

67

You might also like