I was going through the paging code given by the James Molloy tutorial. I realized that in the init-paging function, the total memory is said to be 16MB, thus the total number of frames should be 4096 (given each frame is 4KB big). However, the frames bitmap is only 1024 bits large instead of 4096.
Shouldn't the line
Code: Select all
memset(frames, 0, INDEX_FROM_BIT(nframes));
Code: Select all
memset(frames, 0, INDEX_FROM_BIT(nframes)*4);
Link to James Molloy Paging Tutorial - http://www.jamesmolloy.co.uk/tutorial_h ... aging.html