Code Monkey home page Code Monkey logo

Comments (1)

tessapower avatar tessapower commented on August 19, 2024 1

@clamyang when you run the program, you'll see a section above the Page Table which says:

The format of the page table is simple:
The high-order (left-most) bit is the VALID bit.
⭐ If the bit is 1, the rest of the entry is the PFN.
If the bit is 0, the page is not valid.

This ultimately means that a page table entry contains two pieces of information - whether it is valid and then also the Physical Frame Number (PFN). Pay attention to the line above with the ⭐, it states that if the Most Significant Bit (MSB) is 1, then the rest of the number, excluding that bit, represents the PFN.

The example in the README 0x80000006 is represented in hexadecimal, and if we wrote this out in binary it would be 1000 0000 0000 0000 0000 0000 0000 0110, which clearly shows that the MSB is 1 and therefore this page entry is valid.

To get the PFN, we ignore the MSB and look only at the rest of the number to get the PFN, which is 000 0000 0000 0000 0000 0000 0000 0110. Since it is binary, we can safely ignore leading zeroes and write it more compactly as 0110, or 0x6 in hexadecimal.

Hope that helps! 😸

from ostep-homework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.