Professional Documents
Culture Documents
(EE 311)
❖ Types of Storage
➢ Primary Storage - Internal memory
➢ Secondary Storage – External memory
➢ Tertiary Storage – External memory
➢ Off-line Storage – External memory
Types of Storage
1. Primary Storage - Internal memory
2. Secondary Storage – External memory
3. Tertiary Storage – External memory
4. Off-line Storage – External memory
1. Primary Storage - Internal memory
➢ The primary storage also known as processor memory / primary memory / main memory / internal
memory.
➢ Main memory is directly or indirectly connected to the central processing unit (CPU) via a bus.
➢ The CPU continuously reads instructions stored there and executes them as required.
➢ Example:
❑ RAM (DRAM & SRAM)
❑ ROM (PROM, EPROM & EEPROM)
❑ Cache
➢ Secondary memory devices can be used to store the large amount of data, audio, video and
multimedia files.
➢ Computer usually uses its input/output channels to access secondary storage and transfers the
desired data using intermediate area in primary storage.
Example:
– Hard disk
2. Secondary Storage - External memory
Hard Disk
➢ Typically it involves a robotic mechanism which will mount (insert) and dismount removable mass
storage media into a storage device.
➢ It is a comprehensive computer storage system that is usually very slow, so it is usually used to
archive data that is not accessed frequently.
➢ This is primarily useful for extraordinarily large data stores, accessed without human operators.
Examples:
❑ Magnetic Tape
❑ Optical Disc
❑ Tape Libraries
❑ Optical Jukeboxes
3. Tertiary Storage – External memory
Magnetic Tape
➢ A magnetic ally coated strip of plastic on which data can been coded.
➢ Tapes for computers are similar to tapes used to store music.
➢ Tape is much less expensive than other storage mediums but commonly a much slower solution
that is commonly used for backup.
3. Tertiary Storage – External memory
Optical Disc
➢ Optical disc is a storage media that holds the content in digital format and is read using a laser
assembly.
Tape Libraries
➢ These may contain one or more tape drives, a barcode reader for the tapes
and a robot to load the tapes.
➢ The capacity of these tape libraries is more than a thousand times that of
hard drives and so they they are useful for storing large amounts of data.
Optical Jukeboxes
➢ These are storage devices that can handle optical disks and provide tertiary
storage ranging from terabytes to petabytes.
➢ They can also be called optical disk libraries, robotic drives etc.
4. Off-line Storage – External memory
➢ It is a computer data storage on a medium or a device that is not under the control of a processing unit.
➢ It must be inserted or connected by a human operator before a computer can access it again.
Examples:
– Floppy Disk
– Zip diskette
– USB Flash drive
– Memory card
4. Off-line Storage – External memory
Floppy Disk
➢ It is a soft magnetic disk.
➢ Floppy disks are portable.
➢ Floppy disks are slower to access than hard disks and have less storage capacity, but they are much
less expensive.
➢ Can store data upto1.44MB.
➢ Two common sizes: 5¼” and 3½”.
4. Off-line Storage – External memory
Zip Diskette
➢ Hardware data storage device developed by Iomega that functions like a Standard 1.44“ floppy drive.
➢ Capable to hold upto100MB of data or 250MB of data on new drives.
➢ Now it less popular as users needed larger storage capabilities.
4. Off-line Storage – External memory
➢ Flash drives are available in sizes such as 256MB,512MB,1GB,5GB,and16GB and are an easy way to
transfer and store information.
4. Off-line Storage – External memory
Memory Card
➢ An electronic flash memory storage disk commonly used in consumer electronic devices such as digital
cameras, MP3 players, mobile phones, and other small portable devices.
➢ Memory cards are usually read by connecting the device containing the card to your computer, or by
using a USB card reader.
Other Examples of Storage Device
➢ Punch Card
➢ Cloud Storage
Punched Card
➢ Early method of data storage used with early computers.
➢ Punch cards also known as Hollerith cards.
➢ Containing several punched holes that represents data.
Cloud Storage
➢ Cloud storage means "the storage of data online in the
cloud,“ wherein a data is stored in and accessible from
multiple distributed and connected resources that
comprise a cloud.
➢ Cloud storage can provide the benefits of greater
accessibility and reliability; rapid deployment; strong
protection for data backup, archival and disaster
recovery purposes.
Characteristics of Secondary Memory – External memory
These are some characteristics of secondary memory, which distinguish it from primary
memory −
▪ An Operating System is a collection of programs designed to manage the system’s resources, namely, memory, processors, peripheral
devices, and information.
▪ An operating system is a software which performs all the basic tasks like
file management, memory management, process management, handling input
and output, and controlling peripheral devices such as disk drives and printers.
▪ Ex: Windows, Unix, Linux, Ubuntu, OS/400, Advanced Interactive Executive (AIX),
z/OS, Virtual Memory System (VMS), etc.
Operating system goals:
❖ Execute user programs and make solving user problems easier
❖ Recording delays between request for a service and response from the system.
❖ Keeping track of time and resources used by various jobs and users.
❖ Production of error messages, and other debugging and error detecting aids.
➢ The Operating System is a manager of system resources. Since there can be many conflicting requests for the resources, the
Operating System must decide which requests are to be allocated resources to operate the computer system fairly and efficiently.
❑ Memory management refers to the management of Primary Memory or Main Memory. Main memory is
a large array of words or bytes where each word or byte has its own address.
✓ Keeps tracks of primary memory, i.e., what part of it are in use by whom, what part are not in
use.
✓ In multiprogramming, the OS decides which process will get memory when and how much.
✓ Keeps tracks of processor and status of process. The program responsible for this task is known as traffic
controller.
An Operating System (OS) manages device communication via their respective drivers.
Keeps tracks of all devices. The program responsible for this task is known as the I/O controller.
Decides which process gets the device when and for how much time.
De-allocates devices.
File Management:
A file is a unit of (usually named) information stored on a computer. It may be a document, a webpage or a wide
range of other types of information.
A file system is normally organized into directories for easy navigation and usage.
✓ Keeps track of information, location, uses, status etc. The collective facilities are often known as file system.
❑ An Operating System is responsible for the computer system networking via a distributed environment.
❑ A distributed system is a collection of processors, which do not share memory, clock pulse or any peripheral
devices. Instead, each processor is having its own clock pulse, and RAM and they communicate through network.
❑ Various networking protocols are TCP/IP (Transmission Control Protocol/ Internet Protocol), UDP (User
Datagram Protocol), FTP (File Transfer Protocol), HTTP (Hyper Text Transfer Protocol), NFS (Network File
System), etc.
THANK YOU
Computer Organization
(EE 311)
➢ Evolution of OS
Serial Processing:
✓ No operating system
✓ Machines run from a console with display lights (error messages), input device (punch card, tape) and printer (for
output)
✓ Setup included: loading and compiling the program, and loading and linking common functions – very time
consuming (errors!)
Batch Processing:
Multiprogramming
✓ In multiprogramming, many processes are simultaneously resident in memory, and execution switches between
processes.
✓ More efficient use of computer time.
Operating System Types:
CPU is often idle, because the speed of the mechanical I/O devices is slower than the CPU.
➢ The processors communicate with one another through various communication lines (such as high-speed buses). These
are referred as loosely coupled systems or distributed systems. Processors in a distributed system may vary in size and
function. These processors are referred as sites, nodes, computers, and so on.
Examples of Distributed Operating System are- LOCUS, etc.
Advantages:
With resource sharing facility, a user at one site may be able to use the resources available at another.
Speedup the exchange of data with one another via electronic mail.
If one site fails in a distributed system, the remaining sites can potentially continue operating.
Better service to the customers.
Reduction of the load on the host computer.
Reduction of delays in data processing.
Disadvantages
• Failure of the main network will stop the entire communication
Network Operating System
A Network Operating System runs on a server and provides the server the capability to manage data, users,
groups, security, applications, and other networking functions. The primary purpose of the network operating
system is to allow shared file and printer access among multiple computers in a network, typically a local area
network (LAN), a private network or to other networks.
Ex: Microsoft Windows Server 2003, Microsoft Windows Server 2008, UNIX, Linux, Mac OS X,
Novell NetWare, and BSD.
Advantages:
➢ Highly stable.
➢ Security is server managed.
➢ Remote access to servers is possible from different locations
Disadvantages:
➢ High cost of buying and running a server.
➢ Dependency on a central location for most operations.
➢ Regular maintenance and updates are required.
Real-Time Operating System
➢ These types of OSs serve real-time systems.
➢ A real-time system is defined as a data processing system in which the time interval required to process and respond
to inputs is so small that it controls the environment.
➢ Real-time systems are used when there are time requirements that are very strict like missile systems, air traffic
control systems, robots, etc.
EX: Scientific experiments, medical imaging systems, industrial control systems, weapon systems, robots, air
traffic control systems, etc.
Advantages:
➢ Focus on running applications and less importance to applications which are in the queue.
➢ These types of systems are error-free.
➢ Memory allocation is best managed in these types of systems.
Disadvantages
➢ Very few tasks run at the same time and their concentration is very less on few applications to avoid errors.
➢ The algorithms are very complex and difficult for the designer to write on.
➢ Sometimes the system resources are not so good and they are expensive as well.
THANK YOU
Computer Organization
(EE 311)
➢ Definition
➢ Terms used in MM
➢ Requirements
Memory hierarchy
❑ What is the memory hierarchy?
✓ Different levels of memory
✓ Some are small & fast
✓ Others are large & slow
❖ It is the process of
➢ protecting each user’s memory area from other user programs; i.e., ensuring that
each program only references memory locations that have been allocated to it
Memory Management Important Terms
Page: A fixed-length block of data that resides in secondary memory (such as disk).
A page of data may temporarily be copied into a frame of main memory.
✓ Active processes need to be able to be swapped in and out of main memory in order to maximize
processor utilization
✓ Specifying that a process must be placed in the same memory region when it is swapped back
▪ may need to relocate the process to a different area of memory
Protection
➢ Processes need to acquire permission to reference memory locations for reading or writing purposes
➢ Memory management must allow controlled access to shared areas of memory without compromising
protection
Logical Organization
✓ Main memory is organized as linear or it can be a one-dimensional address space which consists of
a sequence of bytes or words.
✓ Programs can be organized into modules (some of those are unmodifiable (read-only, execute only)
and some of those contain data that can be modified)
✓ Modules can be written and compiled independently
✓ Different degrees of protection given to modules (read-only, execute-only)
✓ Share modules among processes
✓ Segmentation is the tool that most readily satisfies requirements
Physical Organization
❑ The structure of computer memory has two levels referred to as main memory and
secondary memory.
❑ Main memory is relatively very fast and costly as compared to the secondary memory.
❑ Main memory is volatile. Thus secondary memory is provided for storage of data on a
long-term basis while the main memory holds currently used programs.
➢ Swapping
➢ Partitioning
➢ Virtual Memory
➢ Paging
Fragmentation
• As processes are loaded and removed from memory, the free memory space is broken into little pieces.
• It happens after sometimes that processes can not be allocated to memory blocks considering their small size and
memory blocks remains unused.
• This problem is known as Fragmentation.
➢ At some later time, the system swaps back the process from the secondary storage to main memory.
➢ Though performance is usually affected by swapping process but it helps in running multiple and big
processes in parallel and that's the reason Swapping is also known as a technique for memory
compaction.
➢ The total time taken by swapping process includes the time it takes to move the entire process to a
secondary disk and then to copy the process back to memory, as well as the time the process takes
competing to regain main memory.
Swapping
Limitations of swapping
➢ Process must fit into physical memory (impossible to run larger processes)
❖ A computer can address more memory than the amount physically installed on the system. This extra
memory is actually called virtual memory.
❖ Basic idea: allow the OS to hand out more memory than exists on the system.
Physical addresses
❖ Physical memory indexed by physical addresses on bus, in memory
Disk
controller
Paging
60–64K -
➢ It is a memory management scheme that is used to retrieve processes 56–60K -
from the secondary memory (hard disk) in the form of pages and 52–56K -
store them in the main memory. 48–52K 6
➢ Pages of a process are only brought from the secondary memory to 44–48K 5
the main memory when they are needed. 40–44K 1
➢ The main objective of paging is to divide each process into the pages
36–40K -
(of fixed size). 32–36K -
28–32K 3 28–32K
➢ These pages are stored in the frames of main memory. 24–28K - 24–28K
0
1
CPU p d f d
..
.
0
f-1
1
Page address .. f
. f+1
p-1 Frame address f+2
p f
..
.
p+1 physical memory
page table
Page table: Is used to keep track relation
Page address (or) logical address = Page number + offset
between page of a process to a frame in physical
Frame address (or) physical address = frame number + offset memory.
Advantages and Disadvantages of Paging
➢ Due to equal size of the pages and frames, swapping becomes very easy.
➢ This reduces external fragmentation but still suffer from internal fragmentation.
➢ Page table requires extra memory space, so may not be good for a system having small RAM.
THANK YOU
Computer Organization
(EE 311)
➢ When an executing process refers to a page, it is first searched in the main memory. If it is not
present in the main memory, a page fault (or) page miss occurs.
➢ Page Fault is the condition in which a running process refers to a page that is not loaded in the
main memory.
➢ In such a case, the OS has to bring the page from the secondary storage into the main memory.
➢ This may cause some pages in the main memory to be replaced due to limited storage.
➢ A Page Replacement Algorithm is required to decide which page has to be removed.
Page Replacement Algorithm
➢ Page Replacement happens when a requested page is not present in the main memory and the available space
is not sufficient for allocation to the requested page.
➢ Page Replacement Algorithm decides which page to remove, also called swap out when a new page needs to
be loaded into the main memory.
➢ Page replacement algorithm must take the lesser waiting time for page-ins.
➢ A page replacement algorithm tries to select which pages should be replaced so as to minimize the total
number of page misses.
➢ If a process requests for page and that page is found in the main memory then it is called page hit , otherwise
page miss or page fault.
Some Page Replacement Algorithms:
➢ In this algorithm, the OS maintains a queue that keeps track of all the pages in memory, with the oldest page at
the front and the most recent page at the back.
➢ When there is a need for page replacement, the FIFO algorithm, swaps out the page at the front of the queue,
that is the page which has been in the memory for the longest time.
Example for FIFO implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for FIFO implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for FIFO implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for FIFO implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for FIFO implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for FIFO implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for FIFO implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for FIFO implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for FIFO implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for FIFO implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for FIFO implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for FIFO implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
➢ Advantages
➢ Disadvantages
➢ Poor performance.
➢ Doesn’t consider the frequency of use or last used time, simply replaces the oldest page.
➢ Suffers from Belady’s Anomaly (i.e. when we increase the number of page frames, the page faults
will increase).
Least Recently Used (LRU) Page Replacement
Algorithm
❖ It works on the idea that the pages that have been most heavily used in the past are
most likely to be used heavily in the future too.
❖ In LRU, whenever page replacement happens, the page which has not been used
for the longest amount of time is replaced.
Example for LRU implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for LRU implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for LRU implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for LRU implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for LRU implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for LRU implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for LRU implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for LRU implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for LRU implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for LRU implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for LRU implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for LRU implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
➢ Advantages
➢ Efficient.
➢ Doesn't suffer from Belady’s Anomaly.
➢ Disadvantages
➢ Complex Implementation.
➢ Expensive.
➢ Requires hardware support.
Optimal Page Replacement
➢ Optimal Page Replacement algorithm is the best page replacement algorithm as it gives the
least number of page faults.
➢ In this algorithm, pages are replaced which would not be used for the longest duration of
time in the future, i.e., the pages in the memory which are going to be referred farthest in
the future are replaced.
➢ This algorithm was introduced long back and is difficult to implement because it requires
future knowledge of the program behavior. However, it is possible to implement optimal
page replacement on the second run by using the page reference information collected on
the first run.
Example for Optimal Page Implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for Optimal Page Implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for Optimal Page Implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for Optimal Page Implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for Optimal Page Implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for Optimal Page Implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for Optimal Page Implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for Optimal Page Implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for Optimal Page Implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for Optimal Page Implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for Optimal Page Implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
F1
F2
F3
F4
Example for Optimal Page Implementation:
Consider the page reference string of size 12: 1, 2, 3, 4, 5, 1, 3, 1, 6, 3, 2, 3 with frame size 4 (i.e. maximum
4 pages in a frame).
➢ Advantages
➢ Easy to Implement.
➢ Simple data structures are used.
➢ Highly efficient.
➢ Disadvantages