Ilovepdf Merged

Download as pdf or txt
Download as pdf or txt
You are on page 1of 70

OPERATING SYSTEM

APPLICATIONS
IT 11
PRELIMS
❖ O p er a t i ng Sys t e ms O v e r v i e w
❖ Pr o ces s Ma n age me n t
❖ Memo r y Ma n ag e me nt
❖ St o r a g e Ma n age me nt
❖ Pr o t ect i o n & S e c ur i t y
VISION
The leading University in human resource development, knowledge
and technology generation and environmental stewardship

MISSION
The University of Rizal System is committed to nurture and produce
upright and competent graduates and empowered community
through relevant and sustainable higher professional and technical
instruction, research, extension and production services.
GOALS CORE VALUES
Quality and Excellence
Relevance and R – Responsiveness
Responsiveness I – Integrity
Access and Equity S – Service
Efficiency and Effectiveness E – Excellence
S – Social Responsibility
College Goals
College of Computer Studies commits itself in the pursuit of excellence, provides Information Technology methodologies in the
advancement of students’ innovativeness, creativity, and competencies as they foster their values in the service of men.

Bachelor of Science in Information Technology


Program Objectives
• Develop their utmost professional competence in all applications of Information Technology in response to the demands of
modern time.
• Realize the essential contribution of IT in business economics and related industries.
• Adhere themselves in the sense of professional values and ethics as they respond and advance themselves in the demands
of the present time.

Bachelor of Science in Information System


Program Objectives
• Develop their utmost professional competence in all applications of Information Systems in response to the demands of
modern time.
• Apprehend the fundamental contribution of IS in web-market and related industries.
• Instill in them the significance of research and community services as tools for human advancement and empowerment.
Develop their utmost professional competence in all applications of Information Technology in response to the demands of
modern time.
Operating System Overview

• What is an OPERATING SYSTEM?


• It is a software that manages a computer’s hardware. It also provides a basis for application
programs and acts as an intermediary between the computer user and the computer hardware.

• Operating system goals:


• To make the computer system convenient to use in an efficient manner.
• To hide the details of the hardware resources from the users.
• To provide users a convenient interface to use the computer system.
• To act as an intermediary between the hardware and its users, making it easier for the users to
access and use other resources.
• To manage the resources of a computer system.
• To keep track of who is using which resource, granting resource requests, and mediating
conflicting requests from different programs and users.
• To provide efficient and fair sharing of resources among users and programs.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Operating System Overview

• What OPERATING SYSTEMS do?


• We begin our discussion by looking at the operating system’s role in the overall
computer system. A computer system can be divided roughly into four components:
the hardware, the operating system, the application programs, and a user.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Operating System Overview

• Computer system can be divided into four components:


• Hardware – provides basic computing resources
• CPU, memory, I/O devices
• Operating system
• Controls and coordinates use of hardware among various applications and users
• Application programs – define the ways in which the system resources are used to
solve the computing problems of the users
• Word processors, compilers, web browsers, database systems, video games
• Users
• People, machines, other computers

To understand more fully the operating system’s role, we next explore operating systems from two
viewpoints: that of the user and that of the system.
IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Operating System Overview
• User View
• The user’s view of the computer varies according to the interface being used. Many
computer users sit with a laptop or in front of a PC consisting of a monitor, keyboard, and
mouse. Such a system is designed for one user to monopolize its resources. The goal is to
maximize the work (or play) that the user is performing. In this case, the operating system is
designed mostly for ease of use, with some attention paid to performance and security and
none paid to resource utilization how various hardware and software resources are shared.
• Increasingly, many users interact with mobile devices such as smartphones and tablet
devices that are replacing desktop and laptop computer systems for some users.
• The user interface for mobile computers generally features a touch screen, where the user interacts
with the system by pressing and swiping fingers across the screen rather than using a physical keyboard
and mouse.
• Many mobile devices also allow users to interact through a voice recognition interface, such as Apple’s
Siri.
• Some computers have little or no user view. For example, embedded computers in home devices and
automobiles may have numeric keypads and may turn indicator lights on or off to show status, but they
and their operating systems and applications are designed primarily to run without user intervention.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Operating System Overview

• System View
• From the computer’s point of view, the operating system is the program most
intimately involved with the hardware. In this context, we can view an operating
system as a resource allocator. A computer system has many resources that may be
required to solve a problem: CPU time, memory space, storage space, I/O devices,
and so on. The operating system acts as the manager of these resources. Facing
numerous and possibly conflicting requests for resources, the operating system
must decide how to allocate them to specific programs and users so that it can
operate the computer system efficiently and fairly. A slightly different view of an
operating system emphasizes the need to control the various I/O devices and user
programs. An operating system is a control program. A control program manages
the execution of user programs to prevent errors and improper use of the computer.
It is especially concerned with the operation and control of I/O devices.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Operating System Overview

• Computer System Organization


• A modern general-purpose computer system consists of
one or more CPUs and a number of device controllers
connected through a common bus that provides access
between components and shared memory. Each device
controller is in charge of a specific type of device (for
example, a disk drive, audio device, or graphics display).
Depending on the controller, more than one device may
be attached. Typically, operating systems have a device
driver for each device controller. This device driver
understands the device controller and provides the rest of
the operating system with a uniform interface to the
device. The CPU and the device controllers can execute in
parallel, competing for memory cycles. To ensure orderly
access to the shared memory, a memory controller
synchronizes access to the memory.
IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Operating System Overview

• Computer System Architecture


• A computer system can be organized in a number of different ways, which we can categorize
roughly according to the number of general-purpose processors used. Single Processor System;
Multiprocessor System; Clustered System.
• Single Processor System
• Many years ago, most computer systems used a single processor containing one CPU with a single
processing core. The core is the component that executes instructions and registers for storing
data locally. The one main CPU with its core is capable of executing a general-purpose instruction
set, including instructions from processes. These systems have other special-purpose processors
as well. They may come in the form of device-specific processors, such as disk, keyboard, and
graphics controllers. All of these special-purpose processors run a limited instruction set and do
not run processes. Sometimes, they are managed by the operating system, in that, the operating
system sends them information about their next task and monitors their status. For example, a
disk-controller microprocessor receives a sequence of requests from the main CPU core and
implements its own disk queue and scheduling algorithm. This arrangement relieves the main CPU
of the overhead of disk scheduling. PCs contain a microprocessor in the keyboard to convert the
keystrokes into codes to be sent to the CPU. In other systems or circumstances, special-purpose
processors are low-level components built into the hardware.
IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Operating System Overview

• Multiprocessor Systems
• Multiprocessors systems are growing in use and importance. Also known as parallel systems,
tightly-coupled systems

• Advantages include:
• Increased throughput
• Economy of scale
• Increased reliability – graceful degradation or fault tolerance

• Two types:
• The most common multiprocessor systems use symmetric multiprocessing (SMP), in which each
peer CPU processor performs all tasks, including operating-system functions and user processes.
• multiprocessor has evolved over time and now includes multicore systems, in which multiple
computing cores reside on a single chip. Multicore systems can be more efficient than multiple
chips with single cores.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Operating System Overview

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Operating System Overview

• Clustered System
• Like multiprocessor systems, but multiple systems
working together
• Usually sharing storage via a storage-area network
(SAN)
• Provides a high-availability service which survives
failures
• Asymmetric clustering has one machine in hot-standby
mode
• Symmetric clustering has multiple nodes running
applications, monitoring each other
• Some clusters are for high-performance computing
(HPC)
• Applications must be written to use parallelization
• Some have distributed lock manager (DLM) to avoid
conflicting operations

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Operating System Overview

• Mobile OS
• A mobile operating system (OS) is software that allows smartphones, tablet PCs (personal computers) and
other devices to run applications and programs. A mobile OS typically starts up when a device powers on,
presenting a screen with icons or tiles that present information and provide application access. Mobile
operating systems also manage cellular and wireless network connectivity, as well as phone access.

• Types of mobile operating systems


• There are numerous mobile device operating systems available today, and two of the most widely adopted
are the iPhone's OS, Apple iOS, and Google's open source OS, Google Android. These two mobile OSes take
different approaches to the mobile operating system.

https://www.youtube.com/watch?v=rMTDVK0Zb2k
IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

• What is Process Management?


• Process management involves various tasks like creation, scheduling, termination of processes,
and a dead lock. Process is a program that is under execution, which is an important part of
modern-day operating systems. The OS must allocate resources that enable processes to share
and exchange information. It also protects the resources of each process from other methods and
allows synchronization among processes.
• It is the job of OS to manage all the running processes of the system. It handles operations by
performing tasks like process scheduling and such as resource allocation.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

• What is a Process?
• Process is the execution of a program that performs the actions specified in that program. It can be
defined as an execution unit where a program runs. The OS helps you to create, schedule, and
terminates the processes which is used by CPU. A process created by the main process is called a
child process.
• Process operations can be easily controlled with the help of PCB(Process Control Block). You can
consider it as the brain of the process, which contains all the crucial information related to
processing like process id, priority, state, CPU registers, etc.
• Here are the important properties of the process:

• Creation of each process requires separate system calls for each process.
• It is an isolated execution entity and does not share data and information.
• Processes use the IPC(Inter-Process Communication) mechanism for communication that
significantly increases the number of system calls.
• Process management takes more system calls.
• A process has its stack, heap memory with memory, and data map.
IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

Here, is an Architecture diagram of the Process

• Stack: The Stack stores temporary data like function parameters,


returns addresses, and local variables.

• Heap: Allocates memory, which may be processed during its run time.

• Data: It contains the variable.

• Text: Text Section includes the current activity, which is represented by


the value of the Program Counter.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

• What is Thread?
• Thread is an execution unit that is part of a process. A process can have multiple threads, all executing at the
same time. It is a unit of execution in concurrent programming. A thread is lightweight and can be managed
independently by a scheduler. It helps you to improve the application performance using parallelism.

