Write the functions to perform the given operations

Assignment Help Programming Languages
Reference no: EM132248800

Assignment: You will need to write the following functions to perform the given operations in mmu.cpp:

void mmu_disable()

This function will turn off the MMU by changing the SATP's mode bit. DO NOT change anything other than the mode bit!

void mmu_enable(PROCESS *p)

This function will enable the MMU for the given process. Remember, there is a context switching mechanism, so your mmu_enable must handle any process that needs to be enabled. This function does not build the page tables. That will be done later using mmu_map. Instead, this function is used to program the SATP register so that the process pointed to by *p's page tables are correctly loaded before it runs.
This function must do nothing if p->mmu_table is == 0. A table that is NULL means that mmu_map has not been called.

void mmu_map(PROCESS *p)

This function will map a process' program pointer and stack pointer into the MMU. This is typically used for USER mode processes, but may also be used for SUPERVISOR processes. NOTE: This function does NOT change SATP. Instead, it will write the root table into p->mmu_table. You will notice that there is a global array, which is essentially a pot of memory you are free to create your page tables in. This function is responsible for building the page tables in RAM and setting the root of those page tables into p->mmu_table. Again, this function does NOT change SATP...that's the responsibility of your mmu_enable() function.

void mmu_unmap(PROCESS *p)

This function will completely unmap a process from the MMU. Essentially, it needs to free the memory associated with p->mmu_table by making those entries non-valid (V bit must be 0).

Since the page table array is statically allocated, you will not be freeing the entries as your normally would using dynamic memory functions, such as free or delete. Instead, all you need to do is invalid every entry of your page tables. Remember that bit index 0 of a page table entry is the V bit (Valid). If this is set to 0, then that page table entry is "freed" in the loosest sense of the word.
void test()

This function is called from the init() process. You can use new_process (prototyped in mmu.h) to create new processes to test your code. My operating system will automatically call your mmu_enable(), mmu_map(), mmu_unmap(), and mmu_disable() functions. Therefore, all you need to do is write the functionality, and my OS will take care of calling these functions at the appropriate time.

Information related to above question is enclosed below:

Attachment:- assignment.rar

Reference no: EM132248800

Questions Cloud

What are the two variables that question is investigating : MM570 Applied Statistics for Psychology Assignment Project: Descriptive Statistics, Kaplan University, Australia. What two variables this question investigating
How do you develop a persona for a product : What are the main differences between the following usability methods: interview and contextual inquiry? What is a persona? How do you develop a persona.
Implemented a process to support non-performing employees : Outline what documents would have to be developed for the organization to evidence that it has implemented a process to support non-performing employees?
Possible questions for stage of the process : Please define GROW Model and provide two possible questions for each stage of the process.
Write the functions to perform the given operations : You will need to write the following functions to perform the given operations in mmu.cpp: void mmu_disable(). This function will turn off the MMU by changing.
Three key performance indicators : You have designed three Key Performance Indicators, When must you inform your team of KPIs?
Board of directors in running a public company : Explain the role of the board of directors in running a public company. What is the board's primary job? What distinguishes inside from outside directors?
Governance plays in the operation of the firm : What is governance? Why is it important for strategic managers to understand the role that governance plays in the operation of the firm?
Procedures and programs are in place in organisation : What policies, procedures and programs are in place in your organisation that you can draw on to help train/develop members of your team?

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd