代做CSCI-UA.0202-002: Operating Systems Final Exam 2022代写R编程
- 首页 >> Matlab编程CSCI-UA.0202-002: Operating Systems
Final Exam (Dec 21st, 2022)
Important Notes- READ BEFORE SOLVING THE EXAM
• If you perceive any ambiguity in any of the questions, state your assumptions clearly and solve the problem based on your assumptions. We will grade both your solutions and your assumptions.
• This exam is take-home.
• The exam is posted, on Brightspace, at the assignment section at 12pm EST of Wed Dec 21st.
• You can submit your answerstill 12pm EST of Th Dec 22nd.
• You are allowed only one submission, unlike assignments and labs.
• Your answers must be very focused. You may be penalized for wrong answers and for putting irrelevant information in your answers.
• This exam contains three problems, with a total of 100 points.
• Your answer sheet must be organized as follows:
- The very first page of your answer must contain ONLY the following information:
. You Last Name
. Your First Name
. Your NetID
. Copy and paste the honor code showed in the rectangle at the bottom of this page.
- In your answer sheet, answer one problem per page (even if your answer takes one line). That is, Problem 1 in a page, problem 2 in another page, etc.
Honor code (copy and paste to the first page of your exam)
• You may use the textbook, slides, and any notes you have. But you may not use the internet, except to access course material from NYU classes. • You may NOT use communication tools to collaborate with other humans. This includes but is not limited to G-Chat, Messenger, E-mail, etc. • Do not try to search for answers on the internet it will show in your answer and you will earn an immediate grade of 0. • Anyone found sharing answers or communicating with another student during the exam period will earn an immediate grade of 0. • “I understand the ground rules and agree to abide by them. I will not share answers or assist another student during this exam, nor will I seek assistance from another student or attempt to view their answers.” |
Problem 1
Suppose we have a 64-bit machine with a single CPU. This machine is executing a process. This process made eight memory accesses. Each one of these memory accesses reads eight bytes from memory and put them in a register. Suppose that the page size in this machine is 4KB. Level 1 cache size is 32KB and level 2 cache size is 64KB. There is no level 3 cache in this machine. The OS uses a single level page table. The CPU has one TLB.
a. [10 points] What is the minimum number of pages that this process accessed when executing the memory accesses mentioned above? Justify your answer. Ignore pages accessed to load the instructions themselves.
b. [10] What is the maximum number of pages that this process accessed when executing the memory accesses mentioned above? Justify your answer. Ignore pages accessed to load the instructions themselves.
c. [5] For the eight memory accesses mentioned in the problem, how many times the MMU has been accessed?
d. [5] For the eight memory accesses mentioned in the problem, how many times the TLB has been accessed?
Problem 2
[20 points]
Suppose we have 5 processes executing in the system. Each one of the five processes need 4 instances of an I/O device (e.g. each one of the processes needs four printers) in order to complete. What is the minimum number of instances of this I/O device do we need to ensure no deadlock under any scenario? Explain your logic how you reached your answer.
[Note: No credit will be given if you specify the maximum number of resources which is 5x4 = 20 I/O devices].
Problem 3
a. [10] Can a single process be blocked for three I/O events at atime? If no, justify in one sentence. If yes, give an example.
b. [10] Suppose a process has three user-level threads. One of the threads is blocked for I/O. What is the maximum number of CPUs (assuming we have a multi-CPU system) that this process uses in that case (i.e. while its thread is blocked)? Justify your answer.
c. [10] Can a process cause another blocked process to move from blocked state to running state? If no, justify in one sentence. If yes, given an example. [Assume three- state model]
d. [10] Does a process need to make a system call each time it needs to access any hardware in the system? If yes, state your reasons in 1-2 sentences. If no, given an example.
e. [10] Suppose we use a two-state model for a process (not running, running). State a scenario that shows why this two-state model is bad.