• Multiple threads share information like data, code, files, etc. We can implement
threads in three different ways:
• Kernel-level threads
• User-level threads
• Hybrid threads

• Here are important properties of Thread:


• Single system call can create more than one thread
• Threads share data and information.
• Threads shares instruction, global, and heap regions. However, it has its register and stack.
• Thread management consumes very few, or no system calls because of communication between threads that
can be achieved using shared memory.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management
• Process Synchronization
• It is the task phenomenon of coordinating the execution of processes in such a way that no two
processes can have access to the same shared data and resources.
• It is a procedure that is involved in order to preserve the appropriate order of execution of cooperative
processes.
• In order to synchronize the processes, there are various synchronization mechanisms.
• Process Synchronization is mainly needed in a multi-process system when multiple processes are
running together, and more than one processes try to gain access to the same shared resource or any
data at the same time.
• Process Synchronization was introduced to handle problems that arose while multiple
process executions. Process is categorized into two types on the basis of synchronization
and these are given below:
• Independent Process
• Two processes are said to be independent if the execution of one process does not affect the execution of another process.
• Cooperative Process
• Two processes are said to be cooperative if the execution of one process affects the execution of another process. These
processes need to be synchronized so that the order of execution can be guaranteed.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

• Race Condition
• At the time when more than one process is either executing the same code or
accessing the same memory or any shared variable; In that condition, there is a
possibility that the output or the value of the shared variable is wrong so for that
purpose all the processes are doing the race to say that my output is correct. This
condition is commonly known as a race condition. As several processes access and
process the manipulations on the same data in a concurrent manner and due to
which the outcome depends on the particular order in which the access of data
takes place.
• Mainly this condition is a situation that may occur inside the critical section. Race
condition in the critical section happens when the result of multiple thread
execution differs according to the order in which the threads execute. But this
condition is critical sections can be avoided if the critical section is treated as an
atomic instruction. Proper thread synchronization using locks or atomic variables
can also prevent race conditions.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management
• Critical Section Problem

• Critical section is a code segment that can be accessed by only one process at a time. Critical section contains
shared variables which need to be synchronized to maintain consistency of data variables. It means that in a
group of cooperating processes, at a given point of time, only one process must be executing its critical section.
If any other process also wants to execute its critical section, it must wait until the first one finishes. The entry to
the critical section is mainly handled by wait() function while the exit from the critical section is controlled by
the signal() function.

Here, are four essential elements of the critical section:

• Entry Section: It is part of the process which decides the entry of a


particular process.
• Critical Section: This part allows one process to enter and modify
the shared variable.
• Exit Section: Exit section allows the other process that are waiting in
the Entry Section, to enter into the Critical Sections.
• Remainder Section: All other parts of the Code, which is not in
Critical, Entry, and Exit Section, are known as the Remainder
Section.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

• Any solution to the critical section problem must satisfy three


requirements:
• Mutual Exclusion : If a process is executing in its critical section, then no other
process is allowed to execute in the critical section.
• Progress : If no process is executing in the critical section and other processes are
waiting outside the critical section, then only those processes that are not
executing in their remainder section can participate in deciding which will enter in
the critical section next, and the selection can not be postponed indefinitely.
• Bounded Waiting : A bound must exist on the number of times that other
processes are allowed to enter their critical sections after a process has made a
request to enter its critical section and before that request is granted.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

• Solutions for the Critical Section. Some widely used method to solve the critical
section problem are as follows:
• Peterson's Solution
• This is widely used and software-based solution to critical section problems. Peterson's solution was
developed by a computer scientist Peterson that's why it is named so.
• With the help of this solution whenever a process is executing in any critical state, then the other process only
executes the rest of the code, and vice-versa can happen. This method also helps to make sure of the thing
that only a single process can run in the critical section at a specific time.

• Semaphores
• A semaphore is a signaling mechanism and a thread that is waiting on a semaphore can be signaled by
another thread. This is different than a mutex as the mutex can be signaled only by the thread that called the
wait function.
• A semaphore uses two atomic operations, wait and signal for process synchronization. A Semaphore is an
integer variable, which can be accessed only through two operations wait() and signal().There are two types
of semaphores: Binary Semaphores and Counting Semaphores

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

• Synchronization Hardware
• Many systems provide hardware support for critical section code. The critical section problem could be solved
easily in a single-processor environment if we could disallow interrupts to occur while a shared variable or
resource is being modified.
• In this manner, we could be sure that the current sequence of instructions would be allowed to execute in
order without pre-emption. Unfortunately, this solution is not feasible in a multiprocessor environment.
• Disabling interrupt on a multiprocessor environment can be time-consuming as the message is passed to all
the processors.
• This message transmission lag delays the entry of threads into the critical section, and the system efficiency
decreases.

• Mutex Locks
• As the synchronization hardware solution is not easy to implement for everyone, a strict software approach
called Mutex Locks was introduced. In this approach, in the entry section of code, a LOCK is acquired over the
critical resources modified and used inside the critical section, and in the exit section that LOCK is released.
• As the resource is locked while a process executes its critical section hence no other process can access it.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

