I am following JamesM OS development tutorial and I am stuck at the Paging section.
I don't understand how the memory is being managed. Following are the queries :
- How are the bits in the bitset set on allocation? The kmalloc function just modifies the placement
address and does not set the corresponding bits in bitset which seems counter-intuitive.
- How is the identity mapping being done. I know that the following code is doing it but it is quite confusing:
Code: Select all
int i = 0;
while (i < placement_address)
{
// Kernel code is readable but not writeable from userspace.
alloc_frame( get_page(i, 1, kernel_directory), 0, 0);
i += 0x1000;
}
-Thanks.