Skip to content

A project demonstrating Multi-Level Page Table Management implemented in C, including functions for page table updates and queries. This project is an educational exploration of memory management concepts, complete with unit tests and low-level memory handling using virtual and physical addressing.

Notifications You must be signed in to change notification settings

abomokh/Multi-Level-Page-Table-Management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Multi-Level Page Table Management

This repository contains an implementation of Multi-Level Page Table Management in C. It demonstrates fundamental concepts of virtual memory and page tables, such as updating page table entries and querying virtual-to-physical memory mappings.

Files

  • pt.c: Contains the core functions for page table updates and queries.

    • page_table_update(uint64_t pt, uint64_t vpn, uint64_t ppn): Updates the page table to map a virtual page number (VPN) to a physical page number (PPN).
    • page_table_query(uint64_t pt, uint64_t vpn): Queries the mapping of a given VPN and returns the corresponding PPN.
  • os.h: Header file defining constants and function prototypes, including:

    • NO_MAPPING: A constant representing the absence of a mapping.
    • Memory management helpers: alloc_page_frame and phys_to_virt.
  • os.c: Contains helper functions for memory allocation and translation between physical and virtual addresses, as well as a test suite to verify the functionality of the page table management.

Usage

  1. Clone the repository:
    git clone https://github.com/<your-username>/multi-level-page-table.git
    cd multi-level-page-table
    
  2. Compile the code:
    gcc -o page_table os.c pt.c
    
  3. Run the program:
    ./page_table

About

A project demonstrating Multi-Level Page Table Management implemented in C, including functions for page table updates and queries. This project is an educational exploration of memory management concepts, complete with unit tests and low-level memory handling using virtual and physical addressing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages