[Autogenerated] we know that when we have a valid page double entry,
it points to the physical page in in memory and from that point
on the CPU can move forward with the access.
However, if the pT is invalid, that is the valid bit is zero.
The CPU says, hey, I have no idea what to do with that,
I'm not going to continue, I'm going to raise a page fault exception.
The classic case is the case where we have a page which has been
paged out to a page file or or some other file and then the purpose
of the remainder here is to bring that page back with that from
this back to physical memory,
fix the PT to point to that location and tell the process or to try again
from the Cps perspective a page fault is just a page fault,
the value Bt zero, which means the CPU cannot move forward.
However,
the memory manager does provide a distinction between two types of page fault.
One of them is a hard page fault.
Hard page fault is defined as one that requires disk access
and obviously this is more expensive than the other option
which is a soft page fault.
A soft page fault does not required access.
For example,
suppose you have one process using some DLL and then another process
comes along and also wants to use the same DLL,
if that is already in Iran it will be a soft page fault so it's going
to be a page fault initially but then you will say,
hey actually it's already mapped into physical,
let me just fix those pts to point to that physical memory
and we can tell the processor to try again.
So obviously there's a,
there is that idea that soft page faults are much better than hard page faults,
which indeed is the case.
And so as we'll see later on,
the member manager tries its best to have as many soft page
faults as possible compared to hard page faults because hard
page faults might be really expensive.
They require disk access.
What kind of page falls do we have?
What kind of reasons do we have for page faults here are a few examples.
One of them is what happens when the classic case when you
access the page that is not in Rome, it is committed,
but it is,
it happens to be outside in some fire like a page file or some other map file.
That would be the classic case that we already mentioned.
There's another thing which is accessing a page in a
modified or standby page list, what is that?
We haven't talked about that just yet but we'll talk
about that slightly later in this model.
We'll get back to this particular case when we're accessing
a page which is not committed at all.
So the value is zero because there's nothing there and mR
manager consults its knowledge based on the mutual descriptors
that are part of every process and says,
well actually this points to nowhere.
So the member manager will turn the page fault exception into an
access violation exception and send that original process for
potential handling if it's not handled, the process will _____.
If the access violation is in kernel mode then the system will blue screen.
Another case where you get a page fault is when someone tries
to access kernel memory from user mode,
it gets a page fault and then the manager says,
well I can't allow you to do that.
So again it turns that into an access violation.
If you try to go against the page protection that will also not work.
The CPU will object and raise an access violation again.
And the member manager will of course let that well,
it will raise a page fault and the member manager will let
that flow forward as an access violation.
Another thing we'll look at later is accessing a demand zero
page so we'll get back to what that means.
A slightly later this module we've seen the case of writing
to a guard page in the course about threats And so when we
write on the guard page again,
the memory manager is going to get that page fall from the processor
and then increase the stack size if possible for that using the
threat as we discussed back in that course,
when we're looking at right copy and right case when that thing happens again,
the processor will have to raise an exception so member
manager can perform the private copying so that that process
will have its own copy of that page, whatever that may be.
Usually, this is the case when you're working with data.
Obviously, if you try to execute code again in some memory chunk,
which is marked as no execute, this is supported by processors today.
Then again a page fault will be raised and the memory manager
will turn that into an access violation.
So all these things are common examples,
or at least common in some respect, examples of page falls.
In all cases, the member manager has to deal with that,
either attend that into another exception or handle that successfully.