I am reading the JamesM's kernel development tutorial and in the "chapter" that explain how to setup the paging memory management mechanism, he shows the kmalloc() function, that should allocate some memory.
This is the function :
u32int kmalloc(u32int sz) {
u32int tmp = placement_address;
placement_address += sz;
return tmp;
}
I am a little bit confused about. How does this function allocate memory?
It returns the address where the allocated chunck should be, but I really don't understand how the actual allocation works.