Professional Documents
Culture Documents
Saugat Adhikari
Saugat Adhikari
2019-20 Autumn
Table of Contents
1. Task A ........................................................................................................................... 1
1.1 Introduction ................................................................................................................. 1
1.2 Script ........................................................................................................................... 2
1.3 Testing......................................................................................................................... 9
1.4 Contents of three files: (TEXTS)................................................................................ 26
• PK: ....................................................................................................................... 26
• VK: ....................................................................................................................... 26
• RT: ....................................................................................................................... 26
1.5 Conclusion ............................................................................................................ 27
2. Task B............................................................................................................................. 28
2.1 Introduction ............................................................................................................... 28
2.2 Aims and Objectives .................................................................................................. 29
2.3 Background: .............................................................................................................. 30
2.3.1 Hierarchy of Memory Management ..................................................................... 32
2.3.3 Locality of Reference .......................................................................................... 34
2.3.3 Memory Allocation ............................................................................................. 35
2.3.4 Dynamic Storage Allocation ................................................................................ 38
2.3.5 Description of Paging and Segmentation ............................................................. 40
2.4 Conclusion................................................................................................................. 44
3. References ................................................................................................................... 45
4. Bibliography ................................................................................................................ 46
5. Appendix ........................................................................................................................ 47
5.1 Memory Controller ............................................................................................... 47
5.2 Virtual Memory .................................................................................................... 48
5.3 Locality of Reference ............................................................................................ 50
SAUGAT ADHIKARI 18029221
Table of Figures
Table of Tables
1. Task A
1.1 Introduction
A shell script is a Computer program that is supposed to be managed by the UNIX shell which
is a charge line translator. Standard shell-script activities include record management, program
execution, and text printing. A shell script can offer an advantageous variety of a system order
where special context conditions, paying alternatives, or post-transforming are added, but in a
way that also enables the new script to go around like a fully normal UNIX request. (Kaushik
et al., 2014) There are many advantages of shell programming; such as it is easy to use and has
an interactive debugging and shell scripts can be executed effortlessly between many modern
UNIX/ Linux/ BSD/ Mac OS X operating systems. (Kaushik et al., 2014)
The objective of this coursework is to develop a program using a bash shell script that
implements interaction with the UNIX environment in a friendly manner and shows proper
knowledge of input/output operations. There are various types of shells available inside the
UNIX system; such as Bash Shell, Bourne Shell, Korn Shell, Z Shell, C Shell, etc. The code in
this coursework will be developed in a bash shell inside a Debian command-line environment.
Bourne again shell or Bash shell is used for this coursework as it supports Job control,
command-line editing, unlimited size command history, etc.
1|Page
SAUGAT ADHIKARI 18029221
1.2 Script
#!/bin/bash
#
SAUGAT ADHIKARI L2N7 [18029221]
# Validating the number and nature of arguments passed into the function by
the user. The program will exit everytime until the correct
# number of parameters are passed.
# Declaring a regural expresssion that holds any number from 0 to 9.
re='^[0-9]+$'
# If both the username and id are left blank, the following message will
pop up.
if [[ $user_name == "" && $user_id == "" ]]
then
echo -e "\n No parameters found. Please enter first name and then the ID
number sperated by a space. \n"
exit
# Checking if the user provides more than two arguments.
elif [[ $# -gt 2 ]]
then
echo -e "\n Invalid number of parameters found.Please enter first name
and then the ID number sperated by a space. \n"
exit
# Checking if the user provides less than two arguments.
elif [[ $# -lt 2 ]]
then
echo -e "\n Invalid number of parameters found.Please enter first name
and then the ID number sperated by a space. \n"
exit
# Checking the username input of the user against the regular expression.
If it is true, then a invalid input message pops up.
elif [[ $user_name =~ $re ]]
then
echo -e "Invalid input. Username cannot be a number. \n"
echo -e "Please try again. Please enter first name and then the ID
number sperated by a space. \n"
exit
fi
# Checking if the user inputs number when asked for user ID.
until [[ $user_id =~ $re ]]
do
echo -e "Invalid input. User ID cannot be a string. \n"
echo -e "Please try again. Please enter first name and then the ID
number sperated by a space. \n"
exit
done
2|Page
SAUGAT ADHIKARI 18029221
#when all the five chances are exploited, the program exits on the user.
if [ $chance == 0 ]
then
echo -e "Sorry, You cannot be verified. \n"
echo -e "Bye $user_name! \n"
figlet BYE!!
# This lets the program sleep for a second before exiting.
sleep 1
exit
fi
done
}
# Function for storing country names and codes along with verifications.
country_choice() {
# This is a table that depicts all the available countries and codes.
echo -e "These are the available countries and their respective codes. \n"
echo "****************************************"
echo -e "COUNTRY \t\t CODE"
echo "---------------------------------------"
echo -e "Australia \t\t AUS"
3|Page
SAUGAT ADHIKARI 18029221
# Declaring a function that asks user for the best cricket team in order to
decrease redundacy.
team_choice () {
echo -e "Please enter the code(case sensitive) of the best cricket team:-
\c"
read user_team
}
team_choice
# until loop that doesnt break ends until the user input is three
characters.
until [ ${#user_team} == 3 ]
do
echo -e "Invalid input. Please enter the three letter code. \n"
team_choice
done
# Until loops goes on executing until the team selected by the user is
England (favourite team).
until [[ $user_team == $fav_team ]]
do
echo -e "Unfortunately, you have choosed the wrong team. \n"
team_choice
done
4|Page
SAUGAT ADHIKARI 18029221
name_loop
# Defining a custom prompt for the select loop inside a shell script, using
the PS3 environment variable.
PS3="Please choose one of the following option:- "
select user_option in $player1 $player2 $player3
do
# This is a case function that matches the user input against various
conditions.
case $user_option in
$player1 )
# the following condition checks if the stated file exists in the current
directory or not.
if [ -e $player1.txt ]
then
# If the file is available, this command reads into the file.
cat $player1.txt
program_replay
else
echo -e "The reuqested file cannot be
found. You will have to start again by the choosing the best cricket team.
\n"
sleep 1
# If the file requested by the user cannot be found, the program restarts
itself back to choosing best team step.
country_choice
player_choice
fi
break
;;
$player2 )
if [ -e $player2.txt ]
then
cat $player2.txt
program_replay
else
echo -e "The reuqested file cannot be
found. You will have to start again by the choosing the best cricket team.
\n"
sleep 1
country_choice
player_choice
fi
break
;;
$player3 )
if [ -e $player3.txt ]
then
5|Page
SAUGAT ADHIKARI 18029221
cat $player3.txt
program_replay
else
echo -e "The reuqested file cannot be
found. You will have to start again by the choosing the best cricket team.
\n"
sleep 1
country_choice
player_choice
fi
break
;;
# Checking for any invalid input by the user other than the provided
options.
* )
echo -e "This an invalid input. Please try again.
Choose from option 1,2 and 3. \n"
;;
# End of case.
esac
# End of select.
done
# Funtion that prompts user to enter the code for three best cricketers.
name_loop(){
echo -e "Enter the codes(case sensitive) for three best cricketers
separated by a space:- \c"
read player1 player2 player3
read player1 player2 player3
# Calling the named function that validates the user input against the
appropriate player codes.
player_valid
}
player_valid () {
# Declaring a flag variable that is used as a counter into the while loop.
flag_var=1
while [ $flag_var = 1 ]
do
# Validating if the user provides all three required codes or leaves any
argument empty.
if [[ -z $player1 ]] | [[ -z $player2 ]] |
[[ -z $player3 ]]
then
echo -e "You have entered invalid
number of codes. Please enter all three codes. \n"
echo -e "NOTE: The codes are case
sensitive and must be sperated by a space. \n"
name_loop
else
# while loop ends with the following declaration.
flag_var=0
fi
done
6|Page
SAUGAT ADHIKARI 18029221
# Validating the user input codes against the available codes of the
cricket players.
until [ $player1 == "VK" ] || [ $player1 == "PK" ]
|| [ $player1 == "DW" ] || [ $player1 == "BS" ] || [ $player1 == "RT" ]
do
echo -e "The first code you have entered is
wrong. Please refer to the table and try again. \n"
name_loop
done
# Function that prompts the user if he/she wants to restarts the program or
just end it.
program_replay() {
"N" )
echo -e "Thank you $user_name for running this program. \n"
echo
figlet BYE!
sleep 1
exit
;;
* )
7|Page
SAUGAT ADHIKARI 18029221
8|Page
SAUGAT ADHIKARI 18029221
1.3 Testing
Expected Output The script must not let the user enter the
program and prompt an error message
regarding the missing arguments.
Actual Output The script did not let the user enter the
program and showed an alert message
regarding the missing arguments.
Table 1: Testing no. 1
9|Page
SAUGAT ADHIKARI 18029221
Expected Output The script must execute and ask for the secret
key to enter the program.
Actual Output The script did execute and asked the user for
the secret key to enter the program.
Table 2: Testing no. 2
10 | P a g e
SAUGAT ADHIKARI 18029221
Input 123
Expected Output The program must not start, and the user
must be alerted about the wrong secret key.
11 | P a g e
SAUGAT ADHIKARI 18029221
Expected Output The program must provide the user with only
five chances and finally exit.
Actual Output The program did provide the user with only five
chances and exit at the end.
Table 4: Testing no. 4
12 | P a g e
SAUGAT ADHIKARI 18029221
13 | P a g e
SAUGAT ADHIKARI 18029221
Input AS
Expected Output The program must alert the user about the
correct format of the code and let the user try
again until correct.
Actual Output The program did alert the user about the correct
format of the code and let the user try until
correct.
Table 5: Testing no. 5
14 | P a g e
SAUGAT ADHIKARI 18029221
Input BAN
Expected Output The program must alert the user about the wrong
team selection and let the user try again until
correct.
Actual Output The program did alert the user about the wrong
team selection and let the user try until correct.
Table 6: Testing no. 6
15 | P a g e
SAUGAT ADHIKARI 18029221
Input 3) BS
Expected Output The program must alert the user about his/her
wrong choice and unavailability of the file and
then redirect the user back to the part where
he/she have to choose the best team.
Actual Output The program did alert the user about the wrong
choice of the player and unavailability of the file
and then redirected the user back to the part
where he/she have to choose the best team.
Table 7: Testing no. 7
16 | P a g e
SAUGAT ADHIKARI 18029221
Input 9841
Actual Output The program did welcome the user into the
program by his/her id, first name and date and
time of execution.
Table 8: Testing no. 8
17 | P a g e
SAUGAT ADHIKARI 18029221
Input ENG
18 | P a g e
SAUGAT ADHIKARI 18029221
Input PK VK RT DW
Expected Output The program must alert the user about wrong
number of player codes and let him/her try until
correct number of codes are entered.
Actual Output The program did alert the user about wrong
number of player codes and let him/her try until
correct number of codes are entered.
Table 10: Testing no. 10
19 | P a g e
SAUGAT ADHIKARI 18029221
Input 1) PK
20 | P a g e
SAUGAT ADHIKARI 18029221
Input 5
Expected Output The program must alert the user about the wrong
option and let the user try until the correct option
is selected.
Actual Output The program did alert the user about the wrong
option and let the user try until the correct option
is selected.
Table 12: Testing no. 12
21 | P a g e
SAUGAT ADHIKARI 18029221
Input Y
Expected Output The program must ask the user if he/she wants
to replay the program and do so if he/she enters
Y.
Actual Output The program did ask the user if he/she wants to
replay the program and did replayed the
program when the input is Y.
Table 13: Testing no. 13
22 | P a g e
SAUGAT ADHIKARI 18029221
Input N
Expected Output The program must exit if the user doesn’t want
to replay the program.
Actual Output The program did exit when the user entered N.
23 | P a g e
SAUGAT ADHIKARI 18029221
Input Nil
Expected Output The program must alert the user about the wrong
input and then ask the question again.
Actual Output The program did alert the user about his/her
wrong input and prompted again about the
replay program.
Table 15: Testing no. 15
24 | P a g e
SAUGAT ADHIKARI 18029221
Expected Output The program must alert the user about the wrong
input that userID cannot be a string.
Actual Output The program did alert the user about the wrong
input that userID cannot be a string.
Table 16: Testing no. 16
25 | P a g e
SAUGAT ADHIKARI 18029221
• PK:
. Paras Khadka is a Nepalese cricketer and former captain of the Nepalese cricket team.
• VK:
Virat Kohli is a famous Indian Cricketer who currently captains the Indian Cricket
Team.
• RT:
Luteru Ross Poutoa Lote Taylor is an international cricketer and former captain of the
New Zealand national team.
Batting predominantly at number four, he is the leading run-scorer for New Zealand in
Test cricket.
26 | P a g e
SAUGAT ADHIKARI 18029221
1.5 Conclusion
The report is developed by the culmination of good literature, research and meets the
coursework guidelines. The program developed in this coursework was made and executed in
a bash shell. The shell script follows all the requirements of the coursework; i.e.
implementation of all the required control structures ( if-else, until, while, case and select) and
unhindered running of the program. Similarly, the code is not long and repetitive and is well
commented on required places, uses appropriate variable names, provides complete error
checking for user input and alerts error messages at the user when required. Furthermore,
several functions have been declared and called upon when required. Finally, the
documentation depicts a brief introduction of the shell environment, along with the whole code
and an adequate number of testing scenarios of both valid and invalid input. Thus, this
coursework has helped in developing a shell script that handles and executes simple
input/output operations.
27 | P a g e
SAUGAT ADHIKARI 18029221
2. Task B
2.1 Introduction
Now a days the computer science markets are experiencing major changes as new innovations
are being developed, heading towards big data etc. Modern computer systems must conform to
specifications, such as efficient memory management, resource management, efficient
execution process, virtual memory management, effective inter-process connectivity, decent
user interface, etc (Patil & Irabashetti, 2014). Memory Management is a very complex aspect
of operating system architecture as it is physical level related. It is loosely divided into three
parts: memory management of the hardware, operating system memory management, and
memory management at the application level (Patil & Irabashetti, 2014). Memory management
is a method of allocating memory during runtime of the program, using it, and releasing it when
finished with it. The key aim of this is to control machine level computer memory (Gandotra,
2015).
This is a technical report that covers all the major components of Memory Management; such
as, History of memory management, hierarchy of memory management, memory allocation
and its techniques, virtual memory, etc. The report shows the in-depth working mechanism of
various memory management techniques that are used in a computer system along with
comparisons and analysis.
28 | P a g e
SAUGAT ADHIKARI 18029221
Aims:
➢ The aim of this report was to facilitate the reader with a technical report that depicts all
the techniques and concepts under Memory Management.
➢ The aim of this report was to demonstrate that genuine and adequate amount of research
materials have been referenced and studied for the completion of this report.
Objectives:
➢ To briefly define the nature and requirements of this technical report.
➢ To provide a brief history of memory management and computer memory in general.
➢ To illustrate the meaning of memory management and its importance in computer
systems.
➢ To demonstrate various memory allocation techniques that are used in memory
management process.
➢ To compare the working mechanism of these techniques along with their pros and cons.
➢ To enlighten reader with the importance of memory management and its requirement
in modern computing advancements.
29 | P a g e
SAUGAT ADHIKARI 18029221
2.3 Background:
In the early days of computers in 1945, John von Neumann wrote a draft of a computer system
called the EDVAC that had a memory device connected to an arithmetic device and a control
unit. The 1960s and 1970s saw the widespread use of magnetic core memory that had no
moving components, unlike drum memories, which allowed unlimited access to every word in
memory (Nair, 2015). During the 1970s, central memory was replaced by memories in
semiconductors. The memory industry has been revolutionized by the advent of the dynamic
random-access memory (DRAM), in particular the single transistor DRAM cell (R. H., 1968).
30 | P a g e
SAUGAT ADHIKARI 18029221
31 | P a g e
SAUGAT ADHIKARI 18029221
Memory Hierarchy is an idea necessary for the CPU to control the data. Memory Hierarchy is
a computing concept used by scientists to describe various ways that a program manages
memory, whether it is transient or permanent (Jain et al., 2018). In the Hierarchy below,
computer memory is defined:
1. Registry Files:
Current processors use register files to store the data, and also spread transitional
computation results in Memory Hierarchy. The Registry Files is the maximum amount
in various ways (Jain et al., 2018). Register Files are agreed upon and regulated by
contradictory criteria. The strain on Register Files is strong in many thread processors
such that a huge amount of thread background is billeted Register Files will be shielded
from simple errors and it is also significant as any soft error propagates easily to another
device (Jain et al., 2018).
32 | P a g e
SAUGAT ADHIKARI 18029221
2. Cache Systems:
But with the technology's accuracy, microprocessors are often seen as faster than the
Main Memory. Storage access time is a slow blockage in the application's total
performance (Jain et al., 2018). One way this issue is so complicated is by inserting a
limited high-speed buffer memory between the supercomputer and the main memory.
In short, such a buffer is usually referred to as cache or archive (Jain et al., 2018).
Mainly, cache memory is divided into three levels: Level 1 (L1), Level 2 (L2) and Level
3 (L3).
Random Access Memory is the location (hardware) on a computer where the present
configuration of the operating system, data and application programs is stored so that
the device's processor can easily access them for the actual image used inside the
application (Jain et al., 2018)s. RAM is much faster than all of this in reading and
writing from any form of storage in a computer (hard disk, CD -ROM, and floppy disk)
(Jain et al., 2018).
33 | P a g e
SAUGAT ADHIKARI 18029221
4. Hard Disk:
Hard disk drives are energy-independent computer memory, fairly inexpensive and
have a large size. HDD uses one or two disks on a standard spindle, known as the disk
pack. Every plate is covered by a magnetic layer on which a magnetic head stores and
reads information (Toncho & Yordanka, 2018).
The word locality of reference refers to the fact that the sequence of memory addresses
accessed by a program during its execution typically has some predictability. Programs are
known to show temporal localization if they several times visit the same memory location
within a short time span (Padua & Pingali, 2011). There are three kinds of locality of reference:
temporal, spatial, and network. Brief introduction of different types of locality of reference is
provided here.
Cache memories exploit the temporal and spatial reference position to provide programmers
with the output features of a massive, powerful memory device but at affordable cost. The key
is a hierarchical management structure, generally known as the hierarchy of memories (Padua
& Pingali, 2011).
34 | P a g e
SAUGAT ADHIKARI 18029221
Memory management maintains track of of and every memory position, regardless of whether
it's allocated to any method or free. It determines how much memory to delegate to processes.
It decides at what time which process will get the memory. Whenever some memory is freed
or unallocated, it tracks and updates the status accordingly (Mali et al., 2019). Most computer
systems use two techniques for memory allocation as shown below:
In Static memory allocation, the memory is allocated to the variables of the program
at the beginning of execution. In this, even though much of the memory is not used
in a specific program instance or variable, we should not use reserved memory for
any other purpose (Mali et al., 2019).
35 | P a g e
SAUGAT ADHIKARI 18029221
Allocation is done before the program is Allocation is done while the program is
executed. executing.
Stack data structure is used for implementing Heap data structure is used for implementing
static memory allocation. dynamic memory allocation.
It is best if required size is known in advance. It is best if we don’t have knowledge about
how much memory is required.
Table 17: Comparison between Static and Dynamic Memory Allocation (Mali et al., 2019)
Single distribution is the easiest method for handling memories. The entire
computer's memory is accessible to the single program, usually except for a limited
portion reserved for the operating system (Tamunoomie & Ledisi, 2015). A device
that uses a single contiguous allocation can also be multitasking by switching
memory contents to differentiate between applications. This method was used in
early versions of the Music operating system (Tamunoomie & Ledisi, 2015).
Partitioned Allocation:
Partitioned division splits the main memory into several partitions of memory,
typically adjacent memory regions. Every partition may contain all of the
information for a particular job or mission. Memory management involves
36 | P a g e
SAUGAT ADHIKARI 18029221
assigning a partition to a task as it begins and unallocating it until the task finishes
(Tamunoomie & Ledisi, 2015).
Figure 23: Memory Management Techniques Comparison (Muazzam & Nauman, 2013)
37 | P a g e
SAUGAT ADHIKARI 18029221
Because of the importance of dynamic memory management in the operating system, both
conventional and modern memory allocation algorithms use dynamic memory allocation
schemes to assign resources at runtime from the heap (Puaut, 2002). Sequential Fit algorithm,
as the name implies, uses the free blocks of memory in linear order in the form of a list called
free list. And from this free list memory blocks are assigned using pointer in various ways
depending on the condition in hand (Muhammad , 2016). There are four different strategies
used by sequential fit algorithm as discussed below:
First-Fit: First fit is the simplest technique followed by sequential fit, as the first available
memory block that is greater or equal to the required memory is rendered irrelevant
(Muhammad , 2016).
Best-Fit: Searching through the list of available openings, best-fit assigns to the smallest space
that is wide enough to handle the mechanism that is going in (Muhammad , 2016).
Next-Fit: The next fit is identical to the first fit except it begins to scan the list from the place
where the last scan ended and fits the next memory block open (Muhammad , 2016).
Worst-Fit: It is contradictory to best fit because it will always return the maximum available
memory block (Muhammad , 2016).
In the next figure, sequential fit algorithms are shown in action. Red block means the already
used memory blocks that can't be used when the remaining memory blocks are ladled with the
power. After 1k memory first the current pointer location is shown (Muhammad , 2016). In the
figure, we can see the execution of this algorithm if 2k memory is demanded by application.
38 | P a g e
SAUGAT ADHIKARI 18029221
39 | P a g e
SAUGAT ADHIKARI 18029221
Paged Allocation partitions the main memory of the machine into units of fixed size called
page frames, and the virtual address space of the program into pages of the same length. The
Memory Management Unit for Hardware maps pages to objects. Although the address space
is continuous, the actual memory may be reserved on a page basis (Tamunoomie & Ledisi,
2015). Paged memory can be demand-paged when the device is able to transfer pages between
primary and secondary memory as required (Tamunoomie & Ledisi, 2015).
Benefits:
Weaknesses:
40 | P a g e
SAUGAT ADHIKARI 18029221
41 | P a g e
SAUGAT ADHIKARI 18029221
Segmentation is a memory-management scheme which supports user view of the memory (M.
et al., 2016). Segmented memory is the only strategy that does not have a 'linear and contiguous
address space' for the user's program. Segments are memory regions, which typically
correspond to a specific knowledge classification (Tamunoomie & Ledisi, 2015). A segment
is a logical unit such as:
1. Main Program
2. Procedure
3. Function
4. Method
5. Object
6. Stack
7. Arrays
8. Global and Local Variables
9. Common Block
42 | P a g e
SAUGAT ADHIKARI 18029221
Memory segmentation is the separation into parts or portions of a computer's main memory. A
reference to a memory location in a computer system using segmentation includes a value
which defines a segment and an offset (memory location) within that segment (M. et al., 2016).
Segments typically refer to a program's normal divisions such as function routines or data tables
such that segmentation is often more apparent to the programmer than just paging. Specific
segments may be generated for specific software components, or for particular memory use
classes such as code and data segments (M. et al., 2016).
Benefits:
➢ Segmentation lets you improve processing speed so the processor can get the data from
the memory much quicker.
➢ No internal fragmentation.
Weaknesses:
43 | P a g e
SAUGAT ADHIKARI 18029221
2.4 Conclusion
Applications and operating systems cannot survive in the recent era of computing without
efficient memory management, particularly if an application has to be under severe load for
unknown long time. Efficient utilization of energy must be made of to boost efficiency. Real
time systems require timely and intelligent memory usage to work effectively otherwise the
purpose of real time systems will be to lose (Muhammad , 2016) . In the meantime, computation
has been ubiquitous over the years. The computing needs cannot be determined any further by
the criteria of a single computer or even a single device (Nair, 2015). Instead today's
computation includes data collection in a wide linked universe. In order to keep up with these
new demands, paradigms for using and programming computers have also shifted, and so the
function of memory also has changed (Nair, 2015).
This paper depicts the true understanding of memory management and various techniques and
algorithms used by modern operating systems for its implementation. Adequate research and
analysis from various journals, conference proceedings, articles and books have been
extensively carried out for the completion of this report. The advantages and disadvantages of
various types of memory management and allocation techniques have been discussed in
detailed manner. Hence, the concluding remark of this paper is that the memory management
techniques must be drastically changed in order to cope with the modern computing
requirements.
44 | P a g e
SAUGAT ADHIKARI 18029221
3. References
Abraham, S., Greg, G. & Peter, B.G. (2012) Operating System Concepts. 9th ed. John Wiley
& Sons, Inc.
Chaplot, D.V. (2016) Virtual Memory Benefits and Uses. International Journal of Advance
Research in Computer Science and Management Studies , 4(9).
Jain, M., Patil, D., Parikh, T. & Naidu, A. (2018) Review on memory divisions in computer
architecture. International Journal of Advance Research, Ideas and Innovations in Technology
, 4(6).
Kaushik, K., Yadav, J. & Bhatia, K. (2014) Shell Script & Advance Features of Shell
Programming. International Journal of Computer Science and Mobile Computing, 4(4),
pp.458-62.
M., P., A.R., V. & E.M., S. (2016) Segmentation in Operating System with Memory
Management. International Journal of Trend in Research and Development, 3(5).
Mali, S., Dohe, S. & Rangdal, P. (2019) Memory Management Techniques: Static and
Dynamic Memory Allocation. International Journal of Current Engineering and Technology,
9(1).
Montage Technology. (2019) M88DDR4DB01 - Gen1 DDR4 Data Buffer (DB) [Online].
Available from: http://www.montage-tech.com/DDR4/id/6.html [Accessed 6 April 2020].
Muazzam, A.K. & Nauman, N. (2013) Comparison and Review of Memory Allocation and File
Access Techniques and Techniques preferred for Distributed Systems. Islamabad: National
University of Sciences and Technology.
Muhammad , A.A. (2016) Memory Management: Challenges and Techniques for Traditional
Memory Allocation Algorithms in Relation with Today's Real Time Needs. INTERNATIONAL
JOURNAL OF MULTIDISCIPLINARY SCIENCES AND ENGINEERING, 7(3).
45 | P a g e
SAUGAT ADHIKARI 18029221
Padua, D. & Pingali, K. (2011) Locality of Reference and Parallel Processing. In Encyclopedia
of Parallel Computing. Boston: Springer.
Patil, N.V. & Irabashetti, P.S. (2014) Dynamic Memory Allocation: Role in Memory
Management. International Journal of Current Engineering and Technology, 4(2).
Tamunoomie, G.S. & Ledisi, G.K. (2015) Efficiency of Memory Allocation Algorithms Using
Mathematical. International Journal of Emerging Engineering Research and Technology, 3(9).
Toncho, N.T. & Yordanka, I.Y. (2018) Comparative Analysis Between Hard Disk Drive and
Solid-State Drive. Journal of Physics and Technology, 2(1), pp.41-45.
Villinger, S. (2019) What is RAM and Why is it Important? [Online]. Available from:
https://www.avast.com/c-what-is-ram-memory [Accessed 3 April 2020].
4. Bibliography
Allan, B., Sandy, I. & Prabhakar, R. (1995) Competitive Paging with Locality of Reference.
Journal of Computer and System Sciences, 50, pp.244-58.
Anderson, T. & Dhalin, M. (2015) Operating Systems Principles & Practice. 2nd ed. Recursive
Books, Ltd.
Pavel, Y., Alex, I. & Mark, R.E. (2017) Windows Internals Seventh Edition Part 1. 7th ed.
Washington: Microsoft Press.
46 | P a g e
SAUGAT ADHIKARI 18029221
5. Appendix
Memory modules are present in in all applications and high speed and high capacity memories
are in great demand today. The controllers are to be equipped with clock frequency in the
megahertz range for greater performance and efficiency (Ramagiri Ramya, 2016). As the
controller's clock speed increases, so too are the architecture problems becoming complex . In
applications that do not have microprocessors (high-end systems), a Dedicated Memory
Controller is of prime importance. The Memory Controller supplies SDRAM reset, read and
write operation and initialization order signals for the rom (Ramagiri Ramya, 2016). Thanks to
its speed and pipeline capability Synchronous DRAM (SDRAM) is used in embedded device
memory architecture. In high-end devices, such as microprocessors, different peripherals may
be built in to support the SDRAM interface. Yet the system designer will design a different
memory controller for other programs to provide command signals for memory update, read
and write operation, and SDRAM initialization (Ramagiri Ramya, 2016).
47 | P a g e
SAUGAT ADHIKARI 18029221
Virtual memory is secondary memory capable of functioning as a part of the primary memory.
Digital memory is used as RAM until the RAM is used up. The hard disk is much slower than
RAM and the quicker the machine can run the more virtual memory it requires (Chaplot, 2016).
The computer will scan for locations that are not in use on the RAM and then copy it to the
hard disk to free up space on the RAM. Virtual memory keeps the machine 'running' in the
RAM and leaves the processes 'inactive' on the disk's address space. Where an 'inactive' process
is required, the process will be taken back from the disk to the RAM (Chaplot, 2016).
The idea of computer memory is applied using the principle of demand paging. In demand
paging a process is separated into separate pages and each page has a specific address and at
one point all the pages of a process are not taken into the main memory only some of the pages
connected to the processes are added as it is presumed that during the given time we do not
require all the processes in the memory for execution of program only some of the pages are
needed, remaining pages can be brought on the demand (Chaplot, 2016). The idea of virtual
memory is very useful in enhancing memory use but often this function is achieved at the
expense of missing some essential records. Through using this idea as a synthetic virtual
memory model, we will use this principle to boost the performance of computer system in a
more practical way (Chaplot, 2016).
Advantages:
48 | P a g e
SAUGAT ADHIKARI 18029221
Disadvantages:
49 | P a g e
SAUGAT ADHIKARI 18029221
1. Temporal Locality:
If the occurrences of a given memory address in its memory trace occur close to each
other, a program execution exhibits temporal localization. A system is assumed to
exhibit temporal locality if its executions exhibit temporal locality for most value inputs
(Padua & Pingali, 2011).
2. Spatial Locality:
3. Network Locality:
50 | P a g e