Strange problems with paging in higherhalf kernel
Posted: Wed Oct 05, 2005 12:23 pm
I still have several problem-symptoms (with, as i hope, the same reason), since i changed over to a higherhalf kernel. Since the problems get more and i am trying to debug it from time to time, i decided to move it out of the isr-related thread were it started...
It seems to be a mapping-issue, after all.
First strange thing is, that the following line lets my code crash with
"running in bogus memory".
This also happens, when i change "read_pagedir_seg()" to "page_dir" (which is
a variable that holds the same value, ie the page dir's adress).
So i actually don't change anything, but when i leave this line in, it breaks.
The code is taken from a function, where i set up my own paging data.
Mapping should be the same as after the execution of the higherhalf barebones,
just that i use a page table filled with 4kb pages instead of a single 4mb page.
Anyway, it works and maps, as it seems (i tried putnum(physical(page_dir)),
which produced a plausible output), correctly when i leave the following
line out and crashes with the line included.
Next problem...
Adding integer constants, maybe in form of printed debugging messages, causes
the output to "break" (at a certain point, an infinite number of blanks is
printed).
I thought that maybe my kernel is too large to fit into the 4mb that i
mapped so that the strings are not were they are supposed to be and are not
printed thus, but actually my kernel ends at 0xc010a9c0, which is not larger then
0xc0000000+4mb, or am i wrong there?
Really strange is the fact that my change of an entry in the page_dir did not work as it
should. Finally i tried to use the value that needs to be written to that
entry as a literal constant, as seen below.
Still when i print it there is not the value i wrote to it, but 0xffffffff.
Actually this seems to me like another sign for a kernel that is too large for
the mapping - but as i said, my kernel image seems not to be that large.
Also there should be a pagefault then, right..?
I think all this points to a mapping problem, but i tested all kinds of stuff,
like printing out the physical and virtual adresses of things, having used
adresses and so on loged by my kernel and all outputs made sense.
Thus i am really stuck and would be thankfull for some suggestions and
ideas...
Thanks in advance!
It seems to be a mapping-issue, after all.
First strange thing is, that the following line lets my code crash with
"running in bogus memory".
This also happens, when i change "read_pagedir_seg()" to "page_dir" (which is
a variable that holds the same value, ie the page dir's adress).
So i actually don't change anything, but when i leave this line in, it breaks.
The code is taken from a function, where i set up my own paging data.
Mapping should be the same as after the execution of the higherhalf barebones,
just that i use a page table filled with 4kb pages instead of a single 4mb page.
Anyway, it works and maps, as it seems (i tried putnum(physical(page_dir)),
which produced a plausible output), correctly when i leave the following
line out and crashes with the line included.
Code: Select all
set_pagedir_seg(read_pagedir_seg()-0xc0000000); //--> "running in bogus memory"
Adding integer constants, maybe in form of printed debugging messages, causes
the output to "break" (at a certain point, an infinite number of blanks is
printed).
I thought that maybe my kernel is too large to fit into the 4mb that i
mapped so that the strings are not were they are supposed to be and are not
printed thus, but actually my kernel ends at 0xc010a9c0, which is not larger then
0xc0000000+4mb, or am i wrong there?
Really strange is the fact that my change of an entry in the page_dir did not work as it
should. Finally i tried to use the value that needs to be written to that
entry as a literal constant, as seen below.
Still when i print it there is not the value i wrote to it, but 0xffffffff.
Actually this seems to me like another sign for a kernel that is too large for
the mapping - but as i said, my kernel image seems not to be that large.
Also there should be a pagefault then, right..?
Code: Select all
page_dir[entry]=0x2d003; //tried to use the actual value as a constant
putnum(page_dir[entry],16); //output: 0xffffffff (!)
like printing out the physical and virtual adresses of things, having used
adresses and so on loged by my kernel and all outputs made sense.
Thus i am really stuck and would be thankfull for some suggestions and
ideas...
Thanks in advance!