juston-li / virtual-memory Goto Github PK
View Code? Open in Web Editor NEWCIS415 Project 3 Virtual Memory
CIS415 Project 3 Virtual Memory
Juston Li 950998500 Files: translate.c tlb.c pagetable.c io.c binary.c translate.h addresses.txt BACKING_STORE.bin Makefile Code layout translate.c is the Main address translatation function it opens/reads Address.txt file, initializes data structures Then for each line in address.txt calls functions to convert to binary, lookup tlb, walk page table if tlb miss, then return the memory request tlb.c handles tlb_lookup and tlb_update. tlb_lookup simply checks if the requests page is in the tlb array returning the corresponding page if it is. return -1 if it is not. tlb_update, updates the tlb given a page and its frame. It will take the first empty slot. If the tlb is full it uses LRU replacement, replacing the entry with the lowest counter. Note on a miss, pagetable.c will call tlb_update after the pagetable walk pagetable.c on a tlb miss will check if the page requested is valid and in memory. If it is, it will update the TLB with the frame and return. An immediate TLB lookup will follow it for a certain TLB hit If the page is not in memory, load is called to bring the page to physicalmem_array, then the pagetable, TLB are updated. io.c handles I/O operations access and load. Access just returns the requested memory access given the [frame][offset] in physicalmem_array. load opens the BACKING_STORE.bin and fseeks to the requested page. The page is read into the physicalmem_array into entry physicalmem_counter. So physicalmem_array is filled up sequentially, by order of the memory requests. binary.c handles bin2dec and dec2bin functions. BACKING_STORE.bin is just repeated lines of "0123456\n" to test correct access requests Comments Pretty fun project and didn't take much time. I would actually have preferred an extended project on this than shells. Maybe include larger virtual than physical, mutiple TLB levels comparing different mapping techniques Grace days: 3
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.