summaryrefslogtreecommitdiffstats
path: root/proj2.txt
diff options
context:
space:
mode:
Diffstat (limited to 'proj2.txt')
-rw-r--r--proj2.txt44
1 files changed, 20 insertions, 24 deletions
diff --git a/proj2.txt b/proj2.txt
index 3b89826..8dd36f2 100644
--- a/proj2.txt
+++ b/proj2.txt
@@ -30,13 +30,12 @@ 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
32struct thread: 32struct thread:
33 struct hash page_table ...supplemental page table of thread 33 struct hash page_table ...supplemental page table of thread
34 34
35struct page_table_entry: 35struct page_table_entry:
36 void *upage ...virtual address of page 36 void *upage ...virtual address of page
37 bool loaded ...indicates if page is loaded 37 bool loaded ...indicates if page is loaded
38 enum type ...type of page 38 struct segment ...structure needed for lazy loading of data segments
39 union struct segment ...structure needed for lazy loading of data segments
40 struct hash_elem elem ...Hash element. 39 struct hash_elem elem ...Hash element.
41 40
42---- IMPLEMENTATION ---- 41---- IMPLEMENTATION ----
@@ -44,28 +43,25 @@ struct page_table_entry:
44>> determine the file and file offset corresponding to a virtual 43>> determine the file and file offset corresponding to a virtual
45>> address? 44>> address?
46 45
47When 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 46When we try to insert a new segment into our supplemental page table we record
48 47some information in the struct segment of each page table entry.
49-) the virtual address of the page 48This struct contains:
50-) the type of the page table entry, weather it is an ordinary segment or a 49* the virtual address of the page
51memory mapped file page 50* if the page is already loaded or not
52-) if the page is already loaded or not (per default false) 51* the associated file
53-) the file the page corresponds to 52* the offset in the file
54-) the offset in the file 53* if the page is writable or not
55-) if the page is writable or not
56 54
57Lazy loading of pages is accomplished by not loading the page instantly. The 55Lazy loading of pages is accomplished by not loading the page instantly. The
58actual page-loading is done when a page-fault occurs. 56actual page-loading is done when a page-fault occurs.
59 57
60
61---- SYNCHRONIZATION ---- 58---- SYNCHRONIZATION ----
62>> A3: How do you deal with or prevent page faults in file system 59>> A3: How do you deal with or prevent page faults in file system
63>> routines. Argue why your solution is deadlock free. 60>> routines. Argue why your solution is deadlock free.
64 61
65As we do not have any global structures, that means they are per process and 62As we do not have any global structures, that means they are per process and
66per thread, page faults can not happen, the same argument goes for the 63per thread, page faults can not happen. The same argument goes for the
67question of being deadlock free. File-structures are per process too, so only 64question of being deadlock free.
68one process can deal with a file at once.
69 65
70 STACK GROWTH 66 STACK GROWTH
71 ============ 67 ============
@@ -83,9 +79,10 @@ extern void *syscall_sp ...stored stack pointer for the "page fault inside
83>> B2: Describe how you integrated the (potentially growing) stack segment 79>> B2: Describe how you integrated the (potentially growing) stack segment
84>> into your page table management implementation. 80>> into your page table management implementation.
85 81
86The Stack growth itself is implemented in the page fault handler. The page 82The stack growth itself gets triggered by the page fault handler just as the
87table is just needed to allocate a new page for the stack when it needs to 83lazy loading of pages. Other than that there's no association between the pages
88grow. 84of the stack and the pages of segments/mmapped files.
85So pages of the stack don't get tracked inside the page table at all!
89 86
90---- ALGORITHMS ---- 87---- ALGORITHMS ----
91>> B3: Explain how you detect a page fault which should trigger a 88>> B3: Explain how you detect a page fault which should trigger a
@@ -93,11 +90,10 @@ grow.
93>> to work? 90>> to work?
94 91
95If we do not find a valid entry in our supplemental page-table it could be 92If we do not find a valid entry in our supplemental page-table it could be
96very well be a valid stack access. The maximum offset we consider as a valid 93very well be a valid stack access. The maximum offset we consider a valid
97access is due to the PUSHA instruction, which can try to access an address 32 94access is caused by the PUSHA instruction, which may try to access an address
98bytes below the current stack pointer. If this is the case we try to grow the 9532 bytes below the current stack pointer. Everthing higher we consider
99stack by one page. 96an exception.
100
101 97
102 MEMORY MAPPED FILES 98 MEMORY MAPPED FILES
103 =================== 99 ===================