arthurmco / annOS

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

Physical memory manager #5

Open arthurmco opened 6 years ago

arthurmco commented 6 years ago

Design and create a physical memory manager, so we know how much memory we have, and what blocks are occupied

This will be the base for the virtual memory manager, and for virtual memory allocations, and paging

This might help with directions

KingAkeem commented 6 years ago

I'd like to help with this issue. I'm learning about kernels and I really would like to help design one.

arthurmco commented 6 years ago

Nice!

What are your ideas for this memory manager?

KingAkeem commented 6 years ago

I'm honestly not sure, would you be able to help me with designing it? I understand the theory behind memory management but I've yet to implement it. Do you have any suggestions?

arthurmco commented 6 years ago

I was thinking about starting with a simple bitmap-based physical memory manager, just to get started, and improving it over time.

In it, each bit would represent a physical page of memory, 4kb.

I am still reading about it, but I think it's OK for a start...

KingAkeem commented 6 years ago

So it's going to be a heap of memory with each block pointing to 4KB of memory?

arthurmco commented 6 years ago

No, more like this: http://wiki.osdev.org/Page_Frame_Allocation#Bitmap

Just a simple array for the bitmap. A heap would consume too much memory.

arthurmco commented 6 years ago

I started doing the physical memory manager in a68ca7f.

It does basic things, but can be improved.

I did some TODO items in the PMM.cpp file, to be solved. I will replicate them here: