首页 > 其他分享 >COMP SCI 3004/7064 Operating Systems

COMP SCI 3004/7064 Operating Systems

时间:2024-09-17 11:03:26浏览次数:1  
标签:SCI trace simulator COMP 7064 your each memory page

COMP SCI 3004/7064 Operating Systems

Practical 2 – Virtual Memory Simulation

Aim

By doing this practical work, you will learn how to implement page replacement algorithms, gainexperience in creating and evaluating a simple simulator, and develop your skills in scientificwriting.You should work in groups of size 2 or 3. Each group will submit one simulator and one report.

Deadlines: Code is due Tuesday 5th September 2023. Report due end of week 8 - Friday 15th September.

Introduction

In chapter 22, we explore a variety of page replacement algorithms for managing virtual memory.The choice of a page replacement algorithm is actually quite a complex matter. To make theproper choice, we must know something about real applications. How do they access memory? Do

they generate many page accesses in order? Do they skip around memory randomly? The onlyway to answer these questions is to see what real applications do.

In this practical, you will evaluate how real applications respond to a variety of page replacementalgorithms. Of course, modifying a real operating system to use different page replacementalgorithms is quite difficult, so we will simulate it instead. You will write a program that emulatesthe behaviour of a memory system using a variety of page replacement algorithms.

Then, you will use memory traces from real applications to evaluate your algorithms properly. Amain outcome of your work will be a report. The report itself counts for 60% of this assignment.

Memory Traces We provide you with four memory traces to use with your simulator. Each trace is a real recording

of a running program, taken from the SPEC benchmarks. Real traces are enormously big: billionsand billions of memory accesses. However, a relatively small trace will be more than enough tocapture their memory access patterns. Each trace consists of only one million memory accessestaken from the beginning of each program.Each trace is a series of lines, each listing a hexadecimal memory address followed by R or W toindicate a read or a write. For example, gcc.trace trace starts like this:

0041f7a0 R

13f5e2c0 R

05e78900 R

004758a0 R

31348900 W

Each trace is compressed with gzip, so you will have to download each trace and then uncompressit with a command like this:

> gunzip –d gcc.trace.gz

Simulator Requirements

Your job is to build a simulator that reads a memory trace and simulates the action of a virtualmemory system with a single level page table. The current simulator fixes the pages and pageframes size to 4 KB (4096 bytes). Your program should keep track of what pages are loaded intomemory. The simulator accepts 4 arguments as follows:

  • the name of the memory trace file to use.
  • the number of page frames in the simulated memory.
  • the page replacement algorithm to use: rand/lru/esc
  • the mode to run: quiet/debug

If the mode is "debug", the simulator prints out messages displaying the details of each event in

the trace. The output from “debug” it is simply there to help you develop and test your code. If the mode is "quiet", then the simulator should run silently with no output until the very end, at whichpoint it prints代写COMP SCI 3004/7064 Operating Systems out a summary of disk accesses and the page fault rate.As it processes each memory event from the trace, the simulator checks to see if the correspondingpage is loaded. If not, it should choose a page to remove from memory. Of course, if the page to

be replaced is dirty, it must be saved to disk. Finally, the new page is to be loaded into memoryfrom disk, and the page table is updated. As this is just a simulation ofthe page table, we do notactually need to read and write data from disk. When a simulated disk read or disk write mustoccur, we simply increment a counter to keep track of disk reads and writes, respectively.Most of the input (reading a trace), simulation counters and output messages has already beingimplemented in the skeleton files provided for you.The skeleton reads the parameters, processes the trace files and for each access it generates a pageread or write request. Your job is to complete the simulation of the memory management unit for

each replacement policy:

  • rand replaces a page chosen completely at random,
  • lru always replaces the least recently used page
  • clock performs the replacement algorithm described in the textbook section 22.8.

You should start thinking how you can keep track of what pages are loaded, how to find if thepage is resident or not, and how to allocate frames to pages. Some short traces (trace1, trace2 andtrace3) will be used in the testing script and are provided to facilitate local testing of your code.

Report

An important component of this practical is a report describing and evaluating the replacementalgorithms. Your goal is run the simulator to learn as much as you can about the four memorytraces (swim, bzip, gcc and sixpack). For example,How much memory does each traced program actually need?Which page replacement algorithm works best when having a low number of frames?Does one algorithm work best in all situations?Think carefully about how to run your simulator. Do not choose random input values. Instead,explore the space of memory sizes intelligently to learn as much as you can about the nature ofeach memory trace.Your group report should have the following sections:

  • Introduction: A brief section that describes using your own words the essential problem ofpage replacement you are trying to investigate. Do not copy and paste text from thisproject description.
  • Methods: A description of the set of experiments that you performed. As it is impossible torun your simulator with all possible inputs, so you must think carefully about whatmeasurements you need. Make sure to run your simulator with an excess of memory, ahortage of memory, and memory sizes close to what each process actually needs.
  • Results: A description of the results obtained by running your experiments. Present theresults using graphs that show the performance of each algorithm on each memory traceover a range of available memory sizes (alike figures 22.6 to 22.9 in the textbook). Foreach graph, explain the results and point out any interesting or unusual data points.
  • Conclusions: Summarize what you have learned from the results.The group report must be concise, well structured and free of typos and errors. For reference, a

typical report length should be around 4 to 6 pages, roughly one page for the introduction andmethods, half to one page per trace (graph and analysis of its results) and half to one page forconclusions.

标签:SCI,trace,simulator,COMP,7064,your,each,memory,page
From: https://www.cnblogs.com/qq---99515681/p/18416982

相关文章

  • 字符编码发展史1 — ASCII和EASCII
    1.字符集与字符编码1.1.字符集1.2.字符编码1.3.两者的关系2.字符编码的发展历史2.1.第一个阶段ASCII编码2.1.1.ASCII2.1.2.EASCII1.字符集与字符编码1.1.字符集字符集(CharcaterSet或Charset):是一个系统支持的所有抽象字符的集合,也就是一系列字符......
  • 字符编码发展史1 — ASCII和EASCII
    1.字符集与字符编码1.1.字符集1.2.字符编码1.3.两者的关系2.字符编码的发展历史2.1.第一个阶段ASCII编码2.1.1.ASCII2.1.2.EASCII1.字符集与字符编码1.1.字符集字符集(CharcaterSet或Charset):是一个系统支持的所有抽象字符的集合,也就是一系列字符......
  • docker-compose 安装activemq、rocketmq
    目录结构创建目录#activemq目录mkdir-p/docker/activemq/datamkdir-p/docker/activemq/conf#rocket目录mkdir-p/docker/rocketmq/broker1/confmkdir-p/docker/rocketmq/broker1/logsmkdir-p/docker/rocketmq/broker1/storemkdir-p/docker/rocketmq/names......
  • ASCII字符和中文字符的显示
    目录前言ASCII字符的点阵显示获取点阵描点main中文字符的点阵显示指定编码格式汉字区位码汉字点阵显示实验打开汉字库文件编写显示汉字的函数使用lcd_put_chinese函数前言        板子为韦东山老师的imx6ull板,要在LCD上实现字符的显示,要先实现我之前......
  • vue3compute数据不响应的问题
    在vue3中,我们在写前端数据处理的时候,特别是在store中,特别容易代入后端处理思维,本身没有错,但是特别容易导致数据不响应,使用前端js的方式处理就可以解决这一问题,下面就是一些例子forEach用途:执行数组的每一项,不返回结果。示例:javascriptconstnumbers=[1,2,3];......
  • Photoshop启动故障:d3dcompiler_47.dll缺失的应对策略
    面对Photoshop因缺少d3dcompiler_47.dll文件而无法启动的问题,遵循以下细致步骤,逐一排查并修复:1.识别问题根源:•d3dcompiler_47.dll属于Direct3D编译器的一部分,通常与图形处理相关。缺失可能是由于软件更新不完全、系统文件损坏或第三方清理工具误删等原因。2.系统文件检查:......
  • SciTech-Mathmatics-Probability+Statistics-Population:Region-Sampling of Region :
    SciTech-Mathmatics-Probability+StatisticsPopulation:Region-SamplingofRegion:ConfidenceInterval(置信区间)置信区间的理解与应用在我们的统计学系列,已经探索了多个关键概念,从基本的统计学原理到更复杂的假设检验方法。在上一篇文章《统计学入门(三):假设检验的原理与应......
  • Verilog - ASCII码与16进制相互转换(Task语句,多个ASCII码转换)
    编程思想:1.使用case语句,将Ascii码与Hex对应关系连接;2.使用Task语句将Ascii码转Hex作为一个任务3.调用Task语句,将8bit Ascii码转换为4bitHex数据4.将n个8bitASCII转为n个4bitHex数据进行数据拼接,输出n*4bitHEX数据moduleascii_to_hex(input......
  • SciTech-Mathmatics-Probability+Statistics-Descriptive Statistics I + II(using Py
    LearnStatsforPython:DescriptiveStatisticsILearnStatsforPython:DescriptiveStatisticsII+DataVisualizationBYIVÁNPALOMARESCARRASCOSAPOSTEDONAUGUST28,2024Intoday'sworld,pervadedbydataandAI-driventechnologiesandsolutions,......
  • [Javascript Vue] Improve heavy component loading performance
    Let'ssaywehaveaVueapplicationthatrendersmanyheavycomponentsonthefirstload.Theproblemwe'refacingisalongwhitescreenperiodwhileJavaScriptisloadingandthebrowserispainting.Howcanweoptimizeperformance?Sincethe......