SlideShare ist ein Scribd-Unternehmen logo
1 von 41
What is an Operating System?
A program that acts as an intermediary between a
user of a computer and the computer hardware.
Operating system goals:
Execute user programs and make solving user
problems easier.
Make the computer system convenient to use.
Use the computer hardware in an efficient manner.
Computer System Components
1. Hardware – provides basic computing resources
(CPU, memory, I/O devices).
2.Operating system – controls and coordinates
the use of the hardware among the various
application programs for the various users.
3.Applications programs – define the ways in
which the system resources are used to solve
the computing problems of the users (compilers,
database systems, video games, business
programs).
4.Users (people, machines, other computers).
3
OPERATING SYSTEM
OVERVIEW
The Layers Of A
System
Program Interface
Humans
User Programs
O.S. Interface
O.S.
Hardware Interface/
Privileged Instructions
Disk/Memory/Screen
Loading Operating System
• Press the power button in C.P.U
• The BIOS chip tells it to look in a fixed place, usually on the lowest-numbered
hard disk (the boot disk) for a special program called a boot loader (under
Linux the boot loader is called Grub or LILO). The boot loader is pulled into
memory and started. The boot loader's job is to start the real operating system.
• The loader does this by looking for a kernel, loading it into memory, and
starting it.
• Once the kernel starts, it has to look around, find the rest of the hardware, and
get ready to run programs.
• After this first stage, the kernel hands control to a special process called ‘init’
which spawns several housekeeping processes.
• Init's next step is to start several daemons. A daemon is a program like a print
spooler, a mail listener or a WWW server that lurks in the background, waiting
for things to do. These special programs often have to coordinate several
requests that could conflict.
• The next step is to prepare for users.
Process Management
A process is the unit of work in a system. Some of which are operating
system processes and remaining are user processes.
A program does nothing unless its instructions are executed by a CPU. A
process is defined as a program in execution. A process needs certain
resources, including CPU time, memory, files and I/O devices to
accomplish its task.
Operating system activities in connection with Process Management
Creation and deletion of both user and system processes.
Suspension and resumption of processes.
Provision of mechanisms for process synchronization.
Provision of mechanisms for process communication.
Provision of mechanisms for deadlock handling.
Threads and Processes
Process:one or more threads, along with their execution state. e or
more threads, along wi
Thread: a sequential execution stream that executes a series
of instructions in ordereir execution state.
Dispatching :Almost all computers today can execute multiple
threads simultaneously. Each processor chip typically
contains multiple cores Each core contains a complete CPU
capable of executing threads
Context switch: changing the thread currently running on a
core by first saving the state of the old process, then loading
the state of the new thread.
•Several processes are submitted parallely to the system. The
processor serves very quickly each process on round robin basis or
more complex scheduling techniques and gives a flavour to the user
that the user is doing several works at the same time. This is
MULTITASKING
•MULTIPROGRAMMING is a similar concept but here a
process continues to run till there is an I/O call from the
program itself. Till then other processes remain suspended.
The objective of multiprogramming / multitasking is to have
some processes running at all time to maximize utilization of
CPU.
The objective of time sharing is to switch the processor
amongst processes so frequently that users can interact with
each program while it is running
Main-memory Management
Main-memory is a large array of words or bytes, ranging in size from
hundreds of thousands to hundreds of millions. The central processor
reads instructions from main-memory during the instruction-fetch
cycle, and both reads and writes data from main memory during the
data-fetch cycle. To process data from disk, first transferred to main
memory. To improve both the utilization of CPU and the speed of the
computer's response, keep several programs in memory. Selection of
a memory-management scheme depends on many factors.
Operating system activities in memory-management
-Keep track of which parts of memory are using by whom.
-Which processes are loaded into memory and when memory space
becomes available.
-Allocate and deallocate memory space as needed.
File Management
Computers can store information on several different types of physical media,
such as magnetic tape, magnetic disk, optical disk, etc. These media
properties include speed, capacity, data transfer rate and access method
(sequential or random).
A file is a collection of related information defined by its creator. Commonly
files represent programs (source and object) and data. Data files may be
numeric, alphabetic or alphanumeric. Files are organized into directories to
ease their use.
Operating System activities in File Management
Creation and deletion of files.
Creation and deletion of directories.
Manipulating files and directories.
Mapping of files onto secondary storage.
Backup of files on stable (non-volatile) storage media.
Input/Output System Management
Operating system is to hide the peculiarities of specific hardware
devices from the user, only the device driver knows the peculiarities
of the specific device to which it is assigned.
Operating system activities with respect to I/O sub-system
Memory management component including buffering, caching and
spooling.
A general device-driver interface.
Drivers for specific hardware devices.
Secondary-Storage Management
The main purpose of a computer system is to execute
programs. These programs, with the data they access must be
in main memory during execution. Most programs including
compilers, assemblers, sort routines, editors and formatters
are stored on a disk until loaded into main memory.
Operating System activities in disk management
Free-space management.
Storage allocation.
Disk scheduling.
Networking
A distributed system is a collection of processors that do not share
memory, peripheral devices or clock. Processors communicate with one
another through various communication lines.
Operating system activities in networking
Routing and connection strategies.
Control the problems of connection and security.
Access to a shared resources allows computation speedup, increased
data availability and enhanced reliability.
Protection System
If a computer system has multiple users and allows the concurrent
execution of multiple processes, then the various processes must be
protected from one another's activities.
Error Detection - The operating system
constantly needs to be aware of possible
errors . Errors may occur in the CPU , memory
hardware , in I/O device , and in user programs
. It is duty of operating system that display
appropriate message whenever an error
occurs and takes the suitable action for
ensuring correct and consistent computing .
Communication - If more than one programs
are running on same computer , then there are
many instances , when one process needs to
exchange information with another process .
Thus operating system performs the process of
communication through message passing .
Protection - Protection involves ensuring that
all access to system resource is controlled .
When several disjoint programs execute
concurrently it should not possible for one
process to interfere with the others , or with
operating system . Security of the system
from the outsiders is also important . Such
security starts with the user having to
authenticate himself to the system , usually by
means of a password to be allowed access to
the resources .
FIFO Page replacement Algorithm
• Simplest page replacement algorithm
• When a page must be replaced, the oldest page is chosen.
• There is a FIFO queue.
• When a page is brought into the memory, we insert it at
the tail of the queue.
• We replace a page at the head of the queue.
Example – FIFO Algo
Lets consider that pages need be brought in memory in
given sequence
7 0 1 2 0 3 0 4 2 3 1 2
7 7
0
7
0
1
2
0
1
2
3
1
2
3
0
4
3
0
4
2
0
4
2
3
1
2
3
Multi-Level Feedback Scheduling in
Windows NT,XP,2000
The multilevel feedback-queue scheduling
algorithm,allows a process to move between
queues. The idea is to separate processes
according to the characteristics of their CPU
bursts. If a process uses too much CPU time, it
will be moved to a lower-priority queue.
This scheme leaves I/O-bound and interactive
processes in the higher-priority queues.
In addition, a process that waits too long in a
lower-priority queue may be moved to a higher-
priority queue.
MEMORY MANAGEMENT
Types of Memory
Registers(0.25ns)
Compilers
On -Chip Cache
Off -Chip Cache(Hardware)
Main Memory (80-250 ns)(OS)
Hard Disk (5*10^6 ns) (OS)
S
P
E
E
D
S
I
Z
E
The Operating System tries to read / write data from the fa
Smallest storage unit and goes down the above pyramid o
doesnot get data in the memory at the top of the pyramid.
(0.5 – 25 ns)
USER PROGRAM
TEXT
INITIALIZED DATA
HEAP
STACK
LOW ADDRESS
HIGH ADDRESS
RAM
MEMORY ALLOCATION (MULTIPLE FIXED SIZE PARTITIONING)
P2
FREE
P1
FREE
FIXED
PARTIONS
a) A Process is selected from input queue and is loaded in free
partition.
b)When the process terminates the partition becomes free for other
processes.
BUDDY MEMORY ALLCATION METHOD
Caching
Information is normally kept in main memory. As it
is used it is copied to a faster storage system
the cache on a temporary basis. When a
particular piece of information is needed, the
cache is first referred, if it is in the cache it is
used. This event is called CACHE HIT.
If it is not in the cache the event is called CACHE
MISS.
(MULTIPLE VARIABLE SIZE PARTITIONING – Dynamic Storage Allocation)
P2
FREE(Hole)
P1
FREE(Hole)
VARIABLE
PARTIONS
a. Operating system keeps a table indicating which part of
memory
Is free.
b. Memory is allocated to the processes until the remaining
free block of memory is unable to hold any process
Internal
Fragmentation
External
Fragmentation
• When a process arrives and need memory, the system searches for
a set of hole that is large enough for the process. It the hole is large
enough, it is split into two, one part sufficient to hold the process
and the free portion is returned to the set of holes.
• When the process releases the block of memory it is returned back
to the set of holes. If the new hole is adjacent to the set of holes the
adjacent holes are merged to form one larger hole.
Filling Strategies
• First Fit – Allocate the first hole that is big enough. Search can start
either at the begining of the set of holes or at a location where the
previous first fit search ended.
• Best Fit- Allocate the smallest hole that is big enough. We must
search the entire list unless the list is ordered by size. This strategy
produces the smallest leftover hole.
• Worst Fit- Allocate the largest hole. We must search the entire list,
unless it is sorted by size.
First fit and the best fit suffers from external fragmentation
External Fragmentation & Internal Fragmentation
• External Fragmentation – As processes are loaded and
removed from memory, the free memory space is
broken into little pieces. External fragmentation exists
when there is enough total memory space to satisfy a
request but the available spaces are not contiguous.
• Internal Fragmentation – When a free hole is
allocated to a process the hole may be a little larger
than the requested memory. For example let the
process size be 18462 bytes but hole allocated is
18466 bytes so internal fragmentation is 4 bytes.
PAGING CONCEPT
• Paging is a memory management scheme that permits
the physical address space in the main memory to be
non-contiguous. It avoids external fragmentation and
compaction.
BASIC METHOD OF PAGING
• Physical memory is broken into fixed sized blocks called frames.
• Logical memory space it the virtual memory space of a process is
broken down into blocks of fixed size called pages. Size of a page
is typically a power of 2 between 512 bytes and 16 MB.
• Every logical address generated by CPU is divided into two parts –
a) page no. (p)
b) page offset (d).
• The page no is used as index into a page table(exists physically).
• The page table contains the base address of each page in
physical memory.
PAGE 0
PAGE 1
PAGE 2
PAGE 3
Logical Memory
1
4
3
7
Page Table
page 0
page 2
page 1
page 3
0
1
2
3
Physical Memory
FrameNumber
0
1
2
3
4
5
6
7
p d
CPU
f d
Logical
Address
Physical
Address

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Operating system memory management
Operating system memory managementOperating system memory management
Operating system memory management
 
