Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
6 views21 pages

Operating System

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

Operating System

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

Principals of operating System

Unit:-01
Introduction

Operating System:-
In modern computing Systems, the operating system is the foundational
piece of software on which all ther software is build. It's duties include
handling communication with computer hardware and managing
competing demands of ther programs that are running.

As operating is the program that after being initially loaded into the
computer by a boot program, manages all of the other application program
in a computer. The application programs make use of the operating system
make by making requests for services through a defined application
progrom interface (API).

Functions:-
Operating system handles the following responsibilities. It controls all the
computer resources. It provides valuable service's to resources. It control
all the computer resources. It coordinates the execution of user programs.
It provides resources for user programs.

Functions of Operating System:-


1. Memory Management
2. Process Managersent/CPU shedule
3. Device Management
4. File Management
5. Security
6. Accounting
7. Error detection etc.

Evaluation of O.S.:-
A Special type of operating system needed to manage the network
communication.

The evolution of operating system began with serial processing. It make


the start of the develppment of electronic computing systems as
alternatives to mechanical computers.

Because of the flows in mechanical computing devices, human's


calculation speed is limited, and they are prone to making.

Batch, Interactive:-
A batch operating system that allows multiple users to use it at the same
time, without direct communication between them. This is done by having
the users submit their jobs to the operating system, which then processes
them one at a time.

When you type commands in a login shell and see a response displayed,
you are working interactively. To run a batch job you put the commands
into a text file instead of typing them at the prompt.

Time Sharing:-
A Time-sharing system allows several users to use a computer system
from various locations simultaneously. A Real-time operating system a
task within a sperfic time.

Real-time Operating System(RTOS):-


A Real Time Operating System (RTOS) is used in those environments
where we want the result of a task in a fixed time interval.

System Protection:-
System protection in an operating system refers to the mechanisms
implemented by the operating system to ensure the security and integrity
of the system. System protection involves various techniques to
prevent........ access, misuse, or modification of the operating system and
its resources.

The principle of protection involves placing a barrier between the


pathogen gen and the susceptible part of the host from the pathogen. This
can be accomplished by regulation of the environment, cultural and
handling practices control of insect carriers, and application of chemical.

System Components:-
The main components of an operating system mainly include Kernel. API
or application program interface, user interface and file system, hardware
devices and device drivers.

→ Process Management
→Input/Output Device Management
→ File Management
→ Network Management
→ Main Memory Management
→ Secondary storage Management
→ Security Management
→ Command Interpreter System

System Structure:-
Operating system provides the medium for the user to communicate with
the computer hardware. System software is installed on top of the
operating system. Operating system structure is the basic model which is
needed to implement Operating system.

The interconnections between the various operating system Components


can be defined as the operating system structure. The operating system is
divided into various different structural types: Simple Structure,
Monolithic approach, layered approach, microkernels, exokernels and
virtual machines.

Operating System Services:-


Both users and programs benefit from the services provided by an
operating system. It provides a platform to run in and gives user the ability
to run programs in a more........... way.
It is a program with the help of which we are able to run various
application. It is the one program that is running all the time. Every
computer must have an operating system to smoothly execute other
programs.
Unit:-02
Concurrent Process:-
Concurrency processing, also known as concurrent processing, refers to
the ability of an operating system to execute multiple tasks for processer
simultoneously, allowing for efficient utilization of resources and
improved performance.

Multiprogramming, or running a lot of program concurrently ( the


operating system has to multiplex their execution on available ).
Ex- Downloading a file, listening to streaming audio.

Process:-
A process is defined as a sequence of instructions executed in a predefined
order. In simple words any program that is executed is termed as a process.
Processes change their state as they execute and can be either new, ready,
running, waiting or terminated.

It is basically a program in execution. The execution of a process must


progress in a Sequential fashion. A process is defined as entity which
represents the basic unit of work to be implemented in the system.

State Transition:-
The process will transition back to a ready state whenever the proces is
again brought onto the main memory.

The process transitions are represented by arrows in a process state


diggram, which shows the possible state and transitions of a process.

A process can transition from ready to running when the scheduler selects
for execution.

Interrupts:-
An interrupt is an event that alerts the sequence in which the processor
executes instructions. An interrut might be planned or unplanned. Various
factors of occurring the interrupt.
Process Control Block:-
A process control block(PCB) is a data structure used by operating system
to store importont information about running processes.

A PCB in operating system is a data structure used by the operating system


to manage information about a process. It contains information about the
process state memory allocation.

Principle of Concurrency:-
Concurrency in operating system refer to the ability of an operating system
to handle multiple tasks or processes at the same time.

It is a key feature of modern operating system that enables efficient use of


system resources responsiveness, Scolability and parellelsim.

Producer-Consumer Problem:-
In the producer consumer problem, the producer produces an item and the
Consumer the item produced by the producer.

The problem describes two processes, the producer and the consumer that
shares a common fixed-size buffer use it as a queue. The producer’s job is
to generate data, put it into the buffer and start again. At the same time, the
consumer is consuming the data, one piece at a time.

Critical Section:-
The critical section is a Code segment where the shared variables can be
accessed. An atomic action is required in a Critical section. i.e. Only one
process can execute in its critical section at a time. All the other processes
have to wait to execute in their critical sections.

The critical section refers to the segment of code where processes access
shared resources such as common variables and files, and perform write
operations on them. Any process can be interrupted mid-execution
Unit 03
C-P-U Schedulling:-
CPU schedulling refers to the switching between processes that are being
executed. It forms the basis of multiprogrammed systems. This switching
ensures that CPU utilization is maximized so that the computer is more
productive. There are two main types of CPU Scheduling preemptive and
non- preemptive

The primary objective of cpu scheduling is to ensure that as many Jobs are
running at a time as is possible. On a single CPU system the goal is to
keep one job running at all times.

Scheduling Concept:-
Scheduling is the action off assigning resources to perform tasks. The
resources to perform tasks. The expansion cards. The tasks may be threads,
processes or data flow.

The scheduling activity is carried out by a process called scheduler.

Multiprogramming operating system rely heavily on process scheduling. It


is the process of re moving active task from the processor and replacing it
with a new one. It divides a procedure into states such as ready, waiting of
running.

Performance Criteria:-
Performance criteria are the expression of what is to be measured and why.

The criteria the CPU takes into consideration while "Schedulling these
processes are:-
CPU Utilization, throughput, turnaround time, waiting time, and
response time.

First Come First Serve(FCFS):-


First come first Serve Scheduling. FCFS scheduling algorithm
automatically executes the queued processes and requests in the order of
their arrival. It allocater the second one, and so on,

A scheduling algorithm in operating system is the algorithm that defines


how much cpu time must be allotted to which process and when.
Shortest Job First(SJF):-
The shortest job first or shortes job next. is a scheduling policy that selects
the waiting processes with the smallest to execution time to execute next.
SJN also known as shortest job Next, can be preemptive or non-
preemptive.

It is a type of disk scheduling algorithm in the operating system in which


the processor executes the job first that has the smallest executes time.
In this the processes are scheduled according to the burst time of these
processes.

Round Robin:-
Round-Robin is used in a scheduling algorithm that distributes work
evenly among all available resources. This ensures that no single resources
is overworked, which can lead to errors and other issues down the line.
This jo often described as round robin process Scheduling.

It is one of the algorithm employed by process and network schedulers in


computing. As the term, is generally used, time slices are assigned to each
process in equal portions and in circular order, handling all processes
without priority (also known as cyclic executive).

Dead lock:-
A dead lock is a situation in which two computer programs sharing the
same resources are effectively preventing each other from accessing the
resource, resulting in both program ceasing to function. In an operating
system, a deadlock occurs when a process or thread enter a waiting
process.

System Model:-
It describes how processes interact and what operations these processes,
perform, but it does not go into details as to how there processes are
implemented. The basic elemnts of the systems model in this text is a
block enclosing a transfer function.
They represent the information that software transforms, the functions,
There are various system models analysis system, behavioral, data, and
object models.
Dead lock Characterization:-
It is a situation in which more than one process is blocked because it is
holding a resource and also requires some resource that in acquired by
some other process. The four necessary conditions for a deadlock situation
are mutual exclusion, no preemption, hold and wait, and circular set.

Prevention:-
It is eliminating one of the necessary conditions of deadlock so that only
safe requests are made to operating system and the possibility of deadlock
is excluded before making requests.

It is a technique used in operating system to ensure that deadlocks, which


are situations when two or more processes are unable to processes because
each is waiting for the other to release a resource, do not occur.
Unit-04
Memory Management

Memory Management:-
It is the proces of controlling and coordinating a computer’s main memory.
It ensures that blocks of memory space are properly managed and
allocated so the operating system applications and other running processes
have the memory they need to carry out their operations.

It is the process of coordinating and controlling the memory during a


computer.

Real Storage:-
You/we can define the initial and reserved real storage for the logical
partition. In which z/vm is installed.

In a virtual storag system the portion of addressable memory that consists


of main storage.

Resident Moniter:-
It is a type of system software program that was used in amny early
computers from the 1950s to 1970. It can be considered a precursor to the
operating system. The nameis derived from a program which is always
present in the computer's memory, thus being resident.

It is responsible for maintaining a calm, friendly and cooperative


atmosphere with in the facility and with the participants to promote a
clean, orderly and healthy environment at all time.

Multiprogramming With Fixed Partition:-


It is a contiguous memory management technique in which main memory
is divided into fixed sized partitions which can be of equal or unequal size.
Whenever We have to allocate a process memory then a free portition that
is big enough to hold the process is found.

The system of dividing memory into non-overlapping sizes that are fixed,
unmoveable static.
Multiprogramming With Variable Partition:-
It is a contigious memory management technique in which the main
memory is not divided into partitions and the process is allocated a chank
of free memory that is big enough for it to fit.

Multiple Base Register:-


Specifies the smallest legal physical memory address. Base register
contains value of smallest physical address limit register contains range of
logical addresses each logical address must be less than the limit register.

Paging Segmentation:-
Segmentation with paging is a memory management technique used in
operating system to overcome the limitations of pure segmentation or pure
paging. It combines the benefits of both approaches to provide efficient
and flexible memory management.

Paged Segmentation:-
Paged segmentation is a memory management technique that divides a
process’s address space into segments and then divides each segment into
pages. This allows for a flexible allocation of memory, where each
segment can have a different size, and each page can have a different size
with in a segment.

Paging is a method of gaining acces to data more quickly. When a program


requires a page, it is available in the main memory because the operating
system copies a set number of pages from the storage device into the main
memory. Paging permits a process physical address space to be non-
contiguous.

Virtual Memory Concept:-


Virtual memory uses both hardware and software to enable computer to
compensate for physical memory sensory shortages, temporarily
transferring data from RAM to disk storage. Mapping chunks of memory
to disk files enables a computer to treat secondary memory as though it
were main memory.
It is defined as a memory management method where computers use
secondary memory to compensate for the scarcity of physical memory.
Virtual memory provides benefits in term of costs, physical space,
multitasking capabilities, and data security.

Demand Paging:-
In operating system it is a technique in which pages are loaded from disk
into main memory only when they are needed demanded by the program.

This technique allows the operating system to save memory space by


keeping only those pages in memory that are currently required by the
program.

It is memory management technique used by operating system to optmize


the use of memory resources.

Page Replacement Algorithms:-


It looks at the limited information about accesses to the pages provided by
hardware, and tries to guess which pages should be replaced to minimize
the total number of page misses, while balancing this with the cost
(primary storage and processor time) of the algorithm itself.

Allocation of Frames:-
In equal frame allocation, the processes are assigned equally among the
processes in the operating system.
Example:- If the system has 30 frames and 7 proccesses, each process
will get 4 frames. The 2 frames that are not assigned to any system
process may be used as a free-frame buffer pool in the systems.

Frome allocation algorithms are used if you have multiple processes, it


helps decide how many fromes to allocate to each process. There are
various constraints to the strategies for the allocation of frames: you
cannot allocate more than the total number of available frames.

Thrashig:-
In operating system it is a phenomenon that occurs in computer system
when the system spends an excessive amount of time on page swapping
rather than executing useful work. It is caused by a high level of page
faults, which happens when the systerm needs to retrieve a page from disk
because it is not present in memory.

Cache Memory:-
It is a chip-based computer component that makes retrieving data from the
Computer's memory more efficient. It acts as a temporary storage area that
the computer's processor can retrive data from easily.

It is a type of memory in which data is stored and accepted that are


inmediately. stored in cpu.

It is the fastest memory which has fastest access time where data is
temporarily stored for faster access.

Impact On Performance:-
The performance * an operating system is dependent on a variety of
factors, such as the hardware specifications of the computer, the design
and implementation of the operating system the type and number of
applications running on it, and the workload and environment.
Unit:05
Unix/Linux
Unix:-
Unix is an operating system which was first developed in the 1960s, and
has been under constant development ever since. By Operating system we
mean the suite of programs which make the computer work. It is a stable,
multi-user, multi-tasking system for servers, desktops and laptops.

Linux:-
Linux is an Open Source operating system. An operating system is the
software that directly manages a systemis hardware and resources, like
CPU, memory, and storage. The operating system sits between
applications and hardware and makes the connections between all of your
software and the physical resources that do the work.

Unix System Kernel:-


The Unix Kernel is the contral core of the operating system. It provides an
interface to the hardware devices as well as to process, memory, and I/O
management. The Kernel manager requests from users via System calls
that switch the process from user space to kernal space.

Unix system utilities:-


Unix utilities are only a well defined set of commands usable by portable
shell scripts and specified by pasix. The term is also sometimes loosely
used to include non standard CLI only command still common in Unix and
Linux systems, like say ess, emacs, perl, zip and a gazillion of others.

File:-
A unix file system is a collection of files and directories that has the
following properties:-
It has a root directory that contains other file and directories.
A unix file is an information container structured as a sequence of bytes.
Unix file systemis a logical method of organizing and storing
large amount of information in a way that maka it easy to manage.

A file is the smallest unit in which the information is stored. Unix file
system has Several important features. All data in Unix is organized into
files.

Directories:-
A directory on Unix is similar to a folder on a microcomputer. The
structure and content of many of the directories is Similar on various Unix
implementations. That is, the user does not decide how to set up all of the
directories.

The unix directory is tree like structure, usually drawn as an inverted tree.

Single Statement:-
A sample.c file is written with only one single statement. Main;
segmentation fault occurred when executed that file. Any statement other
than main;

Compound statement:-
It is a group of two or more statements connected using words such as 'or',
'and', 'if then', 'if and only if.

Each statement of a compound statement is a component statement, which


can be clearly decided as a true or false statement.

Basic Commands:-
Unix conmmands are a set of commands that are used to interact with the
unix operating system. Unix is a powerful, multi-user, multi-tasking
operating system that was developed in the 1960s by Bell labs.
A linux commond is a program or utility that runs on the command Line.

Unix Commands:-
CD:- Change directory.
CP:- Copying files.
DATE:- Display date.
MV:- Move
GRAP:- Search file
MK Dir:- Make directory.
RM Dir:- Rename files and directories

Linux Commands:-
CP:- Copies files and directories
RM:- Remove files and directories
MV:- Moves(renames) files and directories
MK Dir:- Creates directories.

Bourne Shell:-
The bourne shell is the original unix shell commmand execution progra
often called a command interpreter--- that developed in1977s at what at the
time was Bell Labs. Named for its developer. English computer scientist
"Stephen Bourne," the Bourne shell is also known by its program name,sh.

The Bourne shell is an interactive command interpreter and command


programming language. The bsh command runs the Bourne shell can be
run.

The bourne shell is an interactive command interpreter and command


programming language.

Korn Shell:-
The Korn shell, or ksh, was invented by David Korn of AT and T Bell
laboratories in the mid 1980s. It means that bourne shell users can be use it
right away, and all system utilities that use the bourne shell can use use the
Korn shell instead.

The Korn shell is an interactive command interpreter and commmond


programming language. It conforms to the portable operating system
interface for Computer Environmiento (POSIX), an international standard
for operating system.

C shell:-
Year:- 1970 Developer:- Bill joy C shell (csh) is a unix shell that
provides a command-line user interface (UI) to interact with an operating
system.

Created by Bill Joy at the University of california at Berkeley. In the late


1970s, C shell is one of the oldest unix shells used today.
The C shell is an interactive command interpreter and a command
programming language that user syntax similar to the C programming
language.

It is a sequence of commands that do a single job.

Shell Meta Characteristics:-


Unix special characters Asterik, question Mark, brackets, and Hyphen
Special characters or metacharacters, have a special meaning to the shell.
They can be used as wildcards to specify the name of a file without having
to type out the file's full name.

The shell has it's own set of metacharacters, often called shell wildcardo. It
can be used to group commands together.

Shell Variables:-
Variables that affect only current shell. In the C shell, a set of there shell
variables have a special relationship to a corresponding set of environment
variables.

There shell variables are user, term, home and path.

A shell variable is a character string in a shell that stores some value. It


could be an integer, filename, string, or some shell command itself.

Shell Scripts:-
A shell script is a computer program designed to be run by a unix shell, a
command- line interpreter. The various dialects of shell scripts are
considered to be scripting languages. Typical operations performed by
shell include file manipulation, progrom execution and printing text.

A shell script is a text file that contains a sequence of commands for a


Unix based operating system.

It is called a shell script because it combines a sequence of commands.


Shell Environment:-
A shell maintains an environment that includer a set of variables defined
by the login program, the systems initialization file, and the user
initialization files.

Integer Arithmetic:-
The value of a variable i's evaluated as an arithmetic expression when it is
refrenced, or, when a variable which has been given the integer attribute
using ‘declare’ is assigned a value. A null value evaluates to O. A shell
variable need not have its integer attribude turned on to be used in
expression.

String Manipulation:-
It is defined as performing several operations on a string resulting change
in its contents. In shell scripting this can be done in two ways: pure bash
string manipulotion, and string manipulation and string manipulation via
external command

It basically refers to the process of handling and analyzing strings.

Decision Making:-
Decision making is the process of making choices by identifying a
decision gathering information, and assessing alternative resolutions.
Using a step-by-step decision making process can help you make more
deliberate, thoughtful decision by organizing relevant information and
defining alternatives.

Internal Fragmentation:-
It occurs when the memory is distributed into fixed-sized blocks. If the
memory is allocated to the process is slightly larges than the memory
demanded, then the difference between allocated and demanded memory is
known as internal fragmentation.

External Fragmentation:-
It occurs whenever a method of dynamic memory allocation happens to
allocate some memory and leave a small amount of unusable memory.
Total quantity of the memory available is reduced substantially in case
there too much external fragmentation.

Logical And Physical Address:-


It is generated by CPU while a program is running. since a logical address
does not physically exists it is also known virtual address. This address is
used as a reference by the CPU to access the actual physical memory,
location.

Physical Address:-
It is like location that is present in the main memory. It is a collection of all
logical addresses rendered by the CPU. It is a collection of all physical
addresses mapped to the connected logical addresses. Logical address of
the program is visible to the users.

Shell:-
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.
Shell provide a way for you to communicate with the operating system.

Fragmentation:-
It refers to an unwanted problem that occurs in the opearting system in
which process is unloaded and loaded from memory, and the free memory
space gets fragmented. The processes can not be assigned to the mensory
blocks because of their small size. Thus the memory blocks always stay
unused.

What are page sizes always powers of ?


Ans= Because each bit position represents a power of 2, splitting an
address between bits resulty in a page size that is a power of 2.

Long Term Scheduling:-


A long-term Scheduler is a scheduler that is responsible for bringing
processes from the JOB queue (or secondary memory) into the READY
queue (or main memory). In other words, a long term Scheduler
determines which programs, will enter into the RAM for processing by
CPU.
Medium Term Scheduling:-
It is a part of the Swapping function. This is a decision whether to add a
process to those that are at least partiually in main memory and therefore
available for execution. Short term scheduling is the actual decision of
which ready process to execute next.

Short Term Scheduling:-


It is the actual decision of which ready process to execute next. The
interval of time between the submission of a process and it's completion.
Includes actual execution time plus time spent waiting for including the
processor.

Major Activities of O.S.:-


The three major activities of the operating system with regard to memory
management are: keeping track of which parts of memory are currently
being used and by whom. Deciding which processes are to be loaded into
memory when memory space becomes available. Allocating and
deallocating memory space as needed.

You might also like