Page 1 of 1

cleaning out memory areas

Posted: Wed Sep 15, 2004 4:17 am
by distantvoices
After a few days of hard debugging, I 've found one source of obscure bugs - maybe it is the solution to get rid of a vast majority of them - anyways, I gonna tell you something crucial and to some of you maybe logical, be it due to experience be it due to education:

Clean out Page Directories and Page Tables! Don't rely on only zeroing the dealt out memory areas.

Say: zero out page directory before mapping in the kernel land (simply put in the PDE's at the corresponding places).
Zero out each page table ere you enter any pages. Your MMU might find a "valid" page and use it - and this might not be what you want.

To say it in short:

Zero out all management tables too.

Page Directory and Page Tables.

I just needed to put this here. It has caused me way a lot of headache and wondering: why does it work on this PC and not on any other??!! *damn*

Hope, you can benefit from my atrocious moron-ness.

Re:cleaning out memory areas

Posted: Wed Sep 15, 2004 7:59 am
by aladdin
can u tell the configuration of these PCs.
have you tested it on tow PCs that have the same CPUs or not ?

Re:cleaning out memory areas

Posted: Thu Sep 16, 2004 3:31 am
by distantvoices
My three machines at home:

amd athlon xp 1700+, asus mobo,512 mb memory
amd thunderbird 750 mhz, abit mobo,128 mb memory
--> on these two it worked without cleaning out anything - albeit obscure bugs kept appearing. Dito in VMWare.

Toshiba Satellite 1700/300 laptop with Intel Celeron 650 MHZ cpu and 128 mb memory --> on this one it refused to work without cleaning out. With cleaning and zeroing, it works like a charm on this stubborn machine - and the obscure bugs seem to be gone pour la plus-part.

With a HP-Computer (Asus Mobo, Intel Pention III 500 mhz,64 MB memory) it worked also - without cleaning out - but now, with the zeroing and cleaning stuff - much better.

Hope this helps