operating system
operating systemoperating system
operating system
 
File access methods.54
File access methods.54File access methods.54
File access methods.54
 
Operating system basics
Operating system basicsOperating system basics
Operating system basics
 
Functions Of Operating System
Functions Of Operating SystemFunctions Of Operating System
Functions Of Operating System
 
Cpu scheduling
Cpu schedulingCpu scheduling
Cpu scheduling
 
Memory management
Memory managementMemory management
Memory management
 
Cpu scheduling in operating System.
Cpu scheduling in operating System.Cpu scheduling in operating System.
Cpu scheduling in operating System.
 
Operating system and its types
Operating system and its types Operating system and its types
Operating system and its types
 
Process state in OS
Process state in OSProcess state in OS
Process state in OS
 
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecture
 
Unix
UnixUnix
Unix
 
Batch operating system
Batch operating system Batch operating system
Batch operating system
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
 
Process management os concept
Process management os conceptProcess management os concept
Process management os concept
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
 
Memory management
Memory managementMemory management
Memory management
 
OPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTESOPERATING SYSTEM - SHORT NOTES
OPERATING SYSTEM - SHORT NOTES
 

Ähnlich wie Basics of Operating System

operatinndnd jdj jjrg-system-1(1) (1).pptx
operatinndnd jdj jjrg-system-1(1) (1).pptxoperatinndnd jdj jjrg-system-1(1) (1).pptx
operatinndnd jdj jjrg-system-1(1) (1).pptxkrishnajoshi70
 
operating system over view.ppt operating sysyems
operating system over view.ppt operating sysyemsoperating system over view.ppt operating sysyems
operating system over view.ppt operating sysyemsJyoReddy9
 
Unit 1-Operating Systems Overview .pptx
Unit 1-Operating Systems Overview .pptxUnit 1-Operating Systems Overview .pptx
Unit 1-Operating Systems Overview .pptxThamaraiselviAvinuty
 
L-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.pptL-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.pptKirti Verma
 
Operating system
Operating systemOperating system
Operating systemmak120
 
Advanced computer architecture lesson 1 and 2
Advanced computer architecture lesson 1 and 2Advanced computer architecture lesson 1 and 2
Advanced computer architecture lesson 1 and 2Ismail Mukiibi
 
OS - Ch1
OS - Ch1OS - Ch1
OS - Ch1sphs
 
Chapter 1 - Introduction
Chapter 1 - IntroductionChapter 1 - Introduction
Chapter 1 - IntroductionWayne Jones Jnr
 
Operating systems. replace ch1 with numbers for next chapters
Operating systems. replace ch1 with numbers for next chaptersOperating systems. replace ch1 with numbers for next chapters
Operating systems. replace ch1 with numbers for next chapterssphs
 
installing and optimizing operating system software
installing and optimizing operating system software   installing and optimizing operating system software
installing and optimizing operating system software Jaleto Sunkemo
 