• What is CPU Scheduling?


• CPU Scheduling is a process of determining which process will own CPU for execution while another
process is on hold. The main task of CPU scheduling is to make sure that whenever the CPU remains idle,
the OS at least select one of the processes available in the ready queue for execution. The selection
process will be carried out by the CPU scheduler. It selects one of the processes in memory that are
ready for execution.

• Preemptive Scheduling
• In Preemptive Scheduling, the tasks are mostly assigned with their
priorities. Sometimes it is important to run a task with a higher priority
before another lower priority task, even if the lower priority task is still
running. The lower priority task holds for some time and resumes when
the higher priority task finishes its execution.
• Non-Preemptive Scheduling
• In this type of scheduling method, the CPU has been allocated to a
specific process. The process that keeps the CPU busy will release the CPU
either by switching context or terminating. It is the only method that can
be used for various hardware platforms. That's because it doesn't need
special hardware (for example, a timer) like preemptive scheduling.
IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

• CPU Scheduling Criteria. A CPU scheduling algorithm tries to maximize and


minimize the following:
• Maximize:
• CPU utilization: CPU utilization is the main task in which the operating system needs to make sure that CPU
remains as busy as possible. It can range from 0 to 100 percent. However, for the RTOS, it can be range from
40 percent for low-level and 90 percent for the high-level system.
• Throughput: The number of processes that finish their execution per unit time is known Throughput. So,
when the CPU is busy executing the process, at that time, work is being done, and the work completed per
unit time is called Throughput.

• Minimize:
• Waiting time: Waiting time is an amount that specific process needs to wait in the ready queue.
• Response time: It is an amount to time in which the request was submitted until the first response is
produced.
• Turnaround Time: Turnaround time is an amount of time to execute a specific process. It is the calculation of
the total time spent waiting to get into the memory, waiting in the queue and, executing on the CPU. The
period between the time of process submission to the completion time is the turnaround time.
IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

• Important CPU scheduling Terminologies


• Burst Time/Execution Time: It is a time required by the process to complete execution. It is also
called running time.
• Arrival Time: when a process enters in a ready state
• Finish Time: when process complete and exit from a system
• Multiprogramming: A number of programs which can be present in memory at the same time.
• Jobs: It is a type of program without any kind of user interaction.
• User: It is a kind of program having user interaction.
• Process: It is the reference that is used for both job and user.
• CPU/IO burst cycle: Characterizes process execution, which alternates between CPU and I/O
activity. CPU times are usually shorter than the time of I/O.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

• Types of CPU scheduling Algorithm: There are mainly six types of process
scheduling algorithms
• First Come First Serve (FCFS)
• Shortest-Job-First (SJF) Scheduling
• Shortest Remaining Time
• Priority Scheduling
• Round Robin Scheduling
• Multilevel Queue Scheduling

• Here are the reasons for using a scheduling algorithm:


• The CPU uses scheduling to improve its efficiency.
• It helps you to allocate resources among competing processes.
• The maximum utilization of CPU can be obtained with multi-programming.
• The processes which are to be executed are in ready queue.

https://youtube.com/playlist?list=PLpRG0HEiKEz7bCDd0ew3k1F-BrSdN1hBH
IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

• First Come First Serve


• First Come First Serve is the full form of FCFS. It is the easiest and most simple CPU scheduling algorithm. In
this type of algorithm, the process which requests the CPU gets the CPU allocation first. This scheduling
method can be managed with a FIFO queue. As the process enters the ready queue, its PCB (Process Control
Block) is linked with the tail of the queue. So, when CPU becomes free, it should be assigned to the process at
the beginning of the queue.
• Characteristics of FCFS method:
• It offers non-preemptive and pre-emptive scheduling algorithm.
• Jobs are always executed on a first-come, first-serve basis
• It is easy to implement and use.
• However, this method is poor in performance, and the general wait time is quite high.

• Shortest Remaining Time


• The full form of SRT is Shortest remaining time. It is also known as SJF preemptive scheduling. In this method,
the process will be allocated to the task, which is closest to its completion. This method prevents a newer
ready state process from holding the completion of an older process.
• Characteristics of SRT scheduling method:
• This method is mostly applied in batch environments where short jobs are required to be given preference.
• This is not an ideal method to implement it in a shared system where the required CPU time is unknown.
• Associate with each process as the length of its next CPU burst. So that operating system uses these lengths, which
helps to schedule the process with the shortest possible time.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

• Priority Based Scheduling


• Priority scheduling is a method of scheduling processes based on priority. In this method, the scheduler
selects the tasks to work as per the priority. Priority scheduling also helps OS to involve priority
assignments. The processes with higher priority should be carried out first, whereas jobs with equal
priorities are carried out on a round-robin or FCFS basis. Priority can be decided based on memory
requirements, time requirements, etc.

