0% found this document useful (0 votes)
72 views31 pages

Ssos - U3

Uploaded by

fayazahamed024
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)
72 views31 pages

Ssos - U3

Uploaded by

fayazahamed024
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/ 31

SYSTEM SOFTWARE AND OPERATING SYSTEM – 43A

TEXT BOOKS

1. Leland L. Beck , System Software : An Introduction to System


Programming , Pearson , Third Edition.

2. H.M. Deitel , Operating Systems , 2 nd Edition , Pearson , 2003.

Course Study :
Consists of 5 Units : Unit 1 & 2 – System Software
Unit 3 to 5 – Operating Systems
Max.Marks : 100 Marks
Internal : 50 Marks
External : 50 Marks
UNIT – III

What is an operating System? – process concepts : Definition of process – process

states –process states transition – interrupt processing – interrupt classes – Storage Management :
Real storage : Real storage management strategies – contiguous versus non-contiguous storage
allocation – single user contiguous storage allocation – fixed partition multiprogramming –
variable partition multiprogramming.
OPERATING SYSTEM
Operating System (OS) is one of the core software programs that runs on the hardware

and makes it usable for the user to interact with the hardware so that they can send commands
(input) and receive results (output). It provides a consistent environment for other software to
execute commands.

Therefore Operating system is a software that controls the Hardware and which
interacts between the user and the system.
Operating systems are primarily resource managers, The main resources they manage
are
• Processor Management
• Memory Management
• Device Management
• File Management
Therefore the OS manages those resources/management using the following functions
Functions of OS
* Keeping the track of the status of the resource
* Determining the allocation policy (when , how ,what , where)
* Allocating the resource to the job
* Deallocating the resource from the job
EVOLUTION OF OS

Assignment : Evolution of OS
PROCESS CONCEPTS
- PROCESS
- PROCESS STATES
- PROCESS STATES TRANSITION
-PROCESS
The term process was first used by the designers of the Multics system in 1960s. The
process can be defined as a program in execution.
-PROCESS STATES

A process goes through a serious of discrete process states . Various events can cause a
process to change the states. The states are
* Ready - A process is said to be in ready state if it could use a CPU if one were
available.
* Running – A process is said to be in running state if it currently has the CPU.
* Blocked – A process is said to be in blocked state if it is waiting for some event to
happen (Example : such as an i/o completion ) before it can proceed.
-PROCESS STATES TRANSITION

A ---- new job coming in to the ready state

B ---- dispatch(process name) : ready running


C ---- timerrunout(process name) : running ready
D ---- process or job going out after successful completion
E ---- wakeup(process name) : blocked ready
F ---- block(process name) : running blocked
PROCESS CONTROL BLOCK (PCB)
Process control block can also be called as process descriptor. The PCB is a data
structure containing certain important information about the process including
- the current state of the process
- unique identification of the process
- a pointer to process parent (process that create this process)
- pointer to process child process(process that is created by this process)
- the priority of the process
- pointers to locate the process memory
- pointers to allocate resources
- a register save area
- the processor it is running on (in a multiprocessing system)
OPERATIONS ON PROCESSES
Systems that manage processes must be able to perform certain operations on and with
processes . These include
• create a process
• destroy a process
• suspend a process
• resume a process
• change process priority
• block a process
• dispatch a process
• wakeup a process

• enable a process to communicate with another process and is called as inter


process communication.
Creating a process involves many operations including
- name of the process
- insert it in the systems known processes list or process table
- determine the process initial priority
- create the process control block
- allocate the process initial resource
INTERRUPT PROCESSING
An interrupt is an event that alters the sequence in which a processor executes the
instructions. It is generated by the hardware of the computer system. When an interrupt occurs
* The OS gains the control (i.e H/W passes the control to the OS)
* The OS saves the state of the interrupted process and this is stored in PCB

