Skip to content

Zeroing Memory Pages

April 25, 2012

When working on an (not entirely successful) attempt to improve the efficiency of the routines managing the PageMap table it became apparent that there were problems when reusing memory pages. In particular, if the page represented one of the various paging table entries it might be interpreted as valid when reused; obviously this is wrong.

I have changed the routine in the dummy task which releases pages so that it also zero-fills them. As mentioned in my last post, zero-filling a new page is always a good idea. In this particular case it ensures that the contents can’t be interpreted as valid page table entries. For efficiency, the zero-filling is done by a small assembler routine (in tasking.s)

At the same time I improved the efficiency of the zero-filling routines in startup.s (not that it particularly matters with code that is only executed the one time, but it makes the code neater too. I like neat code).

Advertisements

From → IanOS

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: