Paging Code of James Molloy Tutorial
Posted: Tue Sep 01, 2020 2:53 am
Hello everyone,
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
be
where nframes is equal to 4096 (0x1000), and the INDEX_FROM_BIT macro returns nframes/32, 128 in this case.
Link to James Molloy Paging Tutorial - http://www.jamesmolloy.co.uk/tutorial_h ... aging.html
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