* The OS analyze the interrupt and passes the control to the appropriate routine to handle
the interrupt.
* The interrupt handler routine processes the interrupt
* The state of the interrupted process is restored
* The interrupted process executes
Hence an interrupt may be specifically initiated by a running process (in which case it is

often called a trap and is said to be synchronous with the operation of the process. Or it may be caused
by some event that may or may not be related to the running process and is said to asynchronous with
the operation of the process.
Interrupt Classes

• SVC(supervisor call) interrupt – These are initiated by a running process that executes
the SVC instruction. An SVC is an user generated request for a particular system service
such as performing i/o ,obtaining more storage etc. The SVC mechanism helps to keep the
OS secure from the users.

• I/O interrupt – These are initiated by the input-output hardware. They signal to the
CPU that the status of a channel or device has changed, I/O interrupts are caused when an
I/O operation completes.

• External interrupt – These are caused by various events including the expiration of a
quantum on an interrupting clock , the pressing of the consoles interrupt key by the operator
or the receipt of a signal from another processor on a multiprocessor system.

• Restart interrupt - These occur when the operator presses the consoles restart button or
when a restart SIGP(signal processor) instruction arrives from another processor on a
multiprocessor system.
• Program check interrupt - These are caused by a wide range of problems that may
occur as a programs machine language instructions are executed. These problems include
division by zero, arithmetic overflow , data is in the wrong format , attempt to reference a
memory location beyond the limits of real memory etc.

• Machine check interrupt - These are caused by malfunctioning the hardware.

Context Switching
When an interrupt occurs , the OS saves the status of the interrupted process and

routers the control to the appropriate first level interrupt handler(FLIH). This is accomplished by
the technique called context switching. The FLIH must then distinguish between interrupts of the
same class processing of these different interrupts is carried out by the various second level
interrupt handler(SLIH).

Program Status Word(PSW) control the order of instruction execution and contains

various information about the state of a process. There are 3 types of PSWs namely current ,old
and new.
New PSWs Old PSWs

Supervisor call Supervisor call

I/O I/O

Current PSW
A
External External
B
Restart Restart

Program check Program check

Machine check Machine check

PSW Swapping in interrupt processing


The address of the next instruction to be executed is kept in the current PSW, which

also indicates the types of interrupts currently enabled and those currently disabled. The CPU
allows the enabled interrupts to occur and the disabled interrupts either remain pending or in
some cases are ignored.

On a uniprocessor system, there is only one current PSW , but there are six new and old
PSWs. One for each interrupt type. The new PSW for a given type contains the permanent main
memory address at which the interrupt handler routine for that interrupt resides.

When an interrupt occurs if the processor is not disabled for that type of interrupt, then
the hardware automatically switches PSWs by
• storing the current PSW in the old PSW for this type of interrupt.
• storing the new PSW for that type of interrupt into the current PSW.
After this PSW swap , the current PSW now contains the address of the appropriate

interrupt handler. The interrupt handler executes and processes the interrupt. When the
processing of the interrupt is complete the CPU is dispatched to either the process that was
running at the time of the interrupt or to the high priority process which is ready. This depends
on whether the interrupted process is preemptive or nonpreemptive .
STORAGE MANAGEMENT
The organization and management of the main memory or primary memory or real
memory of a computer system has been one of the most important factor influencing operating
system design. The terms memory and storage have been used interchangeably . Programs and
data must be in main storage in order to run or to refer directly. Secondary storage most
commonly disk , drum and tape provides massive , inexpensive capacity for the abundance of
programs and data that must be kept readily available for processing.

Storage Management Strategies


Expensive resources are managed intensively to achieve better use. Storage

management strategies are geared to obtain the best possible use of the main storage resource.
Therefore the storage management strategies are
* Fetch strategies
- Demand fetch strategy
- Anticipatory fetch strategy
* Placement strategies
* Replacement strategies
* Fetch Strategies
Fetch strategies are concerned with when to obtain the next piece of program or data
for transfer to main storage from secondary storage.
- Demand fetch strategies transfer the next piece of a program or data into the main
storage only when it is referenced by a running program.
- Anticipatory fetch strategies uses heuristics to predict which pages a process will
soon reference and load those pages or segments.
* Placement Strategies
Placement strategies are concerned with determining where in main storage to place an
incoming program . The strategies are
first fit – Place the incoming job in the first available slot which is
large enough to hold the job.
best fit - An incoming job is placed in the hole or block where it
best fits (i.e. the amount of free space left is minimal)
worst fit - Place the incoming program in the largest slot
available. The remaining may still be large enough to hold another job.
* Replacement Strategies
Replacement strategies are concerned with determining which piece of a program or
data is to displaced to make a room for incoming programs.
CONTIGUOUS VS NON-CONTIGUOUS STORAGE ALLOCATION
CONTIGUOUS
Contiguous memory allocation is basically a method in which a single contiguous

section/part of memory is allocated to a process or file needing it. Because of this all the available
memory space resides at the same place together, which means that the freely/unused available
memory partitions are not distributed in a random fashion here and there across the whole
memory space. The main memory is a combination of two main portions- one for the operating
system and other for the user program. We can implement/achieve contiguous memory allocation
by dividing the memory partitions into fixed size partitions.

NON-CONTIGUOUS
Non-Contiguous memory allocation is basically a method on the contrary to contiguous

allocation method, allocates the memory space present in different locations to the process as per
it’s requirements. As all the available memory space is in a distributed pattern so the freely
available memory space is also scattered here and there.
This technique of memory allocation helps to reduce the wastage of memory, which eventually
gives rise to Internal and external fragmentation.

Assignment III : Difference between contiguous memory allocation and noncontiguous memory
allocation.
SINGLE USER CONTIGUOUS STORAGE ALLOCATION
a

c
storage protection with single user contiguous storage allocation
• Single user program in memory - and size of program fits memory
• Part of the memory held the operating system, the remainder the user program
• OS protected from user programs (to prevent user program overwriting OS code)
• OS protection by the user of a single boundary register built into the CPU
• Boundary register is checked on each storage request
• However, if the user needs to use certain OS features (which it definitely will), use OS features
through a kernel or supervisor call
• The size of programs in memory is restricted by the space available

• The advantage is it increases the processing speed. As the operating system uses the
buffered I/O and reads the process memory blocks consecutively it reduces the head
movements. This speed ups the processing.

Early days single user real storage systems were dedicated to one job for more than the jobs
execution time and this led to the development of batch processing system. Therefore in a single
stream batch processing system , jobs are grouped in batches by loading them consecutively onto
tape or disk. A job stream processor reads the job control language statements and facilitates the
setup of the next job. Batch processing systems greatly improved the use of computer systems
and helped demonstrate the real value of operating systems and intensive resource management.
PARTITIONED MULTIPROGRAMMING
* FIXED PARTITIONED MULTIPROGRAMMING
* VARIABLE PARTITIONED MULTIPROGRAMMING
* FIXED PARTITIONED MULTIPROGRAMMING
Multiprogramming systems came into existence as several users will be able to use the

system resources simultaneously. The job currently waiting for I/O will yield the CPU to another
job ready to do calculations if indeed another job is waiting. This greatly increases CPU
utilization and system throughput. To take maximum advantage of multiprogramming , it is
necessary for several job to reside in the computers main storage at once . Thus when one job
requests i/o the CPU may be immediately switched to another and may do calculations without
delay. Multiprogramming normally requires considerably more storage than single user system.
Hence Fixed partitioned multiprogramming can be categorized into

- Fixed partition multiprogramming with absolute translation and loading

- Fixed partition multiprogramming with relocatable translation and loading


-Fixed partition multiprogramming with absolute translation and loading

Fixed partition multiprogramming with absolute translation and loading

- Job were translated with absolute assemblers and compilers to run only in a specific
partition. If a job was ready to run and its partition was occupied then that job had to wait
even if other partition were available.

-Therefore this resulted in waste of the storage resources , but the operating system was
relatively straight forward to implement.
- Fixed partition multiprogramming with relocatable translation and loading

Relocating compilers, assemblers and loaders are used to produce relocating programs

that can run in any available partition that is large enough to hold them. This scheme eliminates
some of the storage waste inherent in multiprogramming with absolute translation and loading.
Relocatable translators and loaders are more complex than their absolute counter parts.
- With these two registers the users partition can be delineated . The user which needs to
call upon the operating system uses a supervisor call instruction to do so. This allows the user
to cross the boundary of the operating system and requests it services without compromising
operating system security.
Fragmentation

Storage fragmentation occurs in every computer system regardless of its storage


organization.
VARIABLE PARTITIONED MULTIPROGRAMMING

Initial partition assignments in variable partition programming


Characteristics
Storage holes in variable partitioned multiprogramming Coalescing storage holes in variable partitioned
multiprogramming

Storage compaction in variable partitioned multiprogramming


Storage placement strategies
MULTIPROGRAMMING WITH STORAGE SWAPPING

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