Best memory manager
Best memory manager
Good morning! Which is the best way to manage memory? If here a good example? Is paging the best variant?
....
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Best memory manager
Considering you mentioned paging, you're looking for virtual memory management? If so, paging is in most cases the correct answer. At least it is good practice to get used to the basics before you worry about intricacies.
(And as long as you appear not to have read all the relevant wiki pages, there's little more to talk about.)
(And as long as you appear not to have read all the relevant wiki pages, there's little more to talk about.)
-
- Member
- Posts: 1146
- Joined: Sat Mar 01, 2014 2:59 pm
Re: Best memory manager
I've been researching memory management, and the best way to get started is to implement a physical memory manager to allocate physical blocks of memory (usually one page (4kb) in size) and a virtual memory manager to map those blocks to the virtual address space for each process/thread. I'm still working out the details, but keeping a bitmap of physical memory blocks is a good starting point (and not bad for continued use; if you prefer it's always quite easy to change something like that later if you keep your code properly modulerised) and having a page directory block for each process/thread is likely to get you quite far with changing the virtual address space on a context switch.
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.
Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing