After doing some code on my "better" MM design, I now have a problem.
Let me try to explain it:
First, when the loading is done and the protected mode is properly setup, it calls mem_init.
Mem_init is responsible setting the pages up and maps the kernel to 0xC0000000.
Everything went fine until I issued the CPUID command like this after mem_init:
Code: Select all
xor eax,eax
cpuid
First I put it before call mem_init. Which surprisingly works then.
So the problem is in the routine itself. So I put there a cpuid command. Putting it after the pages setup (I mean; page directory and page tables) works okay. But when putting it after the setup of 0xC0000000 (e.g.: writing to 0xC00 and setting up some page tables) it crashes. (when doing that I got a 286 JUMP to busy TSS not supported; which is b*llshit IMO, I don't do any jumping or such :-\ ).
So, IMO, there was one logical explanation; kernel overwrite. BUT, 0xC00 and where the pages are created DO NOT overwrite the kernel.
So, my question is (and if you can understand my crappy English), how is this caused ?
Of course, I could put CPUID before mem_init, but that's just "running away from the problems", which I won't do.
And yes, I already used BOCHS debugger, but it does not report anything useful IMO. (it just continues after the command, but the printing routine doesn't seem to end, which is weird).
Hopefully someone can help me with this frustrating problem.
TIA,
DennisCGc.
PS. if you need mem_init somehow, please request it here . I'm very cautious of putting my source online. (that's just me ::) )