Page 1 of 1

Assignment failing

Posted: Fri Nov 04, 2005 2:30 pm
by Crazed123
Inside some of my kernel bootstrap code I run

Code: Select all

pFreeList^.mbBlock.lwMemoryLength:= lwHeapPages * 4096 - sizeof(TMemoryBlock) - sizeof(TMemoryBlockEnd);
in order to tell the heap how large it starts off. The problem is that with recent compilations (ie: returning to an earlier code version doesn't help) that line has begun to do nothing and I don't know why. I'll step to it, evaluate the r-expression. Then when I step once more and evaluate pFreeList^.mbBlock.lwMemoryLength I get 0.

This happens both in bochs and on real hardware.

*pulls hair off head*

Re:Assignment failing

Posted: Fri Nov 04, 2005 9:47 pm
by AR
Don't remember much Pascal but, if that's a pointer then are you sure it's valid? Does "lwHeapPages" contain 0 (either forgetting to set it or being corrupted by something along the way)?

Other than that, you may have to disassemble it and see if the compiler is doing it wrong.

Re:Assignment failing

Posted: Fri Nov 04, 2005 11:55 pm
by Crazed123
The actual solution was that pFreeList was paged in to physical memory that didn't exist, thus causing neither my PC nor Bochs to say anything about the invalid access. Fixed now and exchanged for another pagefauling headache.