🚀
Pintos
  • 🌈Welcome to Pintos
  • Getting Started
    • Environment Setup
    • Build and Run
      • Building Pintos
      • Running Pintos
    • Debug and Test
      • Testing
      • Debugging
    • Grading
  • Project Description
    • Lab0: Getting Real
      • Background
      • Your Tasks
      • FAQ
      • Submission
    • Lab1: Threads
      • Background
      • Suggestions
      • Your Tasks
      • FAQ
      • Submission
    • Lab2: User Programs
      • Background
      • Suggestions
      • Your Tasks
      • FAQ
      • Submission
    • Lab3a: Demand Paging
      • Background
      • Suggestions
      • Your Tasks
      • FAQ
      • Submission
    • Lab3b: Mmap Files
      • Your Tasks
      • FAQ
      • Submission
    • (Optional) Lab4: File Systems
      • Background
      • Suggestions
      • Your Tasks
      • FAQ
  • Appendix
    • Code Guide
      • Loading
      • Threads
      • Synchronization
      • Interrupt Handling
      • Memory Allocation
      • Virtual Addresses
      • Page Table
      • Hash Table
    • 4.4BSD Scheduler
    • C Standards
    • Project Documentation
    • Development Tools
    • Bibliography
  • Code Browser
Powered by GitBook
On this page
  1. Project Description
  2. Lab3a: Demand Paging

Suggestions

PreviousBackgroundNextYour Tasks

Last updated 2 years ago

Suggested Order of Implementation

We suggest the following initial order of implementation:

  • Frame table (see section ).

    • Change process.c to use your frame table allocator.

    • Do not implement swapping yet. If you run out of frames, fail the allocator or panic the kernel.

    • After this step, your kernel should still pass all the project 2 test cases.

  • Supplemental page table and page fault handler (see section).

    • Change process.c to record the necessary information in the supplemental page table when loading an executable and setting up its stack.

    • Implement loading of code and data segments in the page fault handler.

    • For now, consider only valid accesses.

    • After this step, your kernel should pass all of the project 2 functionality test cases, but only some of the robustness tests.

  • From here, you can implement page reclamation on process exit.

  • The next step is to implement eviction (see section ).

    • Initially you could choose the page to evict randomly.

    • At this point, you need to consider how to manage accessed and dirty bits and aliasing of user and kernel pages.

    • Synchronization is also a concern: how do you deal with it if process A faults on a page whose frame process B is in the process of evicting?

    • Finally, implement a eviction strategy such as the clock algorithm.

Managing the Frame Table
Managing the Supplemental Page Table
Managing the Frame Table