Basic operating systems in computer and it's uses
Basic operating systems in computer and it's usesBasic operating systems in computer and it's uses
Basic operating systems in computer and it's usesSurya Vishnuram
 
Ch1kiit [compatibility mode]
Ch1kiit [compatibility mode]Ch1kiit [compatibility mode]
Ch1kiit [compatibility mode]Amit Gupta
 

Ähnlich wie Basics of Operating System (20)

Ch1
Ch1Ch1
Ch1
 
operatinndnd jdj jjrg-system-1(1) (1).pptx
operatinndnd jdj jjrg-system-1(1) (1).pptxoperatinndnd jdj jjrg-system-1(1) (1).pptx
operatinndnd jdj jjrg-system-1(1) (1).pptx
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Ch1
Ch1Ch1
Ch1
 
operating system over view.ppt operating sysyems
operating system over view.ppt operating sysyemsoperating system over view.ppt operating sysyems
operating system over view.ppt operating sysyems
 
Unit 1-Operating Systems Overview .pptx
Unit 1-Operating Systems Overview .pptxUnit 1-Operating Systems Overview .pptx
Unit 1-Operating Systems Overview .pptx
 
L-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.pptL-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.ppt
 
Operating system
Operating systemOperating system
Operating system
 
Advanced computer architecture lesson 1 and 2
Advanced computer architecture lesson 1 and 2Advanced computer architecture lesson 1 and 2
Advanced computer architecture lesson 1 and 2
 
ch1.ppt
ch1.pptch1.ppt
ch1.ppt
 
Ch3
Ch3Ch3
Ch3
 
OS - Ch1
OS - Ch1OS - Ch1
OS - Ch1
 
Chapter 1 - Introduction
Chapter 1 - IntroductionChapter 1 - Introduction
Chapter 1 - Introduction
 
Operating systems. replace ch1 with numbers for next chapters
Operating systems. replace ch1 with numbers for next chaptersOperating systems. replace ch1 with numbers for next chapters
Operating systems. replace ch1 with numbers for next chapters
 
installing and optimizing operating system software
installing and optimizing operating system software   installing and optimizing operating system software
installing and optimizing operating system software
 
Basic operating systems in computer and it's uses
Basic operating systems in computer and it's usesBasic operating systems in computer and it's uses
Basic operating systems in computer and it's uses
 
Os by nishant raghav
Os by nishant raghavOs by nishant raghav
Os by nishant raghav
 
Operating System
Operating SystemOperating System
Operating System
 
Ch1kiit [compatibility mode]
Ch1kiit [compatibility mode]Ch1kiit [compatibility mode]
Ch1kiit [compatibility mode]
 
Introduction of operating system
Introduction of operating systemIntroduction of operating system
Introduction of operating system
 

Mehr von Soumit Ghosh

Mehr von Soumit Ghosh (6)

Computer Hardware
Computer HardwareComputer Hardware
Computer Hardware
 
Number systems conversions
Number systems conversionsNumber systems conversions
Number systems conversions
 
Networking
NetworkingNetworking
Networking
 
Ms Word
Ms Word Ms Word
Ms Word
 
Excel 2007 for Retail
Excel 2007 for RetailExcel 2007 for Retail
Excel 2007 for Retail
 
Generation Of Computers
Generation Of ComputersGeneration Of Computers
Generation Of Computers
 

Kürzlich hochgeladen

INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxkarenfajardo43
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxMichelleTuguinay1
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptxmary850239
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research DiscourseAnita GoswamiGiri
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDhatriParmar
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 

Kürzlich hochgeladen (20)

INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptxGrade Three -ELLNA-REVIEWER-ENGLISH.pptx
Grade Three -ELLNA-REVIEWER-ENGLISH.pptx
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptxDIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
DIFFERENT BASKETRY IN THE PHILIPPINES PPT.pptx
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx4.16.24 Poverty and Precarity--Desmond.pptx
4.16.24 Poverty and Precarity--Desmond.pptx
 
Scientific Writing :Research Discourse
Scientific  Writing :Research  DiscourseScientific  Writing :Research  Discourse
Scientific Writing :Research Discourse
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptxDecoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
Decoding the Tweet _ Practical Criticism in the Age of Hashtag.pptx
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 

Basics of Operating System

  • 1. What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware. Operating system goals: Execute user programs and make solving user problems easier. Make the computer system convenient to use. Use the computer hardware in an efficient manner.
  • 2. Computer System Components 1. Hardware – provides basic computing resources (CPU, memory, I/O devices). 2.Operating system – controls and coordinates the use of the hardware among the various application programs for the various users. 3.Applications programs – define the ways in which the system resources are used to solve the computing problems of the users (compilers, database systems, video games, business programs). 4.Users (people, machines, other computers).
  • 3. 3 OPERATING SYSTEM OVERVIEW The Layers Of A System Program Interface Humans User Programs O.S. Interface O.S. Hardware Interface/ Privileged Instructions Disk/Memory/Screen
  • 4.
  • 5. Loading Operating System • Press the power button in C.P.U • The BIOS chip tells it to look in a fixed place, usually on the lowest-numbered hard disk (the boot disk) for a special program called a boot loader (under Linux the boot loader is called Grub or LILO). The boot loader is pulled into memory and started. The boot loader's job is to start the real operating system. • The loader does this by looking for a kernel, loading it into memory, and starting it. • Once the kernel starts, it has to look around, find the rest of the hardware, and get ready to run programs. • After this first stage, the kernel hands control to a special process called ‘init’ which spawns several housekeeping processes. • Init's next step is to start several daemons. A daemon is a program like a print spooler, a mail listener or a WWW server that lurks in the background, waiting for things to do. These special programs often have to coordinate several requests that could conflict. • The next step is to prepare for users.
  • 6.
  • 7.
  • 8. Process Management A process is the unit of work in a system. Some of which are operating system processes and remaining are user processes. A program does nothing unless its instructions are executed by a CPU. A process is defined as a program in execution. A process needs certain resources, including CPU time, memory, files and I/O devices to accomplish its task. Operating system activities in connection with Process Management Creation and deletion of both user and system processes. Suspension and resumption of processes. Provision of mechanisms for process synchronization. Provision of mechanisms for process communication. Provision of mechanisms for deadlock handling.
  • 9. Threads and Processes Process:one or more threads, along with their execution state. e or more threads, along wi Thread: a sequential execution stream that executes a series of instructions in ordereir execution state. Dispatching :Almost all computers today can execute multiple threads simultaneously. Each processor chip typically contains multiple cores Each core contains a complete CPU capable of executing threads Context switch: changing the thread currently running on a core by first saving the state of the old process, then loading the state of the new thread.
  • 10.
  • 11. •Several processes are submitted parallely to the system. The processor serves very quickly each process on round robin basis or more complex scheduling techniques and gives a flavour to the user that the user is doing several works at the same time. This is MULTITASKING •MULTIPROGRAMMING is a similar concept but here a process continues to run till there is an I/O call from the program itself. Till then other processes remain suspended. The objective of multiprogramming / multitasking is to have some processes running at all time to maximize utilization of CPU. The objective of time sharing is to switch the processor amongst processes so frequently that users can interact with each program while it is running
  • 12. Main-memory Management Main-memory is a large array of words or bytes, ranging in size from hundreds of thousands to hundreds of millions. The central processor reads instructions from main-memory during the instruction-fetch cycle, and both reads and writes data from main memory during the data-fetch cycle. To process data from disk, first transferred to main memory. To improve both the utilization of CPU and the speed of the computer's response, keep several programs in memory. Selection of a memory-management scheme depends on many factors. Operating system activities in memory-management -Keep track of which parts of memory are using by whom. -Which processes are loaded into memory and when memory space becomes available. -Allocate and deallocate memory space as needed.
  • 13. File Management Computers can store information on several different types of physical media, such as magnetic tape, magnetic disk, optical disk, etc. These media properties include speed, capacity, data transfer rate and access method (sequential or random). A file is a collection of related information defined by its creator. Commonly files represent programs (source and object) and data. Data files may be numeric, alphabetic or alphanumeric. Files are organized into directories to ease their use. Operating System activities in File Management Creation and deletion of files. Creation and deletion of directories. Manipulating files and directories. Mapping of files onto secondary storage. Backup of files on stable (non-volatile) storage media.
  • 14. Input/Output System Management Operating system is to hide the peculiarities of specific hardware devices from the user, only the device driver knows the peculiarities of the specific device to which it is assigned. Operating system activities with respect to I/O sub-system Memory management component including buffering, caching and spooling. A general device-driver interface. Drivers for specific hardware devices.
  • 15. Secondary-Storage Management The main purpose of a computer system is to execute programs. These programs, with the data they access must be in main memory during execution. Most programs including compilers, assemblers, sort routines, editors and formatters are stored on a disk until loaded into main memory. Operating System activities in disk management Free-space management. Storage allocation. Disk scheduling.
  • 16. Networking A distributed system is a collection of processors that do not share memory, peripheral devices or clock. Processors communicate with one another through various communication lines. Operating system activities in networking Routing and connection strategies. Control the problems of connection and security. Access to a shared resources allows computation speedup, increased data availability and enhanced reliability. Protection System If a computer system has multiple users and allows the concurrent execution of multiple processes, then the various processes must be protected from one another's activities.
  • 17.
  • 18. Error Detection - The operating system constantly needs to be aware of possible errors . Errors may occur in the CPU , memory hardware , in I/O device , and in user programs . It is duty of operating system that display appropriate message whenever an error occurs and takes the suitable action for ensuring correct and consistent computing . Communication - If more than one programs are running on same computer , then there are many instances , when one process needs to exchange information with another process . Thus operating system performs the process of communication through message passing .
  • 19. Protection - Protection involves ensuring that all access to system resource is controlled . When several disjoint programs execute concurrently it should not possible for one process to interfere with the others , or with operating system . Security of the system from the outsiders is also important . Such security starts with the user having to authenticate himself to the system , usually by means of a password to be allowed access to the resources .
  • 20. FIFO Page replacement Algorithm • Simplest page replacement algorithm • When a page must be replaced, the oldest page is chosen. • There is a FIFO queue. • When a page is brought into the memory, we insert it at the tail of the queue. • We replace a page at the head of the queue.
  • 21. Example – FIFO Algo Lets consider that pages need be brought in memory in given sequence 7 0 1 2 0 3 0 4 2 3 1 2 7 7 0 7 0 1 2 0 1 2 3 1 2 3 0 4 3 0 4 2 0 4 2 3 1 2 3
  • 22.
  • 23.
  • 24. Multi-Level Feedback Scheduling in Windows NT,XP,2000 The multilevel feedback-queue scheduling algorithm,allows a process to move between queues. The idea is to separate processes according to the characteristics of their CPU bursts. If a process uses too much CPU time, it will be moved to a lower-priority queue. This scheme leaves I/O-bound and interactive processes in the higher-priority queues. In addition, a process that waits too long in a lower-priority queue may be moved to a higher- priority queue.
  • 25.
  • 26.
  • 27.
  • 29. Types of Memory Registers(0.25ns) Compilers On -Chip Cache Off -Chip Cache(Hardware) Main Memory (80-250 ns)(OS) Hard Disk (5*10^6 ns) (OS) S P E E D S I Z E The Operating System tries to read / write data from the fa Smallest storage unit and goes down the above pyramid o doesnot get data in the memory at the top of the pyramid. (0.5 – 25 ns)
  • 31.
  • 32. MEMORY ALLOCATION (MULTIPLE FIXED SIZE PARTITIONING) P2 FREE P1 FREE FIXED PARTIONS a) A Process is selected from input queue and is loaded in free partition. b)When the process terminates the partition becomes free for other processes.
  • 34. Caching Information is normally kept in main memory. As it is used it is copied to a faster storage system the cache on a temporary basis. When a particular piece of information is needed, the cache is first referred, if it is in the cache it is used. This event is called CACHE HIT. If it is not in the cache the event is called CACHE MISS.
  • 35. (MULTIPLE VARIABLE SIZE PARTITIONING – Dynamic Storage Allocation) P2 FREE(Hole) P1 FREE(Hole) VARIABLE PARTIONS a. Operating system keeps a table indicating which part of memory Is free. b. Memory is allocated to the processes until the remaining free block of memory is unable to hold any process Internal Fragmentation External Fragmentation
  • 36. • When a process arrives and need memory, the system searches for a set of hole that is large enough for the process. It the hole is large enough, it is split into two, one part sufficient to hold the process and the free portion is returned to the set of holes. • When the process releases the block of memory it is returned back to the set of holes. If the new hole is adjacent to the set of holes the adjacent holes are merged to form one larger hole.
  • 37. Filling Strategies • First Fit – Allocate the first hole that is big enough. Search can start either at the begining of the set of holes or at a location where the previous first fit search ended. • Best Fit- Allocate the smallest hole that is big enough. We must search the entire list unless the list is ordered by size. This strategy produces the smallest leftover hole. • Worst Fit- Allocate the largest hole. We must search the entire list, unless it is sorted by size. First fit and the best fit suffers from external fragmentation
  • 38. External Fragmentation & Internal Fragmentation • External Fragmentation – As processes are loaded and removed from memory, the free memory space is broken into little pieces. External fragmentation exists when there is enough total memory space to satisfy a request but the available spaces are not contiguous. • Internal Fragmentation – When a free hole is allocated to a process the hole may be a little larger than the requested memory. For example let the process size be 18462 bytes but hole allocated is 18466 bytes so internal fragmentation is 4 bytes.
  • 39. PAGING CONCEPT • Paging is a memory management scheme that permits the physical address space in the main memory to be non-contiguous. It avoids external fragmentation and compaction.
  • 40. BASIC METHOD OF PAGING • Physical memory is broken into fixed sized blocks called frames. • Logical memory space it the virtual memory space of a process is broken down into blocks of fixed size called pages. Size of a page is typically a power of 2 between 512 bytes and 16 MB. • Every logical address generated by CPU is divided into two parts – a) page no. (p) b) page offset (d). • The page no is used as index into a page table(exists physically). • The page table contains the base address of each page in physical memory.
  • 41. PAGE 0 PAGE 1 PAGE 2 PAGE 3 Logical Memory 1 4 3 7 Page Table page 0 page 2 page 1 page 3 0 1 2 3 Physical Memory FrameNumber 0 1 2 3 4 5 6 7 p d CPU f d Logical Address Physical Address