Skip to content

Commit 2843ea4

Browse files
authored
Fix typo in "Virtual Memory Manager" (#117)
* Fix typo in "Virtual Memory Manager" * Fix typo in "Heap Allocation" * Update Acknowledgements
1 parent a00bc60 commit 2843ea4

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

04_Memory_Management/04_Virtual_Memory_Manager.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,6 @@ We've looked a basic VMM implementation, and discussed some advanced concepts to
280280

281281
As mentioned above all the memory accessed is virtual memory at this point, so unless there is a specific reason to interact with the PMM it can be best to deal with the VMM instead. Then let the VMM manage the physical memory it may or may not need.
282282

283-
Of course there will be cases where this is not possible, and there are valid reasons to allocate physical memory directory (DMA buffers for device drivers, for example), but for the most part the VMM should be the interface to interact with memory.
283+
Of course there will be cases where this is not possible, and there are valid reasons to allocate physical memory directly (DMA buffers for device drivers, for example), but for the most part the VMM should be the interface to interact with memory.
284284

285285
This VMM design that was explained here is based on a stripped-down version of the Solaris VMM. It's very well understood and there is plenty of more in depth material out there if interested in exploring further. The original authors have also published several papers on the topic.

04_Memory_Management/05_Heap_Allocation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ We'll focus on three things: allocating memory (`alloc()`), freeing memory (`fre
99

1010
### To Avoid Confusion
1111

12-
The term 'heap' has a few meanings, and if coming from a computer science course the first though might be the data structure (specialized tree). That can be used to implement a heap allocator (hence the name), but it's not what we're talking about here.
12+
The term 'heap' has a few meanings, and if coming from a computer science course the first thought might be the data structure (specialized tree). That can be used to implement a heap allocator (hence the name), but it's not what we're talking about here.
1313

1414
This term when used in a memory management/osdev environment has a different meaning, and it usually refers to the code where memory is _dynamically allocated_ (`malloc()` and friends).
1515

@@ -24,7 +24,7 @@ If some of these terms need more explanation, they have chapters of their own to
2424

2525
With the above assumptions, what happens under the hood when we want to allocate some memory from the heap?
2626

27-
* The heap searches for a suitable address. If one is found returns that address is returned and the algorithm stops there. If it can't find any it will ask the VMM for more space.
27+
* The heap searches for a suitable address. If one is found that address is returned and the algorithm stops there. If it can't find any it will ask the VMM for more space.
2828
* The VMM will receive the heap's request and ask the PMM a suitable physical page to be allocated to fulfill the heap's request.
2929
* The PMM search for a suitable physical page to fulfill the VMM's request, returning that address to the VMM.
3030
* Once the VMM has the physical memory, that memory is mapped into the program's virtual address space, at the address the heap requested (usually at the end).
@@ -49,7 +49,7 @@ So let's get started with describing the allocation algorithm.
4949

5050
*Authors note: In the following examples we will use `uint8_t` for all the pointers, but in a real scenario it will be better to use a bigger size for the variable keeping track of the allocated region sizes (so we're not limited to 255 bytes).*
5151

52-
The easiest way to start with creating our allocator is to ask: "What do a heap allocator do?".
52+
The easiest way to start with creating our allocator is to ask: "What does a heap allocator do?".
5353

5454
Well the answer is, as we already know: it allocates memory, specifically in bytes. The bytes part is important, because as kernel developers we're probably used to dealing with pages and page-sized things. If the program asks for _X_ bytes, the allocator will return an address pointing to an area of memory that is at least _X_ bytes. The VMM is allocating memory, but the biggest difference is that the Heap is allocating bytes, while the VMM is allocating Pages.
5555

99_Appendices/I_Acknowledgments.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ In no particular order:
2525
- @IAmTheNerdNextDoor ([https://github.com/IAmTheNerdNextDoor](https://github.com/IAmTheNerdNextDoor))
2626
- @vasilisalmpanis ([https://github.com/vasilisalmpanis](https://github.com/vasilisalmpanis))
2727
- @AntoninRuan ([https://github.com/AntoninRuan](https://github.com/AntoninRuan))
28+
- @sudw1n ([https://github.com/sudw1n](https://github.com/sudw1n))

0 commit comments

Comments
 (0)