• Round-Robin Scheduling
• Round robin is the oldest, simplest scheduling algorithm. The name of this algorithm comes from the
round-robin principle, where each person gets an equal share of something in turn. It is mostly used for
scheduling algorithms in multitasking. This algorithm method helps for starvation free execution of
processes.
• Characteristics of Round-Robin Scheduling
• Round robin is a hybrid model which is clock-driven
• Time slice should be minimum, which is assigned for a specific task to be processed. However, it may vary for
different processes.
• It is a real time system which responds to the event within a specific time limit.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

• Shortest Job First


• SJF is a full form of (Shortest job first) is a scheduling algorithm in which the process with the shortest execution
time should be selected for execution next. This scheduling method can be preemptive or non-preemptive. It
significantly reduces the average waiting time for other processes awaiting execution.
• Characteristics of SJF Scheduling
• It is associated with each job as a unit of time to complete.
• In this method, when the CPU is available, the next process or job with the shortest completion time will be executed first.
• It is Implemented with non-preemptive policy.
• This algorithm method is useful for batch-type processing, where waiting for jobs to complete is not critical.
• It improves job output by offering shorter jobs, which should be executed first, which mostly have a shorter turnaround time.

• Multiple-Level Queues Scheduling


• This algorithm separates the ready queue into various separate queues. In this method, processes are assigned to a
queue based on a specific property of the process, like the process priority, size of the memory, etc. However, this is
not an independent scheduling OS algorithm as it needs to use other types of algorithms in order to schedule the
jobs.
• Characteristic of Multiple-Level Queues Scheduling:
• Multiple queues should be maintained for processes with some characteristics.
• Every queue may have its separate scheduling algorithms.
• Priorities are given for each queue.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Process Management

• What is Deadlock?
• Deadlock is a situation that occurs in OS when any process enters a waiting state because another waiting process is
holding the demanded resource. Deadlock is a common problem in multi-processing where several processes share
a specific type of mutually exclusive resource known as a soft lock or software.

• Advantages of Deadlock
• This situation works well for processes which perform a single burst of activity
• No preemption needed for Deadlock.
• Convenient method when applied to resources whose state can be saved and restored easily
• Feasible to enforce via compile-time checks
• Needs no run-time computation since the problem is solved in system design

• Disadvantages of Deadlock method


• Delays process initiation
• Processes must know future resource need
• Pre-empts more often than necessary
• Dis-allows incremental resource requests
• Inherent preemption losses.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Memory Management

• Main memory refers to physical memory that is internal to the computer. The word
main is used to distinguish it from external mass storage devices such as disk drives.
Other terms used to mean main memory include RAM and primary storage. The
computer can manipulate only data that is in main memory. Therefore, every
program you execute and every file you access must be copied from a storage
device into main memory. The amount of main memory on a computer is crucial
because it determines how many programs can be executed at one time and how
much data can be readily available to a program.
• Virtual memory is stored on the hard drive. Virtual memory is used when the RAM
is filled. Virtual memory is slower than physical memory, so it can decrease the
performance of applications. Virtual memory abstracts physical memory into an
extremely large uniform array of storage. Virtual memory enables a system to run
larger applications or run more applications at the same time without running out of
RAM. Specifically, the system can operate as if its total RAM resources were equal
to the amount of physical RAM, plus the amount of virtual RAM.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Memory Management

• What is Memory Management?


• Memory Management is the process of controlling and coordinating computer memory, assigning
portions known as blocks to various running programs to optimize the overall performance of the
system.
• It is the most important function of an operating system that manages primary memory. It helps
processes to move back and forward between the main memory and execution disk. It helps OS to
keep track of every memory location, irrespective of whether it is allocated to some process or it
remains free.

• Why Use Memory Management?


• It allows you to check how much memory needs to be allocated to processes that decide which
processor should get memory at what time.
• Tracks whenever inventory gets freed or unallocated. According to it will update the status.
• It allocates the space to application routines.
• It also make sure that these applications do not interfere with each other.
• Helps protect different processes from each other
• It places the programs in memory so that memory is utilized to its full extent.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Memory Management
• Memory Management Techniques
• Single Contiguous Allocation
• It is the easiest memory management technique. In this method, all types of computer's memory except a small portion
which is reserved for the OS is available for one application. For example, MS-DOS operating system allocates memory in
this way. An embedded system also runs on a single application.

• Partitioned Allocation
• It divides primary memory into various memory partitions, which is mostly contiguous areas of memory. Every partition
stores all the information for a specific task or job. This method consists of allotting a partition to a job when it starts &
unallocated when it ends.

• Paged Memory Management


• This method divides the computer's main memory into fixed-size units known as page frames. This hardware memory
management unit maps pages into frames which should be allocated on a page basis.

• Segmented Memory Management


• Segmented memory is the only memory management method that does not provide the user's program with a linear and
contiguous address space. Segments need hardware support in the form of a segment table. It contains the physical
address of the section in memory, size, and other data like access protection bits and status.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Memory Management
• What is Swapping?

• Swapping is a method in which the process should be swapped temporarily from the main memory to the
backing store. It will be later brought back into the memory for continue execution.

