You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/kernel/mm/overview.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,22 @@ ukoOS has multiple strategies for memory management, that manage memory at diffe
5
5
- The kernel has a standard memory allocator, accessed with the functions `alloc` and `free`.
6
6
These functions act similarly to `malloc` and `free` in ordinary C.
7
7
8
+
This is based on the design from [Mimalloc: Free List Sharding in Action](https://www.microsoft.com/en-us/research/wp-content/uploads/2019/06/mimalloc-tr-v1.pdf); read that if you want to understand the design.
9
+
8
10
The allocator that handles these requests is called **the heap memory allocator**.
9
11
10
12
- The kernel keeps track of all of RAM, and hands out pages to be mapped into userspace processes and to be used by the heap memory allocator.
11
13
14
+
This allocator is a simple free list.
15
+
12
16
This allocator is currently not capable of allocating more than a single contiguous page, but could be extended to support this in the future.
13
17
This allocator is called **the physical memory allocator**.
14
18
15
19
- The kernel manages its own virtual memory, in the RAM region of the memory map.
16
20
21
+
This allocator is a pair of treaps, one for all VMAs sorted by address, and another for only free VMAs sorted by size.
22
+
If you're not already familiar with treaps, there's a Julia Evans piece about them: [Data structure: the treap!](https://jvns.ca/blog/2017/09/09/data-structure--the-treap-/)
23
+
17
24
The allocator that handles these requests is called **the virtual memory allocator**.
18
25
19
26
Each hart has its own root page table, since it can be running a different userspace process.
0 commit comments