I solved it this way. The original code from the virtual memory manager initialization procedure was:
- Code: Select all
pt_entry_add_attrib(&page, I86_PTE_PRESENT);
pt_entry_add_attrib(&page, I86_PTE_WRITABLE);
The code from the demo is:
- Code: Select all
pt_entry_add_attrib(&page, I86_PTE_PRESENT);
pt_entry_add_attrib(&page, I86_PTE_USER);
So I commented out the writeable attribute and added the user one, and was getting the page fault. However, after changing it to...
- Code: Select all
pt_entry_add_attrib(&page, I86_PTE_PRESENT);
pt_entry_add_attrib(&page, I86_PTE_WRITABLE);
pt_entry_add_attrib(&page, I86_PTE_USER);
...all is well. Maybe someone else had the same problem, and this will help them.