• Backing store is a hard disk or some other secondary storage device that should be big enough inorder to
accommodate copies of all memory images for all users. It is also capable of offering direct access to these
memory images.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Memory Management

• What is Memory allocation?


• Memory allocation is a process by which computer programs are assigned memory or space. Here,
main memory is divided into two types of partitions
• Low Memory - Operating system resides in this type of memory.
• High Memory- User processes are held in high memory.

• Partition Allocation
• Memory is divided into different blocks or partitions. Each process is allocated according to the
requirement. Partition allocation is an ideal method to avoid internal fragmentation.
• Below are the various partition allocation schemes :
• First Fit: In this type fit, the partition is allocated, which is the first sufficient block from the beginning of the
main memory.
• Best Fit: It allocates the process to the partition that is the first smallest partition among the free partitions.
• Worst Fit: It allocates the process to the partition, which is the largest sufficient freely available partition in
the main memory.

https://www.youtube.com/watch?v=Xf4Ipw_MY5I
IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Memory Management

• What is Paging?
• Paging is a storage mechanism that allows OS to retrieve processes from the secondary storage
into the main memory in the form of pages. In the Paging method, the main memory is divided
into small fixed-size blocks of physical memory, which is called frames. The size of a frame should
be kept the same as that of a page to have maximum utilization of the main memory and to avoid
external fragmentation. Paging is used for faster access to data, and it is a logical concept.

• What is Segmentation?
• Segmentation method works almost similarly to paging. The only difference between the two is
that segments are of variable-length, whereas, in the paging method, pages are always of fixed
size.
• A program segment includes the program's main function, data structures, utility functions, etc.
The OS maintains a segment map table for all the processes. It also includes a list of free memory
blocks along with its size, segment numbers, and its memory locations in the main memory or
virtual memory.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Memory Management

• What is Fragmentation?
• Processes are stored and removed from memory, which creates free memory space, which are too
small to use by other processes.
• After sometimes, that processes not able to allocate to memory blocks because its small size and
memory blocks always remain unused is called fragmentation. This type of problem happens during
a dynamic memory allocation system when free blocks are quite small, so it is not able to fulfill any
request.
• Two types of Fragmentation methods are:
• External fragmentation
• External fragmentation can be reduced by rearranging memory contents to place all free memory together in a single
block.

• Internal fragmentation
• The internal fragmentation can be reduced by assigning the smallest partition, which is still good enough to carry the
entire process.
IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Memory Management

Compaction is a process in which the free space is collected in a large memory chunk to
make some space available for processes. In memory management, swapping creates
multiple fragments in the memory because of the processes moving in and out.
Compaction refers to combining all the empty spaces together and processes.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Storage Management

• Storage management plays an important part in operating system. It deals with the storage
procedures in the computer system using an operating system.
• Storage Management is defined as it refers to the management of the data storage
equipment’s that are used to store the user/computer generated data. Hence it is a tool or
set of processes used by an administrator to keep your data and storage equipment’s safe.
• Storage management is a process for users to optimize the use of storage devices and to
protect the integrity of data for any media on which it resides and the category of storage
management generally contain the different type of subcategories covering aspects such as
security, virtualization and more, as well as different types of provisioning or automation,
which is generally made up the entire storage management software market.
• Storage management key attributes:
• Performance
• Reliability
• Recoverability
• Capacity
IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Storage Management

• Mass Storage Structure


• The main mass-storage system in modern
computers is secondary storage, which is
usually provided by hard disk drives (HDD) and
nonvolatile memory (NVM) devices. Some
systems also have slower, larger, tertiary
storage, generally consisting of magnetic tape,
optical disks, or even cloud storage.
• The bulk of secondary storage for modern
computers is provided by hard disk drives
(HDDs) and nonvolatile memory (NVM)
devices.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Storage Management
• Hard Disk Drives
• Conceptually, HDDs are relatively simple (Figure 11.1). Each disk platter has a flat circular shape, like a CD. Common
platter diameters range from 1.8 to 3.5 inches. The two surfaces of a platter are covered with a magnetic material. We
store information by recording it magnetically on the platters, and we read information by detecting the magnetic
pattern on the platters.
• Platters range from .85” to 14” (historically)
• Commonly 3.5”, 2.5”, and 1.8”

• Range from 30GB to 3TB per drive


• Performance
• Transfer Rate – theoretical – 6 Gb/sec
• Effective Transfer Rate – real – 1Gb/sec

• Seek time from 3ms to 12ms – 9ms common for desktop drives
• Average seek time measured or calculated based on 1/3 of tracks

• Latency based on spindle speed


• 1 / (RPM / 60) = 60 / RPM
• Average latency = ½ latency

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Storage Management

• Nonvolatile Memory Devices


• Nonvolatile memory (NVM) devices are
growing in importance. Simply described,
NVM devices are electrical rather than
mechanical. Most commonly, such a device is
composed of a controller and flash NAND die
semiconductor chips, which are used to store
data. Other NVM technologies exist, like
DRAM with battery backing so it doesn’t lose
its contents, as well as other semiconductor
technology like 3D XPoint, but they are far less
common and so are not discussed in this book.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Storage Management

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Storage Management

• File System
• A file is a collection of related information defined by its creator. Files are mapped
by the operating system onto physical mass-storage devices. A file system describes
how files are mapped onto physical devices, as well as how they are accessed and
manipulated by both users and programs.
• Accessing physical storage can often be slow, so file systems must be designed for
efficient access. Other requirements may be important as well, including providing
support for file sharing and remote access to files.
• file system is the most visible aspect of a general-purpose operating system. It
provides the mechanism for on-line storage of and access to both data and
programs of the operating system and all the users of the computer system. The file
system consists of two distinct parts: a collection of files, each storing related data,
and a directory structure, which organizes and provides information about all the
files in the system. Most file systems live on storage devices.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Storage Management

• File Attributes
• Name – only information kept in human-readable form
• Identifier – unique tag (number) identifies file within file system
• Type – needed for systems that support different types
• Location – pointer to file location on device
• Size – current file size
• Protection – controls who can do reading, writing, executing
• Time, date, and user identification – data for protection, security, and usage
monitoring

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Storage Management

• File Types

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Storage Management
• File System Structure
• I/O Control level
• Device drivers acts as interface between devices and Os, they help to transfer data
between disk and main memory. It takes block number a input and as output it gives
low level hardware specific instruction.

• Basic file system


• It Issues general commands to device driver to read and write physical blocks on
disk. It manages the memory buffers and caches. A block in buffer can hold the
contents of the disk block and cache stores frequently used file system metadata.

• File organization Module


• It has information about files, location of files and their logical and physical blocks.
Physical blocks do not match with logical numbers of logical block numbered from 0
to N. It also has a free space which tracks unallocated blocks.

• Logical file system


• It manages metadata information about a file i.e includes all details about a file
except the actual contents of file. It also maintains via file control blocks. File control
block (FCB) has information about a file – owner, size, permissions, location of file
contents.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Storage Management

• I / O System
• Management of I/O devices is a very important part of the operating system - so
important and so varied that entire I/O subsystems are devoted to its operation. (
Consider the range of devices on a modern computer, from mice, keyboards, disk
drives, display adapters, USB devices, network connections, audio I/O, printers,
special devices for the handicapped, and many special-purpose peripherals. )
• I/O Subsystems must contend with two ( conflicting? ) trends: (1) The gravitation
towards standard interfaces for a wide range of devices, making it easier to add
newly developed devices to existing systems, and (2) the development of entirely
new types of devices, for which the existing standard interfaces are not always easy
to apply.
• Device drivers are modules that can be plugged into an OS to handle a particular
device or category of similar devices.
IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Storage Management

• I / O Hardware
• I/O devices can be roughly categorized as storage, communications, user-interface,
and other
• Devices communicate with the computer via signals sent over wires or through the
air.
• Devices connect with the computer via ports, e.g. a serial or parallel port.
• A common set of wires connecting multiple devices is termed a bus.
• Buses include rigid protocols for the types of messages that can be sent across the
bus and the procedures for resolving contention issues.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Storage Management

• Figure below illustrates three of the


four bus types commonly found in a
modern PC:
• The PCI bus connects high-speed high-
bandwidth devices to the memory subsystem (
and the CPU. )
• The expansion bus connects slower low-
bandwidth devices, which typically deliver data
one character at a time ( with buffering. )
• The SCSI bus connects a number of SCSI devices
to a common SCSI controller.
• A daisy-chain bus, ( not shown) is when a string
of devices is connected to each other like beads
on a chain, and only one of the devices is directly
connected to the host.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Storage Management

• Interrupt:
• Interrupt is a hardware mechanism in which, the device notices the CPU that it
requires its attention. Interrupt can take place at any time. So when CPU gets an
interrupt signal trough the indication interrupt-request line, CPU stops the current
process and respond to the interrupt by passing the control to interrupt handler
which services device.
• Polling:
• In polling is not a hardware mechanism, its a protocol in which CPU steadily
checks whether the device needs attention. Wherever device tells process unit
that it desires hardware processing, in polling process unit keeps asking the I/O
device whether or not it desires CPU processing. The CPU ceaselessly check every
and each device hooked up thereto for sleuthing whether or not any device
desires hardware attention.
IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Storage Management

https://www.youtube.com/watch?v=f7LLKL1g-kk IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Protection and Security

• Security ensures the authentication of system users to protect the integrity of the
information stored in the system (both data and code), as well as the physical resources of
the computer system. The security system prevents unauthorized access, malicious
destruction or alteration of data, and accidental introduction of inconsistency.
• Protection is the set of mechanisms that control the access of processes and users to the
resources defined by a computer system. It controls access to a system by limiting the types
of file access permitted to users. In addition, protection must ensure that only processes
that have gained proper authorization from the operating system can operate on memory
segments, the CPU, and other resources. Protection is provided by a mechanism that
controls the access of programs, processes, or users to the resources defined by a computer
system. This mechanism must provide a means for specifying the controls to be imposed,
together with a means of enforcing them.
• Protection and security requires that computer resources such as CPU, software, memory
etc. are protected. This extends to the operating system as well as the data in the system.
This can be done by ensuring integrity, confidentiality and availability in the operating
system. The system must be protect against unauthorized access, viruses, worms etc.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Protection and Security
Threats to Protection and Security

