Hello I'm new to the forum and have had about a year of java programming but am still not very fluent,
My current problem is that I need to demonstrate 2 page replacement algorithms such as FIFO and LRU. There are 3 inputs that the user should put into a command prompt to set the parameters:
1. the size of the process in pages between 10-100
2. the size of memory in frames 1-50
3. how long the process will run in terms of page references between 10-10,000.
3 data structures are necessary:
1. a page table, with one entry for each page in the process
2. a list to hold the page references
3. a list to represent memory so you will know which frames are used and which are available.
each entry in the page table will contain an indicator as to whether that page is in memory and if so, what frame it is in.
Each entry in the memory list will contain a flag telling you whether that frame is empty or in use.
The program should genereate a random list of page references. Page numbers start at 0 and go up to one less than the process size. So if your process has 50 pages they will be numbered 0 - 49.
write two output text files:
1. a summary file with counts of page faults vs. page references for each algorithm
2. a detail file with a list of page references for each algorithm, whether it was a page fault or not, where in memory it was placed, and what page (if any ) it replaced.
I have no code so far and am kind of at a loss where to start. If anyone could point me to an example or give me an example or give me some steps in the right direction i'd be most greatful!
Thank you in advance!