Page 3 of 3

Re: page enable problem

Posted: Sun May 31, 2009 7:36 am
by Combuster
writing CR0 is not the bug

The manifestation is caused by writing PE, having broken tables, executing a page full of zeroes, which are equivalent to 00 00 = add [eax], al (also in bochs log, just read it :wink:), which causes a pagefault on the same eax you used to write CR0. Which makes the exact bug way too easy to spot.

@OP: Get bochs debugger, and tell it to info tab after the mov cr0, eax instruction. Then compare that with what you had intended it to be.

Re: page enable problem

Posted: Mon Jun 01, 2009 6:27 am
by Brutus
Combuster wrote:writing CR0 is not the bug

The manifestation is caused by writing PE, having broken tables, executing a page full of zeroes, which are equivalent to 00 00 = add [eax], al (also in bochs log, just read it :wink:), which causes a pagefault on the same eax you used to write CR0. Which makes the exact bug way too easy to spot.

@OP: Get bochs debugger, and tell it to info tab after the mov cr0, eax instruction. Then compare that with what you had intended it to be.
And how can I fix this execution of page full of zeros? :/

Re: page enable problem

Posted: Mon Jun 01, 2009 6:46 am
by Combuster
*fetches crystal ball*

I see... fog... very thick fog...</sarcasm>



Ask smart questions, will you.

Re: page enable problem

Posted: Mon Jun 01, 2009 7:30 am
by Brutus
Combuster wrote:*fetches crystal ball*

I see... fog... very thick fog...</sarcasm>



Ask smart questions, will you.
* gets his 8-ball, asks "will I be able to ask smart question", receives the answers "Not in this life, mate" *

;) OK, smart questions are not my strong point, but let's try. Which part of my PE writing creates broken tables? :)

Re: page enable problem

Posted: Mon Jun 01, 2009 11:46 am
by Combuster
hmm

I suggest you look at
pageableMemoryStart = MEMORY_MAP + 0x100000; // high bogosity levels.

and the rest of the thread you hijacked.

Re: page enable problem

Posted: Mon Jun 01, 2009 1:28 pm
by Brutus
Combuster wrote:hmm

I suggest you look at
pageableMemoryStart = MEMORY_MAP + 0x100000; // high bogosity levels.

and the rest of the thread you hijacked.
Don't know what is wrong with this line, but I've re-aligned it to 4096 (it was already aligned, but just to be on a safe side) and changed MEMORY_MAP with KERNEL_END, which I get from linker, and still no result :/... Maybe I don't get the reason of this high bogosity level.

EDIT: The address, that is held in pageableMemoryStart is 0x100000 (GRUB thing) + 32MB KERNEL + 4MB of my PMM structure.