Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do a kernel heap allocator #7

Open
arthurmco opened this issue Jan 21, 2018 · 0 comments
Open

Do a kernel heap allocator #7

arthurmco opened this issue Jan 21, 2018 · 0 comments

Comments

@arthurmco
Copy link
Owner

The kernel heap allocator serves to do small allocations, less than the 4kb granularity of the virtual memory manager.

#5 and #6 need to be closed. The PMM and the VMM need to be working well. Not bug-free (this is impossible, I think), but bug-free enough.

It provides malloc and free-like interfaces. I will use kmalloc and kfree here, for simplicity.

kmalloc will have three variations

  • allocate a virtual address, no physical address returned
  • allocate a virtual address in a specific physaddr zone, physical address returned (for DMA)
  • allocate a virtual address, with a specific physaddr (for MMIO)

It would allocate virtual memory only from the kernel zone. The user zone would receive 4kb pages directly and the C library would do the same thing.

kfree would free the address allocated by any of these three kmallocs.

It would be the unique interface that drivers should use.. This results in a more portable system

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant