update lab1-8 codes and docs. now version is 0.2
This commit is contained in:
@@ -460,6 +460,15 @@ do_pgfault(struct mm_struct *mm, uint32_t error_code, uintptr_t addr) {
|
||||
* page_insert : build the map of phy addr of an Page with the linear addr la
|
||||
* swap_map_swappable : set the page swappable
|
||||
*/
|
||||
/*
|
||||
* LAB5 CHALLENGE ( the implmentation Copy on Write)
|
||||
There are 2 situlations when code comes here.
|
||||
1) *ptep & PTE_P == 1, it means one process try to write a readonly page.
|
||||
If the vma includes this addr is writable, then we can set the page writable by rewrite the *ptep.
|
||||
This method could be used to implement the Copy on Write (COW) thchnology(a fast fork process method).
|
||||
2) *ptep & PTE_P == 0 & but *ptep!=0, it means this pte is a swap entry.
|
||||
We should add the LAB3's results here.
|
||||
*/
|
||||
if(swap_init_ok) {
|
||||
struct Page *page=NULL;
|
||||
//(1)According to the mm AND addr, try to load the content of right disk page
|
||||
|
||||
Reference in New Issue
Block a user