Skip to content

The project emphasizes understanding the steps involved in translating logical to physical addresses, including resolving page faults using demand paging, managing a TLB, and implementing a page-replacement algorithm.

Simon-Blamo/Virtual-Memory-Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Virtual Memory Manager

This project involved designing a Virtual Memory Manager that translates logical addresses into corresponding physical addresses for a virtual address space of size 216 = 65,536 bytes. The program reads logical addresses from a file, uses a Translation Lookaside Buffer (TLB) and a page table to perform address translation, and outputs the byte value stored at the translated physical address. The project emphasizes understanding the steps involved in translating logical to physical addresses, including resolving page faults using demand paging, managing a TLB, and implementing a page-replacement algorithm.

Project Specifics

Logical Address Structure: Logical addresses are 32-bit integers, but only the rightmost 16 bits are relevant. These 16 bits are divided into an 8-bit page number and an 8-bit page offset.

System Parameters:

  • 28 entries in the page table
  • Page size of 28 bytes (256 bytes)
  • 16 entries in the TLB
  • Frame size of 28 bytes (256 bytes)
  • 256 frames
  • Physical memory size of 65,536 bytes (256 frames × 256-byte frame size)

Address Translation Process: The program performs address translation using a TLB and page table. The page number is extracted from the logical address, and the TLB is consulted. In the case of a TLB hit, the frame number is obtained from the TLB. In the case of a TLB miss, the page table is consulted. If a page fault occurs, the frame number is obtained from the page table or resolved by demand paging.

Demand Paging: The backing store is represented by the binary file BACKING_STORE.bin, sized at 65,536 bytes. When a page fault occurs, a 256-byte page is read from BACKING_STORE and stored in an available page frame in physical memory. Subsequent accesses to the page are resolved by either the TLB or the page table.

Getting Started

  1. Clone the repository:

    git clone https://github.com/Simon-Blamo/Virtual-Memory-Manager.git

  2. Navigate to the Virtual Memory Manager directory:

    cd Virtual-Memory-Manager

  3. Run program:

    ./main addresses.txt or ./main__pr addresses.txt

Disclaimer

This project was completed as part of a learning experience to understand virtual memory management.

About

The project emphasizes understanding the steps involved in translating logical to physical addresses, including resolving page faults using demand paging, managing a TLB, and implementing a page-replacement algorithm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published