Matt Bilodeau and Brandon Shaw's Brain Project

 
 
 
Brain98 Source Files:
brain98.cpp Brain Class Files, used to hold the processors Main Routines
brain98.h
Brain98OS.cpp Brain's Shell Interpreter
mem.cpp Brain's Memory Class, used for elements of my memory list
mem.h
memmang.cpp Brain's Memory Management Class
memmang.h
messages.cpp Brain's Message Class
messages.h
pcb.cpp Brain's PCB class used to hold information about a process
pcb.h
sched.cpp Brain's Scheduler class used to schedule process execution
sched.h
sema.cpp Brain's Semaphore Class
sema.h
pagetable.h Brain's Page Table Class
pagetable.cpp
pageindex.h Brain's Process Class for the page table
pageindex.cpp
page.h Brain's pageindex class
page.cpp
Brain Assembly:
SD.b98 Software Delay Program
RM.b98 Modulus Division via Recursive Subtraction - Initialization
DI.b98 Modulus Division via Recursive Subtraction - Implementation
DV.b98
DX.b98
DL.b98
DC.b98
EI.b98 Modulus Division via Recursive Subtraction - Output
EV.b98
EX.b98
EL.b98
EC.b98
Are some programs more resilient to changes in m and n than others? Why?

Yes, some programs are more resilient to changes in m and n than others. An example would be our SD.b98 function, which initializes our Dining Philosopher family of programs. This is more resilient to change than various other processes because it has few out-of-sequence memory accesses.

Therefore, no matter what size m and n are, we can predict the maximum number of page faults (where we call for a different page of memory) we would need to generate with these sequential programs by the formula (assuming on-demand paging):

Maximum_Number_of_Page_Faults = Size_of_Program / m

In programs with a lot of memory calls (not in sequence), it would be impossible to predict how many page faults there would be without knowing more about the code and n.

Show that when the available memory is doubled, the mean interval between page faults is constant.

How many words per page?
10
How many total pages?
1
Booting Brain98 Part 4...
Created By: Matt Bilodeau and Brandon Shaw
>load
What program do you want to load?
SD.b98
>exec
All Processes Blocked/Terminated
Program took 0.09 second(s) to execute
             10 Page Faults that occurred
>quit

Mean Interval: 10 / 0.09 = 111.11 Page Faults/Second


How many words per page?
20
How many total pages?
1
Booting Brain98 Part 4...
Created By: Matt Bilodeau and Brandon Shaw
>load
What program do you want to load?
SD.b98
>exec
All Processes Blocked/Terminated
Program took 0.04 second(s) to execute
             5 Page Faults that occurred
>quit

Mean Interval:  5 / 0.04 = 125.00 Page Faults/Second

Does choosing m = 1 and n = 1 cause any problems with your system? Why? Why not?

Our system doesn't have any problems when m = 1 and n = 1. However, it slows our system down considerably because for every instruction we want to execute we generate at least one page fault when we increment the instruction count. These page faults take CPU time away from the running process and thus slow the entire system down.