DOC PREVIEW
USF CS 635 - Lecture Notes

This preview shows page 1-2 out of 6 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 6 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Studying ‘mmap()/munmap()’Experiment #1Details of our Plan #1Experiment #2Details of our Plan #2What to turn in today?Studying ‘mmap()/munmap()’ How we can use our ‘toolbox’ of kernel modules to examine the effects of ‘mmap()/munmap()’Experiment #1•Remember our ‘vma.c’ module?•It creates a ‘/proc’ file•It shows a task’s virtual memory areas•NOTE: It works only for the ‘current’ task•We do BEFORE and AFTER comparisonsDetails of our Plan #1•Install the ‘vma.c’ module•Install ‘mysis.c’ device-driver•Write an application: ‘mmstudy1.cpp’–Open the files ‘/dev/mysis’ and ‘/proc/vma’–Read and display contents of ‘/proc/vma’ –Call ‘mmap()’ to map the video frame-buffer–Read and display contents of ‘/proc/vma’ –Call ‘munmap()’ to unmap the frame-buffer–Read and display contents of ‘/proc/vma’Experiment #2•We want to examine a task’s page-tables•We need to use our ‘ram.c’ device-driver•We also need a new ‘/proc’ file: ‘cr3.c’•CR3 = physical address of page-directory •Page-Directory = page-table addresses•We again do BEFORE and AFTER looksDetails of our Plan #2•Install modules ‘cr3.c’ and ‘ram.c’•Write an application: ‘mmstudy2.cpp’–Open: /proc/cr3, ‘/dev/ram’ and ‘/dev/vram’–Read page-directory and page-table(s)–Call ‘mmap()’ to map the video frame-buffer–Read page-directory and page-table(s)–Call ‘munmap()’ to unmap the frame-buffer–Read page-directory and page-table(s)–Compare tables (to see if anything changed)What to turn in today?•Turn in a printout of your source-code: –for ‘mmstudy1.cpp’ and for ‘mmstudy2.cpp’•Turn in a printout of your program output: –from ‘mmstudy1’ and from ‘mmstudy2’•You may ask for assistance –from Instructor, from TA, from


View Full Document

USF CS 635 - Lecture Notes

Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?