diff options
| author | Karoline Knoth <e0326266@student.tuwien.ac.at> | 2012-06-21 14:57:17 +0200 |
|---|---|---|
| committer | Karoline Knoth <e0326266@student.tuwien.ac.at> | 2012-06-21 14:57:17 +0200 |
| commit | 4bd5cb5f9e4778ceed3737e3c8f7f6fa1cf0b3f1 (patch) | |
| tree | e1d3e8f59a8765cd582640af6b16b639be614681 | |
| parent | f2bb044e9e715f05db8df5950ca704976b98174a (diff) | |
| download | progos-4bd5cb5f9e4778ceed3737e3c8f7f6fa1cf0b3f1.tar.gz progos-4bd5cb5f9e4778ceed3737e3c8f7f6fa1cf0b3f1.tar.bz2 progos-4bd5cb5f9e4778ceed3737e3c8f7f6fa1cf0b3f1.zip | |
answers to design doc of proj2
| -rw-r--r-- | proj2.txt | 34 |
1 files changed, 28 insertions, 6 deletions
| @@ -30,7 +30,7 @@ Manuel Mausz <manuel-uni@mausz.at> | |||
| 30 | >> enumeration. Identify the purpose of each in 25 words or less. | 30 | >> enumeration. Identify the purpose of each in 25 words or less. |
| 31 | 31 | ||
| 32 | struct thread: | 32 | struct thread: |
| 33 | struct hash page_table ...page table of thread | 33 | struct hash page_table ...supplemental page table of thread |
| 34 | 34 | ||
| 35 | struct page_table_entry: | 35 | struct page_table_entry: |
| 36 | void *upage ...virtual address of page | 36 | void *upage ...virtual address of page |
| @@ -44,13 +44,28 @@ struct page_table_entry: | |||
| 44 | >> determine the file and file offset corresponding to a virtual | 44 | >> determine the file and file offset corresponding to a virtual |
| 45 | >> address? | 45 | >> address? |
| 46 | 46 | ||
| 47 | TODO | 47 | When we try to insert a new segment into our supplemental page table we record some information in the struct segment of each page table entry. This struct contains |
| 48 | |||
| 49 | -) the virtual address of the page | ||
| 50 | -) the type of the page table entry, weather it is an ordinary segment or a | ||
| 51 | memory mapped file page | ||
| 52 | -) if the page is already loaded or not (per default false) | ||
| 53 | -) the file the page corresponds to | ||
| 54 | -) the offset in the file | ||
| 55 | -) if the page is writable or not | ||
| 56 | |||
| 57 | Lazy loading of pages is accomplished by not loading the page instantly. The | ||
| 58 | actual page-loading is done when a page-fault occurs. | ||
| 59 | |||
| 48 | 60 | ||
| 49 | ---- SYNCHRONIZATION ---- | 61 | ---- SYNCHRONIZATION ---- |
| 50 | >> A3: How do you deal with or prevent page faults in file system | 62 | >> A3: How do you deal with or prevent page faults in file system |
| 51 | >> routines. Argue why your solution is deadlock free. | 63 | >> routines. Argue why your solution is deadlock free. |
| 52 | 64 | ||
| 53 | TODO | 65 | As we do not have any global structures, that means they are per process and |
| 66 | per thread, page faults can not happen, the same argument goes for the | ||
| 67 | question of being deadlock free. File-structures are per process too, so only | ||
| 68 | one process can deal with a file at once. | ||
| 54 | 69 | ||
| 55 | STACK GROWTH | 70 | STACK GROWTH |
| 56 | ============ | 71 | ============ |
| @@ -68,14 +83,21 @@ extern void *syscall_sp ...stored stack pointer for the "page fault inside | |||
| 68 | >> B2: Describe how you integrated the (potentially growing) stack segment | 83 | >> B2: Describe how you integrated the (potentially growing) stack segment |
| 69 | >> into your page table management implementation. | 84 | >> into your page table management implementation. |
| 70 | 85 | ||
| 71 | TODO | 86 | The Stack growth itself is implemented in the page fault handler. The page |
| 87 | table is just needed to allocate a new page for the stack when it needs to | ||
| 88 | grow. | ||
| 72 | 89 | ||
| 73 | ---- ALGORITHMS ---- | 90 | ---- ALGORITHMS ---- |
| 74 | >> B3: Explain how you detect a page fault which should trigger a | 91 | >> B3: Explain how you detect a page fault which should trigger a |
| 75 | >> stack growth. What asssumptions are needed for your implementation | 92 | >> stack growth. What assumptions are needed for your implementation |
| 76 | >> to work? | 93 | >> to work? |
| 77 | 94 | ||
| 78 | TODO | 95 | If we do not find a valid entry in our supplemental page-table it could be |
| 96 | very well be a valid stack access. The maximum offset we consider as a valid | ||
| 97 | access is due to the PUSHA instruction, which can try to access an address 32 | ||
| 98 | bytes below the current stack pointer. If this is the case we try to grow the | ||
| 99 | stack by one page. | ||
| 100 | |||
| 79 | 101 | ||
| 80 | MEMORY MAPPED FILES | 102 | MEMORY MAPPED FILES |
| 81 | =================== | 103 | =================== |
