arthurmco / annOS

Arthur's Not Named Operating System, an OS with a C++ kernel.
MIT License
7 stars 0 forks source link

Do a kernel heap allocator #7

Open arthurmco opened 6 years ago

arthurmco commented 6 years ago

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

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