Banner

Summary of Project 3:

 

In this project we are supposed to implement a page fault counter to count how many page faults occur in three different ways, one for all processes from boot time, one for all processes between the time START is called and STOP is called, and one for the process calling the START.  We would have to create a system call to allow us to return this information to any user program that calls it.  We also need to modify the existing kernel to force our variables to be updated each time a page fault occurs.

 

Pseudo Code:

 

Initialize function:

            Set total page fault counter to 0

            Set all process page fault counter to 0

            Set current process page fault counter to 0

            Set pid to 0

            Set the count flag to be false

End function

 

Increment page faults function:

            Increment total page fault counter

            If the counter is true

                        Increment the All process page fault counter

                        If the savedpid = current->pid

                                    Increment the process page fault counter

End function

 

System Call:

            Switch on cmd

            Case 0:

                        If the counter flag was false

                                    Change counter flag to true

                                    Set pid to current->pid

                                    Reset process and all process counters

                        Otherwise return error

            Case 1:

                        If the pid matches current->pid

                                    Change counter flag to false

                        Else return error

            Case 2:

                        Switch on arg

                        Case 0:

                                    If the pid=current->pid

                                                Return the current process page fault count

                                    Return error

                        Case 1:

                                    Return all process page fault count

                        Case 2:

                                    Return total page faults since boot

                        Else return error

            Else return error

End system call

 

Main driver program

            Start counter

            Read counter

Do some stuff, hopefully we get page faults here

            Read counter

            Stop counter

            Read counter

            Read all process counter

            Read all since boot counter

End main

 

List of things that have been done

 

  1. Implemented sys_pfcount
  2. Created an initialization function for the counters and pid
  3. Added a call to our initialization function in init paging_int(void)
  4. Added a call to our pfcount function in the fault.c file.
  5. Created a break function in case the program ends unnaturally, we want to be able to call the function again with re-initialized pid and counters without having to reboot the computer.
  6. Ran the program and confirmed that it works.

 

List of things to do:

 

  1. Check more thoroughly for bugs
  2. Write the report

 


Home | About Me | Text Depository | Future Enhancements | Guest Book | Links

Copyright © 1998-2008 Michael Chungkun Chen
All Rights Reserved.