Will this cause page faults?
Posted: Fri Sep 09, 2005 4:59 pm
I've just finished coding some functions and things that manage virtual memory in units of pages (virtual and physical nodes) and contexts, which are collections of virtual page nodes representing entire address spaces, including a page directory. However, I'm suspicious as to the actions of the function BuildPagingInformation(), which computes and sets the paging data in the page directory and page tables. I realize it needs some correction (better error handling, for starters), but I've invested enough mental effort in this thing that I'd like somebody to take a look at it before I go picking at too much.
Basically, if you could please audit TVirtualMemoryContext.BuildPagingInformation() I'd be extremely grateful. I want to know:
1.Will the actions of that code cause page faults due to overwriting a page directory and tables that (assuming worst case) are in use, or will the TLB contain enough local references due to running all that kernel code to stay sane? What can be done if faults would result?
2. Is there a neater, more efficient way to build paging information the hardware needs from the node trees used in software? How about just neater?
And yes, I know I'm using a class. I originally wrote it as a structure with associated functions, but I was passing a pointer or var parameter in so many times I decided to make it a class and have that parameter be implicit.
Thank you for your help, anyone who can read the code and bothers to take a look!
Basically, if you could please audit TVirtualMemoryContext.BuildPagingInformation() I'd be extremely grateful. I want to know:
1.Will the actions of that code cause page faults due to overwriting a page directory and tables that (assuming worst case) are in use, or will the TLB contain enough local references due to running all that kernel code to stay sane? What can be done if faults would result?
2. Is there a neater, more efficient way to build paging information the hardware needs from the node trees used in software? How about just neater?
And yes, I know I'm using a class. I originally wrote it as a structure with associated functions, but I was passing a pointer or var parameter in so many times I decided to make it a class and have that parameter be implicit.
Thank you for your help, anyone who can read the code and bothers to take a look!