Operating Systems

2007 Fall, Project One

Page Fault Information

Due Time:

    Oct. 17th 00:00 AM

¡@

Demo Time:

    Oct. 22nd and Oct. 23rd 13:30 - 15:00

¡@

Problem:

   System call is an interface between users and the kernel. Through system call, user processes can access peripherals or run privileged operations. Learning how to design a system call can help us understand how the user processes communicate with kernel. As we know, page fault is an interrupt to the software raised by the hardware, when a process accesses a page that is mapped in address space, but not loaded in physical memory. The page fault rate is a good metric of memory management. However, since information in the kernel cannot be read directly from user processes. We need to design a new system call to get the information of page faults.

¡@

Project:

    You are to design a new system call that can return current values of some new system information counters. You can modify the kernel source codes or make a kernel module for this system call. Your input is an integer standing for the duration you will test in milliseconds. Your output should be exactly the same as the following to print information regarding page faults.  Note that, in Linux, the page fault handler handles both page fault ( no page found ) and protection fault. You should create a new file named ¡§myservice.c¡¨to build your system call and your system call might have some arguments. Your user program name should be¡§test.c¡¨.

  


Output :
    From <time> to <time>,

Page Fault #, Protection Fault #, Handler called #
    Page Fault Rate = Percentage  times/s
Sample Output :

    From Mon. Oct. 1 12:00:00 2007 to Mon. Oct. 1 12:00:10 2007

Page Fault 20,  Protection Fault 10, Handler called 30
    Page Fault Rate = 2.00 times/s

 

Platform:

    OS:

Linux, kernel version: 2.6.x

    Programming Language:

C

    Machine:

try to find one yourself

 

Grading:

    Kernel modification:

30%

    System call design:

25%

    Program result:

20%

    Reports:

10%

    Coding style:

5%

    Q&A:

10%

    Bonus : Some special design to improve your accuracy ( i.e., accurate time interval )

15%

 

¡°Late penalty is 10% per day. E.g. if 2 days late and with grade 90, the final grade will be 90 * 90% * 90% = 72.9

 

Hint:

     You may need to modify <directory to Linux source>/arch/<platform>/mm/fault.c to get the page fault information. ¡§extern¡¨ the counter variables might reduce the effort to recompile kernel.

 

Handing in:

Turn in one-page report in class showing how you did it and how good it is. Make your source codes self-documented.

Upload your source codes and executable file, including Makefile, *.c, *.h, to FTP server

Host: 140.112.90.169, Port:53, User: OS2007 Password: project1

You should create your own directory like R96922148 by your student ID number for your files. Note that the initial should be capital.

 

Reference:

1

http://ii.twbbs.org/phpbb/viewforum.php?f=9    (the OS forum)

2

Understand the Linux Kernel 3rd Edition  

            Daniel P. Bovet & Macro Cesati, O'REILLY

3

Linux Device Driver 3rd Edition  

            Jonathan Corbet, Alessandro, Rubini & Greg Kroah-Hartman, O'REILLY

4

The other references will be announced later in the OS forum.

¡@