0% found this document useful (0 votes)
13 views3 pages

OS Sefa

An operating system (OS) is software that manages computer hardware and provides services for computer programs, including file, memory, and process management. It employs various scheduling algorithms to efficiently allocate CPU time to processes and supports multithreading for improved application performance. The document also discusses the evolution of operating systems, their functions, and the challenges they face, such as resource allocation and mutual exclusion.

Uploaded by

techzandgamez24
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)
13 views3 pages

OS Sefa

An operating system (OS) is software that manages computer hardware and provides services for computer programs, including file, memory, and process management. It employs various scheduling algorithms to efficiently allocate CPU time to processes and supports multithreading for improved application performance. The document also discusses the evolution of operating systems, their functions, and the challenges they face, such as resource allocation and mutual exclusion.

Uploaded by

techzandgamez24
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/ 3

WHAT IS AN OS?

An operating system (OS) is a SCHEDULING ALGORITHMS  A Process Scheduler schedules BASIC CONCEPT OF THREAD  Thread is an execution unit SWAPPING  Swapping is a mechanism in which a process
collection of software that manages computer different processes to be assigned to the CPU based on which consists of its own program counter, a stack, and a can be swapped temporarily out of main memory (or move)
hardware resources and provides common services for particular scheduling algorithms.  These algorithms are set of registers  Threads are also known as Lightweight to secondary storage (disk) and make that memory available
computer programs . An Operating System (OS) is an either non-preemptive or preemptive 1.FIRST COME FIRST processes  Threads are popular way to improve application to other processes.  At some later time, the system swaps
interface between a computer user and computer SERVE (FCFS)  Jobs are executed on first come, first serve through parallelism.  The CPU switches rapidly back and back the process from the secondary storage to main
hardware . An operating system is a software which basis.  It is a non-preemptive scheduling algorithm.  Easy to forth among the threads giving illusion that the threads are memory.  It helps in running multiple and big processes in
performs all the basic tasks like file management, understand and implement.  Its implementation is based on running in parallel.  As each thread has its own parallel MULTIPROGRAMMING OS  Picks and begins to
memory management, process management, handling FIFO queue.  Poor in performance as average wait time is independent resource for process execution, multiple execute one job from memory.  Once this job needs an I/O
input and output, and controlling peripheral devices high.2 SHORTEST JOB NEXT (SJN)  This is also known as processes can be executed parallel by increasing number of operation os switches to another job  Jobs in the memory
such as disk drives and printers.DEFINITION OF OS An shortest job first, or SJF  This is a non-preemptive, threads. are always less than the number of jobs on disk(Job Pool)  If
operating system is a program that acts as an interface MULTITHREADING MODELS  Some operating system
scheduling algorithm.  Best approach to minimize waiting several jobs are ready to run at the same time, then system
between the user and the computer hardware and provide a combined user level thread and Kernel level chooses which one to run (CPU Scheduling).  In
time.  Easy to implement in Batch systems where required
controls the execution of all kinds of programs. thread facility  The user threads must be mapped to kernel
CPU time is known in advance.  Impossible to implement in Multiprogramming system, CPU will never be idle and keeps
OBJECTIVES OF OS Convenience: An OS makes a threads, by one of the following strategies. 1. Many-To-One
interactive systems where required CPU time is not known.  on processing.
computer more convenient to use.Efficiency: An OS Model 2. One-To-One Model 3. ManyTo-Many Model 1.TIME-SHARING OPERATING SYSTEMS  Time-sharing is a
The processer should know in advance how much time
allows the computer system resources to be used in an BENEFITS OF MULTITHREADING  Responsiveness  technique which enables many people, located at various
efficient manner. Ability to evolve: An OS should be process will take.3. PRIORITY BASED SCHEDULING  Priority
scheduling is a non-preemptive algorithm and one of the Resource sharing, hence allowing better utilization of terminals, to use a particular computer system at the same
constructed in such a way as to permit the resources.  Economy. Creating and managing threads
most common scheduling algorithms in batch systems.  time  Time-sharing or multitasking is a logical extension of
effective development, testing, and introduction of
Each process is assigned a priority. Process with highest becomes easier multiprogramming.  Processor's time which is shared
new system functions without interfering with service. CRITICAL SECTION SOFTWARE SOLUTION
FUNCTIONS OF AN OPERATING SYSTEM 1. Memory priority is to be executed first and so on.  Processes with among multiple users simultaneously is termed as time-
same priority are executed on first come first served basis.  1.PETERSON’S SOLUTION Two process solution The sharing.  Multiple jobs are executed by the CPU by
Management 2. Processor Management 3. Device two processes share two variables: int turn;
Priority can be decided based on memory requirements, switching between them, but the switches occur so
Management 4. File Management 5. Security 6.
time requirements or any other resource requirement.4. Boolean flag[2] The variable turn indicates whose frequently.  The operating system uses CPU scheduling and
Control over system performance 7. Job accounting 8. turn it is to enter the critical section. The flag array is
ROUND ROBIN SCHEDULING  Round Robin is the multiprogramming to provide each user with a small portion
Error detecting aids 9. Coordination between other
software and users1. MEMORY MANAGEMENT preemptive process scheduling algorithm.  Each process is
used to indicate if a process is ready to enter the of a time. Advantages :  Provides the advantage of quick
critical section. flag[i] = true implies that process Pi is response.  Avoids duplication of software.  Reduces CPU
Memory management refers to management of provided a fix time to execute, it is called a quantum.  Once
ready! CRITICAL SECTON SOFTWARE SOLUTION idle time. Disadvantages:  Problem of reliability.  Question
Primary Memory or Main Memory. Main memory a process is executed for a given time period, it is
2.BAKERY ALGORITHM This algorithm solves the of security and integrity of user programs and data. 
provides a fast storage that can be accessed directly by preempted and other process executes for a given time
critical section problem for n processes in software
the CPU. Keeps tracks of primary memory, i.e., what period.  Context switching is used to save states of Problem of data communication.
The basic idea is that of a bakery; customers take PARALLEL PROCESSING SYSTEMS  It is designed to speed
part of it are in use by whom, what part are not in use. preempted processes.5. SHORTEST REMAINING TIME 
numbers, and whoever has the lowest number gets
In multiprogramming, the OS decides which process preemptive version of the SJN algorithm.  The processor is service next Here, of course, "service" means entry to
up the execution of programs by dividing the program into
will get memory when and how much. Allocates the allocated to the job closest to completion but it can be multiple fragments and processing these fragments
the critical section.
memory when a process requests it to do so. Deallocates preempted by a newer ready job with shorter time to simultaneously.  Such systems are multiprocessor systems
iNDEXED SEQUENTIAL FILE  Indexed sequential files are
the memory when a process no longer needs completion.  Impossible to implement in interactive also known as tightly coupled systems  Parallel systems
important for applications where data needs to be
it or has been terminated. 2. PROCESSOR systems where required CPU time is not known.  It is often deal with the simultaneous use of multiple computer
accessed..... ฀ sequentially ฀ randomly using the index.  An resources that can include a single computer with multiple
MANAGEMENT In multiprogramming environment, used in batch environments where short jobs need to give indexed sequential file can only be stored on a random
the OS decides which process gets the processor when preference. PRE EMPTIVE SJN  jobs are put into ready processors,  a number of computers connected by a
access device e.g. magnetic disc, CD ADVANTAGES  network to form a parallel processing cluster or a
and for how much time This function is called process queue as they arrive, but as a process with short burst time Provides flexibility for users who need both type of accesses combination of both. ‘Flynn has classified the computer
scheduling. It includes: Keeps tracks of processor arrives, the existing process is pre-emptied.6. MULTIPLE-
with the same file  Faster than sequential Disadvantages  systems based on parallelism in the instructions and in the
and status of process. The program responsible for this LEVEL QUEUES SCHEDULING  Multiple-level queues are not Extra storage space for the index is required
task is known as traffic controller. Allocates the an independent scheduling algorithm.  They make use of data streams 1. Single instruction, single data stream - SISD
processor (CPU) to a process. De-allocates processor . CONTIGUOUS ALLOCATION  Each file occupies a 2. Single instruction, multiple data stream - SIMD 3. Multiple
other existing algorithms to group and schedule jobs
when a process is no longer required. 3. DEVICE contiguous address space on disk.  Assigned disk address is instruction, single data stream - MISD 4. Multiple
with common characteristics. ฀ Multiple queues are
MANAGEMENT Provides interface between in linear order.  Easy to implement.  Simple – only starting instruction, multiple data stream- MIMD
maintained for processes with common characteristics. ฀ location (block #) and length (number of blocks) are
connected devices. An Operating System manages Each queue can have its own scheduling algorithms. ฀ DISTRIBUTED OPERATING SYSTEMS  Use multiple central
device communication via their respective drivers It required  Files cannot grow  Contiguous allocation file is processors to serve multiple real-time applications and
Priorities are assigned to each queue.  For example, CPU- defined by ฀ Disk address& Length (in block units) of the
includes: Keeps tracks of all devices. Program bound jobs can be scheduled in one queue and all I/O- multiple users.  Data processing jobs are distributed among
responsible for this task is known as the I/O controller. block ฀ If file is n block long and starts at location b, then the processors accordingly.  The processors communicate
bound jobs in another queue  The Process Scheduler then
Decides which process gets the device when and for The blocks occupied are b, b+1, b+2…..b+n-1  External with one another through various communication lines
alternately selects jobs from each queue and assigns them
how much time. Allocates the device in the efficient
to the CPU based on the algorithm assigned to the queue. 7.
fragmentation is a major issue with this type of allocation (such as highspeed buses or telephone lines).  These are
way. De-allocates devices. technique. referred as loosely coupled systems or distributed systems. 
MULTILEVEL FEEDBACK QUEUE  In a multilevel queue-
4. FILE MANAGEMENT A file system is normally FREE-SPACE MANAGEMENT  Another important aspect of Processors in a distributed system may vary in size and
scheduling algorithm, processes are permanently assigned
organized into directories for easy navigation and disk management is keeping track of and allocating free function.  These processors are referred as sites, nodes,
to a queue on entry to the system.  Processes do not move
usage. It includes: Keeps track of information, space.  Need for free space management ฀ Limited amount computers, and so on. advantages:  With resource sharing
between queues.  Multilevel feedback queue scheduling,
location, uses, status etc. The collective facilities are of disk space ฀ Necessary to reuse the space from deleted facility, a user at one site may be able to use the resources
however, allows a process to move between queues  The
often known as file system. Decides who gets the files  BIT VECTOR  One simple approach is to use a bit available at another.  Speedup the exchange of data with
resources. Allocates the resources. De-allocates idea is to separate processes with different CPU- burst
vector, in which each bit represents a disk block, set to 1 if one another via electronic mail.  If one site fails in a
characteristics  If a process uses too much CPU time, it will
the resources. 5. Security: By means of password free or 0 if allocated..LINKED LIST  Link all free disk blocks distributed system, the remaining sites can potentially
be moved to a lower-priority queue  Similarly, a process
and similar other techniques, it prevents unauthorized together  Keep a pointer to the first free block  This block continue operating.  Better service to the customers. 
that waits too long in a lower- priority queue may be moved
access to programs and data Firewall 6. Control over contains a pointer to next free block, and so on  Cannot get Reduction of the load on the host computer
system performance: Recording delays between to a higher-priority queue
contiguous space easily &No waste of space GROUPING  A REAL TIME OPERATING SYSTEM  Defined as a data
request for a service and response from the system. 7. CLASSICAL PROBLEMS OF MUTUAL EXCLUSION. THE
BOUNDED BUFFER PROBLEM  a buffer which can store n
variation on linked list free lists is to use links of blocks of processing system  Here the time interval required to
Job accounting: Keeping track of time and resources indices of free blocks.  Store addresses of n free blocks in
items  a producer process which creates the items (1 at a process and respond to inputs is so small that it controls the
used by various jobs and users. 8. Error detecting aids: the first free block  The first n-1 of these are actually free 
time)  a consumer process which processes them (1 at a environment  The time taken by the system to respond to
Production of dumps, traces, error messages, and The last block contains the address as of another free
time)  A producer cannot produce unless there is an empty an input and display of required updated information is
other debugging and error detecting aids. 9. blocks, and so on  Large number of free blocks can be found
buffer slot to fill.  A consumer cannot consume unless there termed as the response time.  Response time is very less 
Coordination between other software's and users: quickly COUNTING  When there are multiple contiguous
is at least one produced item. 2. THE READERSWRITERS Used when there are rigid time requirements  must have
Coordination and assignment of compilers,
interpreters, assemblers and other software to the PROBLEM  A data item such as a file is shared among
blocks of free space then the system can keep track of the well-defined, fixed time constraints  EX: ฀ Scientific
starting address of the group and the number of contiguous experiments, medical imaging systems, .
various users of the computer systems. SERVICES several processes.  Each process is classified as either a PROCESS STATES As a process executes, it changes state Network Operating System – These systems run on a
PROVIDED BY AN OPERATING SYSTEM Program reader or writer.  Multiple readers may access the file New: The process is being created Running: Instructions server and provide the capability to manage data, users,
execution I/O operations File System manipulation simultaneously.  A writer must have exclusive access (i.e., are being executed Waiting: The process is waiting for groups, security, applications, and other networking
Communication Error Detection Resource Allocation cannot share with either a reader or another writer).  A some event to occur Ready: The process is waiting to be functions. These types of operating systems allow shared
Protection solution gives priority to either readers or writers ฀ readers' assigned to a processor Terminated: The process has access of files, printers, security, applications, and other
EVOLUTION OF OPERATING SYSTEMS  The evolution of priority: no reader is kept waiting unless a writer has finished execution Only one process is running and all other networking functions over a small private network. One
operating systems is directly dependent to the development already obtained permission to access the database ฀ processes are in ready or waiting. more important aspect of Network Operating Systems is
of computer systems and how users use them.  Evolution of writers' priority: if a writer is waiting to access the database, PROCESS CONTROL BLOCK PCB is a data structure in the that all the users are well aware of the underlying
OS is parallel to the evolution of the computer hardware  no new readers can start reading  A solution to either operating system kernel containing the information needed configuration, of all other users within the network, their
Early Evolution  1945: ENIAC, Moore School of Engineering, version may cause starvation ฀ in the readers' priority to manage a particular process. The PCB is a certain store individual connections, etc. and that’s why these computers
University of Pennsylvania.  1949: EDSAC and EDVAC  1949 version, writers may starve ฀ in the writers' priority version, that allows the operating systems to locate key information are popularly known as tightly coupled systems.
BINAC - a successor to the ENIAC  1951: UNIVAC by readers may starve 3. THE DINING PHILOSOPHERS about a process. Thus, the PCB is the data structure that SERIAL PROCESSING:  This mode of operation is turned as
Remington  1952: IBM 701  1956: The interrupt  1954- PROBLEM  n philosophers sit around a table thinking and defines a process to the operating systems. The PCB serial processing, reflecting the fact that users access the
1957: FORTRAN was developed.MESSAGE PASSING  In this eating  When a philosopher thinks she does not interact contains important information about the specific process computer in series.  Early computer from late 1940 to the
method, processes communicate with each other without with her colleagues.  Periodically, a philosopher gets hungry including Process State: The current state of the process mid 1950.  The programmer interacted directly with the
using any kind of shared memory  If two processes p1 and and tries to i.e., whether it is ready, running, waiting, or whatever. computer hardware.  These machine are called bare
p2 want to communicate with each other, they proceed as FUNCTIONS OF PROCESSOR MANAGEMENT  Keeps tracks Process Number: Unique identification of the process in
machine as they don't have OS.  Every computer system is
follow:  Establish a communication link (if a link already of processor and status of process  Allocates the processor order to track "which is which" information. Program
programmed in its machine language.  Uses Punch Card,
exists, no need to establish it again.)  Start exchanging (CPU) to a process.  De-allocates processor when a process Counter: This register stores the next
paper tapes and language translator  These system
messages using basic primitives.  We need at least two is no longer required.  process scheduling FILE PROTECTION  We have to keep the files safe from
presented two major problems. 1.Scheduling:  Used sign up
primitives: – send(message, destination) or send(message) – WHAT IS A PROCESS ??  A process is basically a program in physical damage and improper access  Protection can be
sheet to reserve machine time. A user may sign up for an
receive(message, host) or receive(message) execution.  The execution of a process must progress in a provided in many ways  File owner/creator should be able
hour but finishes his job in 45 minutes. This would result in
Theft of Service - Unauthorized use of resources and data, sequential fashion.  A process is defined as an entity which to control: ฀ what can be done ฀ by whom 1. Types of wasted computer idle time, also the user might run into the
such as theft of CPU cycles, installation of daemons running represents the basic unit of work to be implemented in the access  Read: Read from the file  Write: write or rewrite problem not finish his job in allotted time 2. Set up time: A
an unauthorized file server, or tapping into the target's system  When a program is loaded into the memory and it the file  Execute :Load the file into memory and execute it  single program involves: 1. Loading compiler and source
telephone or networking services. becomes a process, it can be divided into four sections ฀ Append : write new information at the end of the file  program in memory 2. Saving the compiled program (object
DEFINITION OF PROCESS A program in Execution is called Delete: Delete the file  List: list the name and attributes of
stack, ฀ heap, ฀ text and ฀ data PROCESS Stack:  contains code) 3. Loading and linking together object program and
process. A process is an instance of a computer program the file 2. Access Control  Mode of access: read, write,
the temporary data such as method/function parameters, common function
that is being executed. It contains the program code and its execute  Three classes of users  Owner: the user who
return address and local variables. Heap:  This is SEGMENTATION  Segmentation is a memory management
current activity. Depending on the operating system (OS), a create the file  Group: a set of user who are sharing the files
dynamically allocated memory to a process during its run technique in which each job is divided into several segments
process may be made up of multiple threads of execution and need similar access  Universe: All the other user in the
time Text:  This includes the current activity represented by of different sizes  Each segment is actually a different
that execute instructions concurrently. A program is a
the value of Program Counter and the contents of the system logical address space of the program.  Segmentation
passive entity while a process is an active entity.
processor's registers. Data:  This section contains the global memory management works very similar to paging but here
and static variables segments are of variable-length where as in paging pages
are of fixed size.
1.STATIC MEMORY ALLOCATION  Here primary memory is Authentication and Authorization • Authentication, in the •Authorization is usually coupled with authentication so batch systems • The idle time for the batch system is very
divide into partition at the boot time  Partition size may be form of a key. The lock on the door only grants access to that the server has some concept of who the client is that is less • It is easy to manage large work repeatedly in batch
equal or vary, but do not change later  The current partition someone with the correct key in much the same way that a requesting access. •The type of authentication required for systems Disadvantages • The computer operators should be
status and attributes are stored in a data structure called system only grants access to users who have the correct authorization may vary; passwords may be required in some well known with batch systems • Batch systems are hard to
partition description table  The memory wastage due to credentials. • Authorization, in the form of permissions. cases but not in others. •In some cases, there is no debug • It is sometimes costly • The other jobs will have to
static allocation is called internal fragmentation  Placement Once inside, the person has the authorization to access the authorization; any user may be use a resource or access a wait for an unknown time if any job fails, Examples of Batch
algorithm for partition allocation are: 1. First fit 2. Best fit 3. kitchen and open the cupboard that holds the pet food. The file simply by asking for it. Most of the web pages on the based Operating System: Payroll System, Bank Statements,
Worst fit 4. Next fit PLACEMENT ALGORITHM 1.FIRST FIT:  person may not have permission to go into the bedroom for Internet require no authentication or authorization 2. Time-Sharing Operating Systems – Each task is given
The first hole that is big enough is allocated to program a quick nap. threat is a program that is malicious in nature and leads to some time to execute so that all the tasks work smoothly.
2.BEST FIT:  The smallest hole that is big enough is PAGE REPLACEMENT Following steps can be taken to deal harmful effects for the system. Some of the common Each user gets the time of CPU as they use a single system.
allocated to program  Minimum memory wastage 3.WORST with the above problem :  Put the process in the wait threats that occur in a system are − Virus Viruses are These systems are also known as Multitasking Systems. The
FIT:  The largest hole that is big enough is allocated to queue, until any other process finishes its execution thereby generally small snippets of code embedded in a system. task can be from a single user or different users also. The
program  Cause maximum memory wastage 4.NEXT FIT:  freeing frames.  Or, remove some other process completely They are very dangerous and can corrupt files, destroy data, time that each task gets to execute is called quantum. After
variation of first fit  Searching for hole start from previous from the memory to free frames.  Or, find some pages that crash systems etc. They can also spread further by this time interval is over OS switches over to the next task.
are not being used right now, move them to the disk to get replicating themselves as required. Trojan Horse A trojan Advantages of Time-Sharing OS: • Each task gets an equal
allocation 2.DYNAMIC MEMORY ALLOCATION  When
free frames. This technique is called Page replacement and horse can secretly access the login details of a system. Then opportunity • Fewer chances of duplication of software •
system is initialize, the primary memory is configured as
is most commonly used. We have some great algorithms to a malicious user can use these to enter the system as a CPU idle time can be reduced Disadvantages of Time-
single large plot of free memory  The allocation is done
carry on page replacement efficiently.BASIC PAGE harmless being and wreak havoc. Trap Door A trap door is a Sharing OS: • Reliability problem • One must have to take
dynamically  When the process is removed from the
REPLACEMENT  Find the location of the page requested by security breach that may be present in a system without the care of the security and integrity of user programs and data
memory the block is added to a pool of free space  The • Data communication problem Examples of Time-Sharing
ongoing process on the disk.  Find a free frame. If there is a knowledge of the users. It can be exploited to harm the data
wastage of memory associated with dynamic memory is or files in a system by malicious people. Worm A worm can OSs are: Multics, Unix, etc. 3. Distributed Operating System
free frame, use it. If there is no free frame, use a page-
External fragmentation  OS can move all the small free destroy a system by using its resources to extreme levels. It – These types of the operating system is a recent
replacement algorithm to select any existing frame to be
space to a large single apace called Compaction can generate multiple copies which claim all the resources advancement in the world of computer technology and are
replaced, such frame is known as victim frame.  Write the
PAGING  A solution to fragmentation problem is Paging  and don't allow any other processes to access them. A being widely accepted all over the world and, that too, with
victim frame to disk. Change all related page tables to
Paging is a memory management mechanism that allows worm can shut down a whole network in this way. a great pace. Various autonomous interconnected
indicate that this page is no longer in memory.  Move the
the physical address space of a process to be non Logical Address is generated by CPU while a program is computers communicate with each other using a shared
required page and store it in the frame. Adjust all related
contagious  With Paging, Physical memory is broken into running. The logical address is virtual address as it does not communication network. Independent systems possess
page and frame tables to indicate the change.  Restart the
fixed-sized blocks called frames  Logical memory is also exist physically, therefore, it is also known as Virtual their own memory unit and CPUremote access is enabled
process that was waiting for this page. PAGE REPLACEMENT
broken into blocks of the same size called pages  When a Address. This address is used as a reference to access the within the devices connected in that network. Advantages
ALGORITHMS 1.RANDOM REPLACEMENT  A page is
process is to be executed, its pages are loaded into any physical memory location by CPU. The term Logical Address o• Failure of one will not affect the other network
randomly selected and replaced  Main disadvantage is that
available memory frames from the backing store. PAGING Space is used for the set of all logical addresses generated communication, as all systems are independent from each
it may be replaced currently using page 2. FIRST IN FIRST
Address Translation  Page address is called logical address by a program’s perspective. other • Electronic mail increases the data exchange speed •
OUT (FIFO) ALGORITHM  Oldest page in main memory is
and represented by page number and the offset  Frame Physical address identifies a physical location of required Since resources are being shared, computation is highly fast
the one which will be selected for replacement.  Easy to
address is called physical address and represented by a data in a memory. The user never directly deals with the and durable • Load on host computer reduces • These
implement, keep a list, replace pages from the tail and add
frame number and the offset. physical address but can access by its corresponding logical systems are easily scalable as many systems can be easily
new pages at the head.3.OPTIMAL PAGE ALGORITHM  An
ADVANTAGES AND DISADVANTAGES OF PAGING  Paging address. The user program generates the logical address added to the network • Delay in data processing reduces
optimal page-replacement algorithm has the lowest page-
reduces external fragmentation, but still suffer from internal and thinks that the program is running in this logical address Disadvantage: • Failure of the main network will stop the
fault rate of all algorithms. An optimal page-replacement
fragmentation.  Paging is simple to implement and assumed but the program needs physical memory for its execution, entire communication • To establish distributed systems the
algorithm exists, and has been called OPT or MIN.  Replace language which is used are not well defined yet • These
as an efficient memory management technique.  Due to therefore, the logical address must be mapped to the
the page that will not be used for the longest period of time. physical address by MMU before they are used. types of systems are not readily available as they are very
equal size of the pages and frames, swapping becomes very
Use the time when a page is to be used.4.LEAST RECENTLY
easy.  Page table requires extra memory space, so may not overlay in operating system? The concept of overlays is that expensive. Not only that.
USED (LRU) ALGORITHM  Page which has not been used for whenever a process is running it will not use the complete OVERLAYS Overlaying means "the process of transferring a
be good for a system having small RAM.
the longest time in main memory is the one which will be
VIRTUAL MEMORY  A computer can address more memory program at the same time, it will use only some part of block of program code or other data into internal memory,
selected for replacement.  Easy to implement, keep a list,
than the amount physically installed on the system.  This it.Then overlays concept says that whatever part you replacing what is already stored". Overlaying is a technique
replace pages by looking back into time. required, you load it an once the part is done, then you just that allows programs to be larger than the computer's main
extra memory is actually called virtual memory and it is a
THRASHING If the number of page faults is equal to the unload it, means just pull it back and get the new part you memory. An embedded would normally use overlays
section of a hard disk that's set up to emulate the
number of referred pages or the number of page faults are required and run it. because of the limitation of physical memory which
computer's RAM.  The main visible advantage of this
so high so that the CPU remains busy in just reading the What is a Shell, and Why do we need them? Whenever a is internal memory for a system-on-chip and the lack of
scheme is that programs can be larger than physical
pages from the secondary memory then the effective access user logs in to the system or opens a console window, the virtual memory facilities. Overlaying requires the
memory.  Virtual memory serves two purposes. time will be the time taken by the CPU to read one word
WHAT IS A DEADLOCK?  Deadlock is a situation where a set kernel runs a new shell instance. The kernel is the heart of programmers to split their object code to into multiple
from the secondary memory and it will be so high. The any operating system. It is responsible for the control completely-independent sections, and the overlay manager
of processes are blocked because each process is holding a concept is called thrashing. If the page fault rate is PF %, the
resource and waiting for another resource acquired by management, and execution of processes, and to ensure that linked to the code will load the required overlay
time taken in getting a page from the secondary memory proper utilization of system resources. A shell is a program dynamically & will swap them when necessary. This
some other process. Consider an example when two trains and again restarting is S (service time) and the memory
are coming toward each other on the same track and there that acts as an interface between a user and the kernel. It technique requires the programmers to specify which
access time is ma then the effective access time can be allows a user to give commands to the kernel and receive overlay to load at different circumstances. The concept of
is only one track, none of the trains can move once they are given as;"EAT = PF X S + (1 - PF) X (ma) HOW TO DEAL WITH
in front of each other. A similar situation occurs in operating responses from it. Through a shell, we can execute overlays is that whenever a process is running it will not use
THRASHING?  If a single process is too large for memory, programs and utilities on the kernel. Hence, at its core, a the complete program at the same time, it will use only
systems when there are two or more processes that hold there is nothing the OS can do. That process will simply
some resources and wait for resources held by other(s). For shell is a program used to execute other programs on our some part of it. Then overlays concept says that whatever
thrash.  If the problem arises because of the sum of several system. part we required, we load it an once the part is done, then
example, in the below diagram, Process 1 is holding
processes: 1. Figure out how much memory each process Unix File System Commands #1) touch: Create a new file or we just unload it, means just pull it back and get the new
Resource 1 and waiting for resource 2 which is acquired by
process 2, and process 2 is waiting for resource 1
needs. 2. Change scheduling priorities to run processes in update its timestamp. • Syntax: touch [OPTION]…[FILE] • part we required and run it. Formally, “The process of
DEADLOCK CHARACTERIZATION  Mutual exclusion: only
groups that fit comfortably in memory: must shed load Example: Create empty files called ‘file1’ and ‘file2’ • $ transferring a block of program code or other
Authentication is the act of validating that users are whom touch file1 file2 #2) cat: Concatenate files and print to data into internal memory, replacing what is already
one process at a time can use a resource.  Hold and wait: a they claim to be. This is the first step in any security process. stdout. • Syntax: cat [OPTION]…[FILE] • Example: Create stored”. Sometimes it happens that compare to the size of
process holding at least one resource is waiting to acquire Giving someone permission to download a particular file on file1 with entered cotent • $ cat > file1 • Hello • ^D #3) cp: the biggest partition,
additional resources held by other processes.  No a server or providing individual users with administrative Copy files • Syntax: cp [OPTION]source destination • Standard Swapping Standard swapping involves moving
preemption: a resource can be released only voluntarily by access to an application are good examples of Example: Copies the contents from file1 to file2 and processes between main memory and a backing store. The
the process holding it, after that process has completed its authentication. Complete an authentication process contents of file1 is retained • $ cp file1 file2 #4) mv: Move backing store is commonly a fast disk. It must be large
task.  Circular wait: there exists a set {P0 , P1 , …, P0 } of through: • Passwords. Usernames and passwords are the files or rename files • Syntax: mv [OPTION]source enough to accommodate copies of all memory images for all
waiting processes such that P0 is waiting for a resource that most common authentication factors. If a user enters the destination • Example: Create empty files called ‘file1’ and users, and it must provide direct access to these memory
is held by P1 , P1 is waiting for a resource that is held by P2 , correct data, the system assumes the identity is valid and ‘file2’ images. The system maintains a ready queue consisting of
…, Pn–1 is waiting for a resource that is held by Pn , and P0 grants access. • One-time pins. Grant access for only one multi processor OS Definition – Multiprocessor operating all processes whose memory images are on the backing
is waiting for a resource that is held by P0 . Deadlock can session or transaction. • Authentication apps. Generate system allows the multiple processors, and these processors store or in memory and are ready to run. Whenever the CPU
arise if four conditions hold simultaneously. security codes via an outside party that grants access. • are connected with physical memory, computer buses, scheduler decides to execute a process, it calls the
HANDLING DEADLOCK : Preemption: We can take a Biometrics. A user presents a fingerprint or eye scan to gain clocks, and peripheral devices. Main objective of using dispatcher. The dispatcher checks to see whether the next
resource from one process and give it to other. This will access to the system. In some instances, systems require multiprocessor operating system is to consume high process in the queue is in memory. If it is not, and if there is
resolve the deadlock situation, but sometimes it does the successful verification of more than one factor before computing power and increase the execution speed of no free memory region, the dispatcher swaps out a process
causes problems.  Rollback: In situations where deadlock is granting access. This multi-factor authentication (MFA) system. currently in memory and swaps in the desired process. It
a real possibility, the system can periodically make a record requirement is often deployed to increase security beyond multiprogramming and multitasking operating system then reloads registers and transfers control to the selected
of the state of each process and when deadlock occurs, roll what passwords alone can provide Multitasking means concurrent execution of multiple process.
everything back to the last checkpoint, and restart, but PRINCIPLES OF CONCURRENCY Concurrency is the tendency processes by one user on the same computer utilizing Features of Mobile Operating System1. Easy to useThe
allocating resources differently so that deadlock does not for things to happen at the same time in a system. It also multiple CPUs. Multiprogramming is the ability for more graphics should be attractive.The buttons and features
occur.  Kill one or more process: This is the simplest way, refers to techniques that make program more usable. than one user to use the computer at a time using a single should be easy to use. moreover, the functionalities should
but it works Concurrency can be implemented and is used a lot on single CPU. The idea is to effectively utilize the processor to create not be very complicated.Features should be powerful and
TRATEGIES FOR HANDLING DEADLOCKS 1. Deadlock processing units, nonetheless it may benefit from multiple multiple ready-to-run processes with each process belongs useful.2. Good app store An app is one of the basic part of
prevention: Prevents deadlocks by restraining requests processing units with respect to speed. If an operating to different user an OS.Good and useful apps forms an important part of an
made to ensure that at least one of the four deadlock system is called a multi-tasking operating system, this is a ADDRESS BINDING Usually, a program resides on a disk as a OS. The apps should be simple and interactive.3. Good
conditions cannot occur. 2. Deadlock avoidance: synonym for supporting concurrency. If we can load binary executable file. To be executed, the program must be battery lifePower is one of the main requirement of a
Dynamically grants a resource to a process if the resulting multiple documents simultaneously in the tabs of our brought into memory and placed within a process. Smartphone.They require power for processors sensors etc.
state is safe. A state is safe if there is at least one execution browser and we can still open menus and perform more Depending on the memory management in use, the process Therefore, the battery holds a very important role.
sequence that allows all processes to run to completion. 3. actions, this is concurrency. If we run distributed-net may be moved between disk and memory during its Smartphone's power usage keeps on increasing therefore, a
Deadlock detection and recovery: Allows deadlocks to form; computations in the background, that is concurrency. execution. The processes on the disk that are waiting to be good battery backup is very essential.
then finds and breaks them. SWAPPING A process must be in memory to be executed. A brought into memory for execution form the input queue. ANDROID Android is a mobile operating system based on a
DEADLOCK DETECTION 1.If resources have single instance:  process, however, can be swapped temporarily out of The normal single-tasking procedure is to select one of the modified version of the Linux kernel and other open source
In this case for Deadlock detection we can run an algorithm memory to a backing storeand then brought back into processes in the input queue and to load that process into software, designed primarily for touch screen mobile
to check for cycle in the Resource Allocation Graph. memory for continued execution (Figure 5). Swapping memory. As the process is executed, it accesses instructions devices such as smart phones and tablets. It is an operating
Presence of cycle in the graph is the sufficient condition for makes it possible for the total physical address space of all and data from memory. Eventually, the process terminates, system for low powered devices that run on battery and
deadlock  In the above diagram, resource 1 and resource 2 processes to exceed the real physical memory of the and its memory space is declared available. are full of hardware like Global Positioning System (GPS)
have single instances. There is a cycle R1–>P1– >R2–>P2. So system, thus increasing the degree of multiprogramming in receivers, cameras, light and orientation sensors, Wi-Fi and
Deadlock is Confirmed. a system types of operating system 1. Batch Operating System – This LTE (4G telephony) connectivity and a touch screen. Like all
Authorization is the process of giving someone permission type of operating system does not interact with the operating systems, Android enables applications to make
DEADLOCK RECOVERY  Once a deadlock is detected, you to do or have something. In multi-user computer systems, a computer directly. There is an operator which takes similar use of the hardware features through abstraction and
will have to break the deadlock  It can be done through system administrator defines for the system which users are jobs having the same requirement and group them into provide a defined environment for applications. The study
different ways 1. Aborting(killing) one or more processes to allowed access to the system and what privileges of use batches. It is the responsibility of the operator to sort jobs includes following topic: Background And History Android
break the circular wait condition causing the deadlock 2. (such as access to which file directories, hours of access, with similar needs. Advantages • It is very difficult to guess Architecture Kernel And StartUp Process Management
preempting resources from one or more processes which amount of allocated storage space, and so forth). or know the time required for any job to complete. Deadlock CPU Scheduling Memory Management Storage
are deadlocked. preempted resources are allocated to other •Authorization is a process by which a server determines if Processors of the batch systems know how long the job Management I/O Battery Optimization
processes. the client has permission to use a resource or access a file. would be when it is in queue • Multiple users can share the
WINDOWS NTWindows NT now refers to a family of Unix Architecture he Unix operating system is a set of Types of Shells in Linux 1. The Bourne Shell (sh) Developed
Microsoft operating systems, all based on the original programs that act as a link between the computer and the at AT&T Bell Labs by Steve Bourne, the Bourne shell is
Windows NT released in 1993. All Windows operating user. The computer programs that allocate the system regarded as the first UNIX shell ever. It is denoted as sh. It
systems since (XP, Vista, 7, etc.) are based on the NT kernel. resources and coordinate all the details of the computer's gained popularity due to its compact nature and high
The Windows NT kernel is considered a hybrid kernel, and is internals is called the operating system or the kernel. Users speeds of operation. This is what made it the default shell
also sometimes called a microkernel. Although most system communicate with the kernel through a program known as for Solaris OS. It is also used as the default shell for all
components run in the same address space, some the shell. The shell is a command line interpreter; Solaris system administration scripts.
subsystems run as user-mode server processes and many The main concept that unites all the versions of Unix is the 2. The GNU Bourne-Again Shell (bash) More popularly
of the design objectives are the same as Mach. following four basics − • Kernel − The kernel is the heart of known as the Bash shell, the GNU Bourne-Again shell was
. What is semaphore? Explain its implementation. the operating system. It interacts with the hardware and designed to be compatible with the Bourne shell. It
Semaphore was proposed by Dijkstra in 1965 which is a very most of the tasks like memory management, task scheduling incorporates useful features from different types of shells in
significant technique to manage concurrent processes by and file management. • Shell − The shell is the utility that Linux such as Korn shell and C shell. It allows us to
using a simple integer value, which is known as a processes your requests. When you type in a command at automatically recall previously used commands and edit
semaphore. Semaphore is simply a variable which is non- your terminal, the shell interprets the command and calls them with help of arrow keys, unlike the Bourne shell. The
negative and shared between threads. This variable is used the program that you want. The shell uses standard syntax complete path-name for the GNU Bourne-Again shell is
to solve the critical section problem and to achieve process for all commands. C Shell, Bourne Shell and Korn Shell are /bin/bash. By default, it uses the prompt bash-
synchronization in the multiprocessing environment. the most famous shells which are available with most of the VersionNumber# for the root user and bash-
Semaphores are of two types:1. Binary Semaphore – This is Unix variants. • Commands and Utilities − There are various VersionNumber$ for the non-root users.
also known as mutex lock. It can have only two values – 0 commands and utilities which you can make use of in your 3. The C Shell (csh) The C shell was created at the University
and 1. Its value is initialized to 1. It is used to implement the day to day activities. cp, mv, cat and grep, etc. are few of California by Bill Joy. It is denoted as csh. It was
solution of critical section problem with multiple processes. examples of commands and utilities. There are over 250 developed to include useful programming features like in-
2. Counting Semaphore – Its value can range over an standard commands plus numerous others provided built support for arithmetic operations and a syntax similar
unrestricted domain. It is used tocontrol access to a through 3rd party software. All the commands come along to the C programming language. Further, it incorporated
resource that has multiple instances with various options. • Files and Directories − All the data of command history which was missing in different types of
SEMEPHORES PROPERTIES 1. Simple 2. Works with many Unix is organized into files. All files are then organized into shells in Linux like the Bourne shell. Another prominent
processes 3. Can have many different critical sections with directories. These directories are further organized into a feature of a C shell is “aliases”. The complete path-name for
different semaphores 4. Each critical section has unique tree-like structure called the filesystem the C shell is /bin/csh. By default, it uses the prompt
access semaphores 5. Can permit multiple processes into What are the goals of system protection • Obviously to hostname# for the root user and hostname% for the non-
the critical section at once, if desirable. SEMAPHORES TYPES prevent malicious misuse of the system by users or root users.
Semaphores are mainly of two types: 1. Binary Semaphore programs. • To ensure that each shared resource is used 4. The Korn Shell (ksh) The Korn shell was developed at
฀It is a special form of semaphore used for implementing only in accordance with system policies, which may be set AT&T Bell Labs by David Korn, to improve the Bourne shell.
mutual exclusion, hence it is often called Mutex. A binary either by system designers or by system administrators. • It is denoted as ksh. The Korn shell is essentially a superset
semaphore is initialized to 1 and only takes the value 0 and To ensure that errant programs cause the minimal amount of the Bourne shell. Besides supporting everything that
1 during execution of a program. 2. Counting Semaphores of damage possible would be supported by the Bourne shell, it provides users
฀These are used to implement bounded concurrency. ฀It features of mobile OS • Compatibility With Different with new functionalities. It allows in-built support for
may have value 0,1,2…..n Hardware • Ease of use • Apps • Sensors • Stable arithmetic operations while offering interactive features
Process Synchronization Process Synchronization is the task Performance on Various Devices • Absence of Bugs • which are similar to the C shell. The Korn shell runs scripts
of coordinating the execution of processes in a way that no Flexibility and Adaptability • Possibilities for Personalization made for the Bourne shell, while offering string, array and
two processes can have access to the same shared data and • Support of Cutting-Edge Technologies • Handy Software function manipulation similar to the C programming
resources. ... So the change made by one process not Installed From the Get-Go • Convenient Environment for language. It also supports scripts which were written for the
necessarily reflected when other processes accessed the Developers • Abundance of Applications and Games • User C shell. Further, it is faster than most different types of
same shared data. On the basis of synchronization, Support and Updates shells in Linux, including the C shell. The complete path-
processes are categorized as one of the following two iOS The iOS is the operating system created by Apple Inc. name for the Korn shell is /bin/ksh. By default, it uses the
types: Independent Process : Execution of one process does for mobile devices. The iOS is used in many of the mobile prompt # for the root user and $ for the non-root users.
not affects the execution of other processes. Cooperative devices for apple such as iPhone, iPod, iPad etc. The iOS is 5. The Z Shell (zsh) The Z Shell or zsh is a sh shell extension
Process : Execution of one process affects the execution of used a lot and only lags behind Android in terms of with tons of improvements for customization. If you want a
other processes. Process synchronization problem arises in popularity. The iOS architecture is layered. It contains an modern shell that has all the features a much more, the zsh
the case of Cooperative process also because resources are intermediate layer between the applications and the shell is what you’re looking for Some noteworthy features
shared in Cooperative processes hardware so they do not communicate directly. The lower of the z shell include: • Generate filenames based on given
Classical Problems in Synchronization Bounded Buffer layers in iOS provide the basic services and the higher layers conditions • Plugins and theming support • Index of built-in
(Producers and Consumers) This problem is also called the provide the user interface and sophisticated graphics. functions • Command completion • and many more…
Producers and Consumers problem. A finite supply of Page fault? If the referred page is not present in the main
containers is available. Producers take an empty container memory, then there will be a miss and the concept is called
and fill it with a product. Consumers take a full container, Page miss or page fault. The CPU has to access the missed
consume the product and leave an empty container. The page from the secondary memory. If the number of page
main complexity of this problem is that we must maintain fault is very high then the effective access time of the
the count for both the number of empty and full containers system will become very high.
that are available. Readers and Writers. If one notebook memory management Computer memory can be defined as
exists where writers may write information to, only one a collection of some data represented in the binary format.
writer may write at a time. Confusion may arise if a reader is Linker Linker is a program in a system which helps to link a
trying read at the same as a writer is writing. Since readers object modules of program into a single object file. It
only look at the data, but do not modify the data, we can performs the process of linking. Linker is also called link
allow more than one reader to read at the same time. The editors. Linking is process of collecting and maintaining
main complexity with this problems stems from allowing piece of code and data into a single file. Linking is of two
more than one reader to access the data at the same time types: 1. Static Linking – It is performed during the
Race Condition When more than one processes are compilation of source program. Linking is performed before
executing the same code or accessing the same memory or execution in static linking. It takes collection of relocatable
any shared variable in that condition there is a possibility object file and command-line argument and generate fully
that the output or the value of the shared variable is wrong linked object file that can be loaded and run. 2. Dynamic
so for that all the processes doing the race to say that my linking – Dynamic linking is performed during the run time.
output is correct this condition known as a race condition. Loader Whereas main objective of Loader is to executable
Several processes access and process the manipulations files to main memory. And the loader takes input of
xover the same data concurrently, then the outcome executable files generated by linker. Loading can be defined
depends on the particular order in which the access takes as process of loading executable codes to main memory for
place further execution. It helps in allocating the address to
Dinning Philosophers Five philosophers (the tasks) spend executable codes/files.
their time thinking and eating spaghetti. They eat at a round Throughput: The number of processes that finish their
table with five individual seats. To eat, each philosopher execution per unit time is known Throughput. So, when the
needs two forks (the resources). There are five forks on the CPU is busy executing the process, at that time, work is
table, one to the left and one to the right of each seat. being done, and the work completed per unit time is called
When a philosopher can not grab both forks, he sits and Throughput
waits. Eating takes random time, then the philosopher puts Waiting time is an amount that specific process needs to
the forks down and leaves the dining room. After spending wait in the ready queue. 11.Define Response time Response
some random time thinking about the nature of the time: It is an amount to time in which the request was
universe, he again becomes hungry, and the circle repeats submitted until the first response is produced.
itself Turnaround Time: Turnaround time is an amount of time to
COUNTING ALGORITHMS Keep a counter of the number of execute a specific process. It is the calculation of the total
references that have been made to each page LFU time spent waiting to get into the memory, waiting in the
Algorithm: replaces page with smallest count MFU queue and, executing on the CPU. The period between the
Algorithm: based on the argument that the page with the time of process submission to the completion time is the
smallest count was probably just brought in and has yet to turnaround time.
be used 5. LEAST FREQUENTLY USED(LFU) ALGORITHM which Linux command is used to remove an empty
The page with the smallest count is the one which will be directory 1. To remove an empty directory, use either rmdir
selected for replacement. This algorithm suffers from the or rm -d followed by the directory name: rm -d dirname
situation in which a page is used heavily during the rmdir dirname. 2. To remove non-empty directories and all
initial phase of a process, but then is never used again. the files within them, use the rm command with the -r
6. MOST FREQUENTLY USED(MFU) ALGORITHM This (recursive) option: rm -r dirname
algorithm is based on the argument that the page with .what is the default umask value in linux
the smallest count was probably just brought in and Octal umask Mode 022 And 002
has yet to be used. 1. The default umask 002 used for normal user. With this
Dispatch Latency.? The time taken by the dispatcher to stop mask default directory permissions are 775 and default file
one process and start another process is known as the permissions are 664. 2. The default umask for the root user
Dispatch Latency is 022 result into default directory permissions are 755 and
default file permissions are 644. 3. For directories, the base
permissions are (rwxrwxrwx) 0777 and for files they are
0666 (rw-rw rw). In short

You might also like