Best way of implementing heap allocation in user space? #1396
Unanswered
ChocolateLoverRaj
asked this question in
Questions
Replies: 1 comment
-
I'd say that the heap address is wherever the userspace program says the heap is. It requests memory with |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is how I currently manage user space memory:
0x40000000
bytes before0xFFFF_8000_0000_0000
(where kernel addresses start): Maps to the frame buffer (if the user space process requests it)I have a few ideas on how I can implement syscalls for the user space to have a global allocator:
Linear +/-
Heap address starts after the stack end. The user space can say to the kernel "I want 5 total pages" and the kernel will allocate some phys frames for the user space program and map the memory to those phys frames. The kernel will also remove from the end of the heap if the user space program requests for less pages than already exist.
User space requests the specific pages it wants
The user space program says to the kernel "I want this page range to be mapped to some fresh phys frames" and the kernel maps them.
Beta Was this translation helpful? Give feedback.
All reactions