sortie wrote:bluemoon: That's wrong, that's not how sbrk works.
I think this was discussed on #osdev at irc.freenode.net yesterday (probably the same author as this thread).
Yep sortie, that was me

well actually it really seems like there is no other (usable) solution, so I enabled paging with the following (flat) memory model:
There is one global page directory. It has the following layout (with example values [virtual addresses]):
- 0x00000000 - 0x00177000:
Kernel area is identity mapped (calculated with linker symbols and the end of the ramdisk module)
- 0x00177000 - 0x1FEED000:
Heap area is mapped as one big, contiguous area of memory (pointing to free chunks somewhere the memory), used as the global heap area
This allows me to just set the initial break to the start of the heap area (here 0x00177000), and then increase (or decrease) that address by the given value, and go out of memory if the end of the heap area is reached.
Just one question: Later, when I want to use DMA, I plan to reserve another identity-mapped area between the kernel and the heap area. So that should be no problem. But, is there anything else (when implementing drivers and stuff) that I maybe didnt plan here, and that could conflict with my memory model?
btw: I know that there is no security for processes, but thats on purpose.
