国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代寫 COMP 310、代做 java/Python 程序
代寫 COMP 310、代做 java/Python 程序

時間:2025-04-14  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯



Operating Systems COMP 310 – ECSE 427 McGill University Project Part #3: Memory Management
Due: April 4, 2025 at 23:59
1. Assignment Description
This is the final assignment. After implementing the memory manager, you will have built a simple, simulated OS. So far, our simulated OS supports simple Shell commands and is capable to do process management according to different scheduling techniques. The assumption in the second assignment was that processes fully fit in the Shell memory (like what we saw in the Virtual Memory lecture). In this assignment, we will extend the simulation with demand paging.
1.1 Starter files description:
You have two options:
• [Recommended] Use your solution to Assignment 2 as starter code for this assignment. If your solution passes the public unit tests it is solid enough to use as a basis for the third assignment.
• Use the official solution to Assignment 2 provided by the OS team as starter code.
1.2 Your tasks:
Your tasks for this assignment are as follows:
• Add scaffolding for paging.
• Design and implement demand paging.
• Implement the LRU replacement policy in demand paging.
On a high level, in this assignment we will allow programs larger than the shell memory size to be run by our OS. We will split the program into pages; only the necessary pages will be loaded into memory and old pages will be switched out when the shell memory gets full. Programs executed through both the source and the exec commands need to use paging. In addition, we will further relax the assumptions of exec by allowing the same program to be executed multiple times by exec (remember that in Assignment 2 the programs run by exec needed to be different).
For simplicity, in our tests for this assignment we will
However, the paging mechanism will work with the other scheduling policies as well, if it is implemented
correctly. The API for exec does not change, so you still need to specifically pass the RR argument. More details on the behavior of your memory manager follow in the rest of this section. Even though we
will make some recommendations, you have full freedom for the implementation. In particular:
• Unless we explicitly mention how to handle a corner case in the assignment, you are free to handle corner cases as you wish, without getting penalized by the TAs.
• You are free to craft your own error messages (please keep it polite).
Balmau, Kopinsky Assignment #3 Page 1 of 7
  Similar to Project Part 2, this assignment is larger than Part 1 and MP.
 Plan your time wisely and don’t hesitate to ask questions on Discord if you get stuck.
   only consider the RR (round robin) policy, with a
 time slice of 2 instructions, with no multithreading and no background execution (the # parameter).

Operating Systems COMP 310 – ECSE 427 McGill University
• Just make sure that your output is the same as the expected output we provide in the test cases in Section 2.
• Formatting issues in the output such as tabs instead of spaces, new lines, etc. will not be penalized.
Let’s start programming!☺
1.2.1. Implement the paging infrastructure
We will start by building the basic paging infrastructure. For this intermediate step, you will modify the source and exec commands to use paging. Note that, even if this step is completed successfully, you will see no difference in output compared to the source/exec commands in Assignment 2. However, this step is crucial, as it sets up the scaffolding for demand paging in the following section.
As a reminder from Assignment 1, the source API is:
source SCRIPT Executes the commands in the file SCRIPT
source assumes that a file exists with the provided file name, in the current directory. It opens that text file and then sends each line one at a time to the interpreter. The interpreter treats each line of text as a command. At the end of the script, the file is closed, and the command line prompt is displayed.
The exec API is: exec prog1 prog2 prog3 POLICY
• As in Assignment 2, we will not be testing recursive exec calls.
• Unlike Assignment 2, exec now supports running the same script (i.e., exec can take identical
arguments so exec prog1 prog1 is a legal instruction).
You will need to do the following to implement the paging infrastructure.
1. Set up process sharing.
o Whenexecispassedthesamescriptnametwice,wewillwanttosharememorybetween them. Modify your existing code loading setup from A2 so that two scripts with the same name can share their loaded code. If you loaded code contiguously, you have something like base+bounds virtual memory. Allow multiple processes with the same name to use the same base and bounds.
2. Partitioning the Shell memory. The shell memory will be split into two parts:
o Frame store. A part that is reserved to load pages into the shell memory. The number of lines in the frame store should be a multiple of the size of one frame. In this assignment, each page consists of 3 lines of code. Therefore, each frame in the frame store has 3 lines. If you implemented code memory separately from variable memory in A2, then there’s
probably very little to do here.
o The frame size of 3 is an unfortunate complication (a power of two would
usually make more sense). We have set it up this way so that we can test interesting cases of demand paging without having you implement more scheduling policies. For address translation, you can will probably want to use the / and % operators to separate the page number and offset respectively.
o Variable store. A part that is reserved to store variables.
Balmau, Kopinsky Assignment #3 Page 2 of 7

Operating Systems COMP 310 – ECSE 427 McGill University
You are free to implement these two memory parts as you wish. For instance, you can opt to maintain two different data structures, one for loading pages and one for keeping track of variables. Alternatively, you can keep track of everything (pages + variables) in one data structure and keep track of the separation via the OS memory indices (e.g., you can have a convention that the last X lines of the memory are used for tracking variables). We think maintaining separate data structures is easier.
For now, the sizes of the frame store and variable store can be static. We will dynamically set their sizes at compile time in the next section.
3. Code loading. The shell will load script(s) into the frame memory as follows.
o The given script files are used to load program pages into the frame store. If exec receives the
same filename more than once, it is only loaded once.
o At this point, you will load all the pages into the frame store for each program. This will change
in the next section. Unlike Assignment 2, where you were encouraged to load the scripts contiguously into the Shell memory, in this assignment the pages will not be contiguously loaded. For example, you can load into memory as follows for 2 programs that each have 2 pages (i.e., 6 lines of code per program). Experiment with different orders to check that your paging implementation is working.
Frame store
                                       0
                                       1
                                       2
                                       3
                                       4
                                       5
                                       6
                                       7
                                       8
                                       9
                                      10
                                      11
                                      12
o However, for grading purposes, when a page is loaded into the frame store, it must be placed in the first free spot (i.e., the first available hole).
4. Creating the page table. For each script, a page table needs to be added to its PCB to keep track of the loaded pages and their corresponding frames in memory. You are free to implement the page table however you wish. A possible implementation is adding a page table array, where the values stored in each cell of the array represent the frame number in the frame store. For instance, in the example above, the page tables would be:
Prog 1:
pagetable[0] = 1 //frame 1 starts at line 3 in the frame store
pagetable[1] = 3 //frame 3 starts at line 9 in the frame store Prog 2:
pagetable[0] = 0 //frame 0 starts at line 0 in the frame store
Balmau, Kopinsky Assignment #3 Page 3 of 7
  prog2-page0
  prog2-page0
  prog2-page0
  prog1-page0
  prog1-page0
  prog1-page0
  prog2-page1
  prog2-page1
  prog2-page1
  prog1-page1
  prog1-page1
  prog1-page1
  
Operating Systems COMP 310 – ECSE 427 McGill University
pagetable[1] = 2 //frame 2 starts at line 6 in the frame store
You may want to also keep validity information separately, or you could use an unreasonable
frame number like -1 to indicate that an entry is invalid.
Note that you will also need to modify the program counter to be able to navigate through the frames correctly. For instance, to execute prog 1, the PC needs to make the transitions between the 2 frames correctly, accessing lines: 3,4,5,9,10,11.
Assumptions (for now):
o The frame store is large enough to hold all the pages for all the programs.
o The variable store has at least 10 entries.
o An exec/run command will not allocate more variables than the size of the variable store.
o Each command (i.e., line) in the scripts will not be larger than a shell memory line (i.e., 100
characters in the reference implementation). o A one-liner is considered as one command
If everything is correct so far, your source/exec commands should have the same behavior as in Assignment 2. You can use the existing unit tests from Assignment 2 to make sure your code works correctly.
1.2.2. Extend the OS Shell with demand paging
We are now ready to add demand paging to our shell. In Section 1.2.1, we assumed the all the pages of all the programs fit in the shell memory. Now, we will get rid of this assumption.
1. Setting shell memory size at compile time. First, you need to add two compilation flags to adjust the frame store size and variable store size at compile time as follows.
o In gcc, you will need to use the -D compilation option, which replaces a macro by a value -D
<macro>=<value>.
o In make, you can pass the value of the variable from the command line.
Example:
At the command line: make xval=42
In the Makefile: gcc -D XVAL=$(xval) -c test.c In test.c: int x=XVAL;
o Using the technique described above, your shell will be compiled by running
make mysh framesize=X varmemsize=Y
where X and Y represent the number of lines in the frame store and in the variable store. You can assume that X will always be a multiple of 3 in our tests and that X will be large enough to hold at least 2 frames for each script in the test. The name of the executable remains mysh.
o Print the following message at shell startup, instead of the version message: ”Frame Store Size = X; Variable Store Size = Y”
Where X and Y are the values passed to make from the command line.
o To reiterate: this is printed instead of the version message.
Balmau, Kopinsky Assignment #3 Page 4 of 7

Operating Systems COMP 310 – ECSE 427 McGill University
Please make sure your program compiles this way and that the memory sizes are adjusted.
2. Code loading. Unlike the previous Section, in this section the code pages will be loaded into the shell memory dynamically, as they become necessary.
o In the beginning of the source/exec commands, only the first two pages of each program
are loaded into the frame store. A page consists of 3 lines of code. In case the program is smaller than 3 lines of code, only one page is loaded into the frame store. Each page is loaded in the first available hole.
o The programs start executing, according to the selected scheduling policy (in our case, RR with time slice of 2 lines of code).
3. Handling page faults. When a program needs to execute the next line of code that resides in a page which is not yet in memory, a page fault is triggered. Upon a page fault:
o The current process P is interrupted and placed at the back of the ready queue, even if it may
still have code lines left in its “time slice”. The scheduler selects the next process to run from the ready queue.
o If you want your A3 solution to work with policies other than RR, you might not want to always place P at the back of the ready queue. Again, such implementation details are up to you!
o The missing page for process P is brought into the frame store from the file. P’s page table needs to be updated accordingly. The new page is loaded into the first free slot in the frame store if a free slot exists in the frame store.
o If the frame store is full, we need to pick a victim frame to evict from the frame store. For now, pick a random frame in the frame store and evict it. We will adjust this policy in Section 1.2.3. Do not forget to update P’s page table. You also need to update any page tables that were using the frame you evicted! To accomplish this, you will need a mapping from frames to the page table(s) that use them. Make sure you keep this bookkeeping structure up-to- date whenever you modify the contents of frames!
Upon eviction, print the following to the terminal:
”Page fault!
Victim page contents:”
<the contents of the page, line by line> ”End of victim page contents.”
Upon page faults when the frame store is not full, print the following:
      ”Page fault!”
o P will resume running whenever it comes next in the ready queue, according to the scheduling policy.
o When a process terminates, you should not clean up its corresponding pages in the frame store.
Note that, because the scripting language is very simple the pages can be loaded in order into the shell memory (i.e., for a program, you can assume that you will first load page 1, then pages 2, 3, 4 etc.). This greatly simplifies the implementation, but be aware that real paging systems also account for loops, jumps in the code etc. Also, our pages are always read-only, so you never have
 Balmau, Kopinsky Assignment #3 Page 5 of 7

Operating Systems COMP 310 – ECSE 427 McGill University
to worry about backtracking in the backing files to overwrite updated data. Obviously, real paging systems have to account for that as well.
Also note that if the next page is already loaded in memory, there is no page fault. The execution simply continues with the instruction from the next page, if the current process still has remaining lines in its “time slice”. This will happen when the same program is used by multiple processes.
If you are especially astute and thinking very hard, you might notice that it’s possible for one process to load some pages of a program, and then another process running the same program uses them so much later that they have been evicted. This would require backtracking in the backing file. This is very difficult to implement correctly, since our pages do not have a fixed number of bytes, and so the tests will not cause this to happen. You can simply pretend that it will not happen. If you do choose to try and handle it, beware.
1.2.3. Adding Page Replacement Policy
The final piece is adjusting the page replacement policy to Least Recently Used (LRU). As seen in class, you will need to keep track of the least recently used frame in the entire frame store and evict it. You must implement accurate LRU, not an approximation. Note that, with this policy, a page fault generated by process P1 may still cause the eviction of a page belonging to process P2, so all of the same bookkeeping is necessary.
2. TESTCASES
We provide 5 testcases and expected outputs in the starter code repository. These are the public tests. There may be hidden tests for this assignment. We have not decided yet. Please run the testcases to ensure your code runs as expected, and make sure you get similar results in the automatic tests. You are strongly encouraged to add more of your own tests as well. If there are hidden tests, it will be highly unlikely that you fail any hidden tests if you are passing all the public ones.
As with A2, you need to run the given test cases from the A3/test-cases/ directory, and your code for the assignment should remain in the project/src directory as with the other project parts.
IMPORTANT: The grading infrastructure uses batch mode, so make sure your program produces the expected outputs when testcases run in batch mode. You can assume that the grading infrastructure will run one test at a time in batch mode, and that there is a fresh recompilation between two testcases.
3. WHAT TO HAND IN
The assignment is due on April 4, 2025 at 23:59.
The project must compile on the our server by running make clean; make mysh framesize=X varmemsize=Y
   Your final grade will be determined by running the code in the GitLab repository that is crawled by our
 grading infrastructure. We will take into account the most recent commit that happened before the
 deadline, taking any requested late days into account, on the main branch of your fork.
Balmau, Kopinsky Assignment #3 Page 6 of 7

Operating Systems COMP 310 – ECSE 427 McGill University
The project must run in batch mode, i.e. ./mysh < testfile.txt
Feel free to modify the Makefile to add more structure to your code, but make sure that the project
compiles and runs using the commands above.
Note: You must submit your own work. You can speak to each other for help but copied code will be handled as to McGill regulations. Submissions are automatically checked via plagiarism detection tools.
4. HOW IT WILL BE GRADED
Your program must compile and run on our server to be graded. If the code does not compile/run using the commands in Section 3, in our grading infrastructure you will receive 0 points for the entire assignment. If you think your code is correct and there is an issue with the grading infrastructure, contact the instructor.
Your assignment is graded out of 20 points. You were provided 5 testcases, with expected outputs. If your code matches the expected output, you will receive 2 points for each testcase. There might be an additional 5 hidden test cases, in which case there will be 2 points per hidden testcase. (If we decide not to have hidden tests, you will receive 4 points for each of the given test cases.) You will receive 0 points for each testcase where your output does not match the expected output. Differences in whitespace in the output, such as tabs instead of spaces, new lines, etc. will not be penalized. The TA will look at your source code only if the program runs (correctly or not). The TA looks at your code to verify that you implemented the requirement as requested. Specifically:
• Hardcoded solutions will receive 0 points for the hardcoded testcase, even if the output is correct.
• You must write this assignment in the C Programming language, otherwise the assignment will
receive 0 points.
  Congratulations! If you made it this far, you have implemented a
 simple simulated Operating System☺
Balmau, Kopinsky Assignment #3 Page 7 of 7

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp





 

掃一掃在手機打開當前頁
  • 上一篇:多多應(yīng)急全國客服電話-多多應(yīng)急24小時人工服務(wù)熱線
  • 下一篇:關(guān)于無憂分期強制下款及客服電話投訴高額利息1
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強度疲勞振動
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務(wù)平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 豆包網(wǎng)頁版入口 破天一劍 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    日韩精品久久一区| 欧美成人一区在线| 日本成人黄色| www.xxxx精品| 69国产精品成人在线播放| 国内精品视频在线| 日本视频精品一区| 中文字幕在线亚洲精品| 91九色单男在线观看| 国产欧亚日韩视频| 黄色免费福利视频| 日本福利视频一区| 日本久久中文字幕| 欧美一级中文字幕| 欧美成aaa人片免费看| 国产不卡一区二区视频| 91精品国产高清自在线看超| 国产日产亚洲精品| 国产精品一区而去| 国产女大学生av| 国产在线观看欧美| 国产日韩一区二区在线观看| 国产原创中文在线观看| 国产日韩一区二区在线| 国产一区在线免费观看| 韩国精品一区二区三区六区色诱| 欧美日韩激情四射| 国模精品视频一区二区三区| 欧美成人一区二区在线| 日韩精品福利视频| 亚洲人体一区| 亚洲高清视频一区二区| 亚洲不卡中文字幕| 色中色综合成人| 欧美在线播放一区二区| 蜜臀精品一区二区| dy888夜精品国产专区| 久久手机视频| 国产精品电影网| 午夜精品一区二区三区四区| 日本国产一区二区三区| 好吊色欧美一区二区三区视频 | 日韩精品在在线一区二区中文| 欧美一区二区三区在线播放| 日本欧洲国产一区二区| 精品亚洲欧美日韩| 久久久午夜视频| 国产精品久久一区二区三区| 亚州精品天堂中文字幕| 日韩.欧美.亚洲| 精品一区日韩成人| 国产视频99| 久久久久无码国产精品一区| 久久精品亚洲一区| 午夜精品免费视频| 国产裸体免费无遮挡| 少妇熟女一区二区| 狠狠综合久久av| 狠狠久久综合婷婷不卡| 久久伊人资源站| 欧美激情精品久久久久久大尺度| 青青草影院在线观看| 国产经典久久久| 亚洲欧洲日韩精品| 国产精品一区二区三区在线| 久久久久久久久久久久久久久久久久av | 日韩视频免费在线观看| 亚洲精品欧美一区二区三区| 国产九九精品视频| 久久这里只有精品99| 日韩精品一区二区三区不卡 | 国产热re99久久6国产精品| 日本a视频在线观看| 亚洲二区三区四区| 国产亚洲精品网站| 久久成人一区二区| 免费观看精品视频| 久久久久久久成人| 91精品国产91久久久久久久久| 国产精品网址在线| 欧美一二三区| 国产精品久久中文字幕| 国产精品美女xx| 亚洲va久久久噜噜噜久久天堂| 中文字幕中文字幕一区三区 | 国产久一道中文一区| 精品九九九九| 国产日韩av网站| 在线观看欧美一区| 99热国产免费| 国产伦精品免费视频| 欧美日韩国产二区| 久久人人爽人人爽人人片av高清| 欧美xxxx18性欧美| www黄色日本| 电影午夜精品一区二区三区| www.日韩视频| 国产日韩一区欧美| 国产精品女主播| av免费观看国产| 欧美二区在线视频| 亚洲欧美日韩精品在线| 精品国产拍在线观看| 国产精品一区久久| 欧美大陆一区二区| 久久在精品线影院精品国产| 91免费版网站入口| 国产一区二区片| 亚洲精品一区二区三| 久久欧美在线电影| 国产九色精品| 欧美日韩一区综合| 中文字幕第一页亚洲| 久久综合伊人77777蜜臀| 91精品国产自产91精品| 国产一区二区在线视频播放| 欧在线一二三四区| 少妇性饥渴无码a区免费| 久久99国产精品自在自在app| 久久伊人资源站| 国产免费裸体视频| 国产在线青青草| 青青青国产在线视频| 午夜精品免费视频| 精品国产福利| 久久精品影视伊人网| 久久久这里只有精品视频| 成人免费无码av| 成人3d动漫一区二区三区| 精品婷婷色一区二区三区蜜桃| 色综合久久88| 亚洲熟妇无码另类久久久| 久久国产精品久久久久久| 国产精品传媒毛片三区| 欧美成人免费一级人片100| 91av在线精品| 91精品免费| 日韩在线欧美在线| 国产精品无av码在线观看| 国产精品99蜜臀久久不卡二区| 99久久99久久精品国产片| 91精品中文在线| 久久久久久久久久国产精品| 久久精品电影网站| 色综合久久久久久久久五月| 丁香六月激情网| 精品人妻一区二区三区四区在线| 国产一区二区在线观看免费播放| 高清一区二区三区日本久| 欧美动漫一区二区| 日韩欧美国产综合在线| 国产一区精品视频| 亚洲mm色国产网站| 国产精品后入内射日本在线观看| 蜜桃传媒一区二区三区| 亚洲精品一区二区三区四区五区| 精品中文字幕在线| 久久这里有精品视频| 国产精品视频在线播放| 久久久精品网站| 久久精品99久久久香蕉| 国产精品爽爽爽| 国产精品久久久久影院日本| 国产精品毛片a∨一区二区三区|国| 久久久97精品| 久久精品国产一区二区三区不卡| 国产精品99久久久久久久久| 91精品久久香蕉国产线看观看| 91国内在线视频| 国产成人自拍视频在线观看| 久久久久久久久网站| 久久久国产一区二区| 欧美激情网友自拍| 亚洲高清视频一区二区| 亚洲色精品三区二区一区| 日本亚洲欧美成人| 欧美精品七区| 国产免费一区二区三区| 99精品国产高清在线观看| 国产成人精品免高潮费视频| 国产成人精品久久二区二区 | 99爱视频在线| 久久一区二区三区欧美亚洲| 久久视频在线观看免费| 欧美激情亚洲综合一区 | 国产女精品视频网站免费| 97精品一区二区视频在线观看| 国产高清精品软男同| 久久免费视频在线观看| 日韩在线免费av| 日韩视频免费大全中文字幕| 国产精品初高中精品久久| 亚洲一区制服诱惑| 热re99久久精品国产99热| 官网99热精品| 国产精品美女久久久免费| 欧美一区二区三区免费视| 国产在线98福利播放视频| 九色一区二区| 亚洲国产精品久久久久婷婷老年 |