[Solved]Memory allocation corruption problems
Posted: Mon Feb 08, 2016 6:05 pm
Edit: My paging code was the issue the whole time.
Thanks for everything anyway guys.
--------
Hi!
I'm having some trouble with getting my memory manager working.
My linked list root entry gets corrupted after a big number of frame allocations, I'm think I am somehow accessing reserved memory.
But I'm really unsure if that is the case or if my paging code is wrong.
The problem is that after 137 frame allocation the root elements .prev somehow points to itself and creates a infinite-loop, when I try to combine free chunks.
If I add a check here https://github.com/Vild/PowerNex/blob/O ... eap.d#L103, to make sure that freeChunk is not equal to freeChunk.prev, I get a General Protection fault after 192 frame allocations.
Hopefully someone can help me find what I am doing wrong or point me in the right direction.
All help is appreciated.
- Dan
Debug output (COM1)
QEMU interrupt output
The code for the heap: heap.d
The General protection interrupt log files:
Debug output (COM1)
QEMU interrupt output
Prebuild iso: http://wild.tk/powernex.iso (20Mb)
Prebuild iso with the .prev check: http://wild.tk/powernexGE.iso (20Mb)
Github: https://github.com/Vild/PowerNex/tree/O ... src/memory The code is written in D.
Thanks for everything anyway guys.
--------
Hi!
I'm having some trouble with getting my memory manager working.
My linked list root entry gets corrupted after a big number of frame allocations, I'm think I am somehow accessing reserved memory.
But I'm really unsure if that is the case or if my paging code is wrong.
The problem is that after 137 frame allocation the root elements .prev somehow points to itself and creates a infinite-loop, when I try to combine free chunks.
If I add a check here https://github.com/Vild/PowerNex/blob/O ... eap.d#L103, to make sure that freeChunk is not equal to freeChunk.prev, I get a General Protection fault after 192 frame allocations.
Hopefully someone can help me find what I am doing wrong or point me in the right direction.
All help is appreciated.
- Dan
Debug output (COM1)
QEMU interrupt output
The code for the heap: heap.d
The General protection interrupt log files:
Debug output (COM1)
QEMU interrupt output
Prebuild iso: http://wild.tk/powernex.iso (20Mb)
Prebuild iso with the .prev check: http://wild.tk/powernexGE.iso (20Mb)
Github: https://github.com/Vild/PowerNex/tree/O ... src/memory The code is written in D.