• Virus
• Viruses are generally small snippets of code embedded in a system. They are very dangerous and can corrupt files, destroy data,
crash systems etc. They can also spread further by replicating themselves as required.

• Trojan Horse
• A trojan horse can secretly access the login details of a system. Then a malicious user can use these to enter the system as a
harmless being and wreak havoc.

• Trap Door
• A trap door is a security breach that may be present in a system without the knowledge of the users. It can be exploited to harm the
data or files in a system by malicious people.

• Worm
• A worm can destroy a system by using its resources to extreme levels. It can generate multiple copies which claim all the resources
and don't allow any other processes to access them. A worm can shut down a whole network in this way.

• Denial of Service
• These type of attacks do not allow the legitimate users to access a system. It overwhelms the system with requests so it is
overwhelmed and cannot work properly for other user.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Protection and Security

Protection and Security Methods


The different methods that may provide protect and security for different computer systems are −

• Authentication
• This deals with identifying each user in the system and making sure they are who they claim to be.
The operating system makes sure that all the users are authenticated before they access the
system. The different ways to make sure that the users are authentic are:
• Username/ Password
• Each user has a distinct username and password combination and they need to enter it correctly
before they can access the system.
• User Key/ User Card
• The users need to punch a card into the card slot or use they individual key on a keypad to access the
system.
• User Attribute Identification
• Different user attribute identifications that can be used are fingerprint, eye retina etc. These are
unique for each user and are compared with the existing samples in the database. The user can only
access the system if there is a match.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Protection and Security

• One Time Password


• These passwords provide a lot of security for authentication purposes.
A one time password can be generated exclusively for a login every
time a user wants to enter the system. It cannot be used more than
once. The various ways a one time password can be implemented are:

• Random Numbers
• The system can ask for numbers that correspond to alphabets that are pre arranged. This
combination can be changed each time a login is required.

• Secret Key
• A hardware device can create a secret key related to the user id for login. This
key can change each time.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Protection and Security

• Some of the most common types of violations include:


• Breach of Confidentiality - Theft of private or confidential information, such as credit-card
numbers, trade secrets, patents, secret formulas, manufacturing procedures, medical information,
financial information, etc.
• Breach of Integrity - Unauthorized modification of data, which may have serious indirect
consequences. For example a popular game or other program's source code could be modified to
open up security holes on users systems before being released to the public.
• Breach of Availability - Unauthorized destruction of data, often just for the "fun" of causing havoc
and for bragging rites. Vandalism of web sites is a common form of this violation.
• Theft of Service - Unauthorized use of resources, such as theft of CPU cycles, installation of
daemons running an unauthorized file server, or tapping into the target's telephone or networking
services.
• Denial of Service, DOS - Preventing legitimate users from using the system, often by overloading
and overwhelming the system with an excess of requests for service.

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Protection and Security

Security Violation Methods


• Masquerading (breach authentication)
• Pretending to be an authorized user to escalate privileges
• Replay attack
• As is or with message modification
• Man-in-the-middle attack
• Intruder sits in data flow, masquerading as sender to receiver and vice versa
• Session hijacking
• Intercept an already-established session to bypass authentication

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Protection and Security

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
Protection and Security

Security Measure Levels


• Physical
• Data centers, servers, connected terminals
• Human
• Avoid social engineering, phishing, dumpster diving
• Operating System
• Protection mechanisms, debugging
• Network
• Intercepted communications, interruption, DOS

IT 11 – Operating System Applications _ AY 1st Sem 21-22: BIENDO R. DELOS ANGELES III
20 kb 40 kb 60 kb 50 kb 30 kb 25 kb
First Fit

20 kb 40 kb 60 kb 50 kb 30 kb 25 kb

20 kb 40 kb 60 kb 50 kb 30 kb 25 kb
5 6
k k
b 32 kb b

5 6
k 32 kb k 20 kb 30 kb 25 kb
b b INTERNAL EXTERNAL

p1 p2 p3 75 kb
Worst Fit

20 kb 40 kb 60 kb 50 kb 30 kb 25 kb

20 kb 40 kb 60 kb 50 kb 30 kb 25 kb
25 kb 22 kb

20 kb 40 kb 30 kb 25 kb
25 kb 22 kb

P1 P2 115 kb
Best Fit

20 kb 40 kb 60 kb 50 kb 30 kb 25 kb

5 6 2
11
20 kb 40 kb k 60 kb kb
50 kb k 30 kb k 25 kb
b b b

5 62
11
k kb k k 20 kb 25 kb
b bb

P1 P4 P3 P2 45 kb

You might also like