Operating System
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.
Evaluation of O.S.:-
A Special type of operating system needed to manage the network
communication.
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.
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.
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.
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.
State Transition:-
The process will transition back to a ready state whenever the proces is
again brought onto the main memory.
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.
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.
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.
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.
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.
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.
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.
Real Storage:-
You/we can define the initial and reserved real storage for the logical
partition. In which z/vm is installed.
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.
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.
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.
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.
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.
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 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.
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.
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.
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.
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.
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.
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.
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
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.
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.