BitmapHeapImplementation
Posted: Fri Aug 11, 2017 10:03 am
I was looking for some information about Memory Management of Operating Systems and found the BitmapHeapImplementation
here: http://wiki.osdev.org/User:Pancakes/Bit ... ementation.
I'm not sure if I understand the impementation right but this line of k_heapBMAlloc looks suspicious:
x gets the value 0 if lfb+1 is bigger or equal to bcnt. If not x gets lfb+1. But the for loop conditions is x < lfb. In this case the complete loop is skipped and the function returns 0.
I tried the Implementation in my own kernel and got the same problem. All Memory Allocations result in a null pointer.
Did I undestand the implementation wrong or did I just messed up my kernel code or is this a mistake in the wiki?
here: http://wiki.osdev.org/User:Pancakes/Bit ... ementation.
I'm not sure if I understand the impementation right but this line of k_heapBMAlloc looks suspicious:
Code: Select all
for (x = (b->lfb + 1 >= bcnt ? 0 : b->lfb + 1); x < b->lfb; ++x) {
I tried the Implementation in my own kernel and got the same problem. All Memory Allocations result in a null pointer.
Did I undestand the implementation wrong or did I just messed up my kernel code or is this a mistake in the wiki?