Please stop copy-pasting tutorials. It is irritating. It demonstrates incompetence. How many times are people going to have to debug JamesM's (yes, it
is JamesM's, not yours) code, and for how many unprepared, unequipped, big-dreaming zeroes?
Please, if you are not equipped to build an operating system,
do not attempt to begin one. Or, should you find it expedient to waste your time tinkering around with someone else's code, don't post up the problems for the general community to see. Contact the person whose code you're ripping off.
See if JamesM is interested in helping you make
his source code work for you. Most likely he isn't.
Apart from that: You have put your question forward in a stupid way.
What makes you think that everyone else here is riding JamesM's...tide and that everyone therefore should know exactly what goes on in the '6th tutorial'? This is
your problem. Therefore you have to engage us intellectually enough for us to be interested. I don't know what's going on with the newcomers, but as far as I know, not only on forums, but also in wider society, when
you are the one seeking help, you normally present all the salient points, and make them available in the absolute most convenient manner possible so as to alleviate the workload placed on the person(s) whom you are burdening. This is basic social common sense.
But you have given a link, and you expect people to what? Follow it, and because you're so special, and you deserve special treatment, and since everyone here is present simply for your own convenience, we should refresh our memories on what goes on in the article, and then, since you didn't even tell which line your error occurs on, we should, of course, take our time to deduce this for you, and then aid you on your journey to nowhere?
If you return and say "Well you know, I don't know what line the error occurs on..." then is will simply mean that you have broken the forum rules yet again: You obviously have not debugged the problem and found out where it arises. The first step in any kind of debugging is to trace the problem back to its execution area. So where do you map in your page tables? Check the code. Find out which flags you fill in to map them out.
And there's more: Your very question indicates that
you are not remotely well read, and that you should not be posting on these forums, since the rules adamantly require you to have READ the Intel Manuals, and that you are not equipped for systems programming.
So my question is:
1. Why do I get this error?
For the same reason anyone else would get a #PF from an x86 processor: because there was an inconsistency found with one of
your pages.
I'm reading (and understanding)...
"I'm reading (and cloning)..."
http://catb.org/~esr/faqs/smart-questions.html
http://lmgtfy.com/?q=intel+manuals
Read those two. Take the time to FULLY READ (not skim through) the Intel Manuals. Come back when you have met the intellectual requirements for Operating System Development.