diff options
| author | Karoline Knoth <e0326266@student.tuwien.ac.at> | 2012-06-21 21:05:34 +0200 |
|---|---|---|
| committer | Karoline Knoth <e0326266@student.tuwien.ac.at> | 2012-06-21 21:05:34 +0200 |
| commit | f1290136ce837893e8b93fc47610079d3029b93d (patch) | |
| tree | 9b83407376acd58022cbde07375f97fdb944565e | |
| parent | 4fd6a30d164874fd660aacc36b44842e14bba208 (diff) | |
| download | progos-f1290136ce837893e8b93fc47610079d3029b93d.tar.gz progos-f1290136ce837893e8b93fc47610079d3029b93d.tar.bz2 progos-f1290136ce837893e8b93fc47610079d3029b93d.zip | |
answers to the memory mapped files section of the proj2 design document
| -rw-r--r-- | proj2.txt | 27 |
1 files changed, 18 insertions, 9 deletions
| @@ -92,7 +92,7 @@ So pages of the stack don't get tracked inside the page table at all! | |||
| 92 | If we do not find a valid entry in our supplemental page-table it could be | 92 | If we do not find a valid entry in our supplemental page-table it could be |
| 93 | very well be a valid stack access. The maximum offset we consider a valid | 93 | very well be a valid stack access. The maximum offset we consider a valid |
| 94 | access is caused by the PUSHA instruction, which may try to access an address | 94 | access is caused by the PUSHA instruction, which may try to access an address |
| 95 | 32 bytes below the current stack pointer. Everthing higher we consider | 95 | 32 bytes below the current stack pointer. Everything higher we consider |
| 96 | an exception. | 96 | an exception. |
| 97 | 97 | ||
| 98 | MEMORY MAPPED FILES | 98 | MEMORY MAPPED FILES |
| @@ -123,16 +123,23 @@ struct page_table_entry: | |||
| 123 | >> C2: Describe how memory mapped files integrate into your virtual | 123 | >> C2: Describe how memory mapped files integrate into your virtual |
| 124 | >> memory subsystem. | 124 | >> memory subsystem. |
| 125 | 125 | ||
| 126 | for every page required by the memory mapped file we create a new page table | 126 | For every memory mapped file we create a new per process mmap table. Its entries contain |
| 127 | entry | 127 | the virtual address of the first memory mapped file, the file handler and the number |
| 128 | TODO | 128 | of pages which are needed for the mapping. Additionally we store the lowest |
| 129 | free index, the highest used index and the capacity of the mmap table. We then | ||
| 130 | create for ever page required by the memory mapped file a new page table | ||
| 131 | entry. | ||
| 129 | 132 | ||
| 130 | >> C3: Explain how you determine whether a new file mapping overlaps | 133 | >> C3: Explain how you determine whether a new file mapping overlaps |
| 131 | >> any existing segment. | 134 | >> any existing segment. |
| 132 | 135 | ||
| 133 | in mmap() we simply check if the required pages are still free (no entry in | 136 | We avoid overlaps of file mappings by determining in the systemcall which tries |
| 134 | the page table). | 137 | to map a file if the required number of pages for the mapping are still free. |
| 135 | TODO | 138 | To obtain this information we lookup if there are entries in the page table |
| 139 | that imply that the memory space needed for the mapping is occupied by other | ||
| 140 | pages. Furthermore we must check if any page not in the page table (for | ||
| 141 | instance loaded pages on the stack) occupies the space we want to map our file | ||
| 142 | to. | ||
| 136 | 143 | ||
| 137 | ---- RATIONALE ---- | 144 | ---- RATIONALE ---- |
| 138 | 145 | ||
| @@ -143,8 +150,10 @@ TODO | |||
| 143 | >> implementation either does or does not share much of the code for | 150 | >> implementation either does or does not share much of the code for |
| 144 | >> the two situations. | 151 | >> the two situations. |
| 145 | 152 | ||
| 146 | we share the same page table entries | 153 | As our implementation of the supplemental page table does not distinguish |
| 147 | TODO | 154 | pages that came from memory mapped files and pages from executables, both the |
| 155 | supplemental page table as the memory mapped file table can share the page | ||
| 156 | table routines. | ||
| 148 | 157 | ||
| 149 | SURVEY QUESTIONS | 158 | SURVEY QUESTIONS |
| 150 | ================ | 159 | ================ |
