stack base page allocator question

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:stack base page allocator question

Post by distantvoices »

a: yes, I set up a stack with all the free pages upon initialization of memory management. Then, pages are dealt out as needed. Crucial pages aren't on the stack so, no harm can happen to them.

b: I don't use bitmaps and maybe I will use them in the future, while the OS grows up. It's but a bawling bairn now, so expectations are loooow *gg*

@kung-F00-master: Hmmm ... that doesn't concern me. It's the releasing of the correct pages upon process shut down. so to say the removal of the page directory and so forth. to do this properly without many communication between mm service and mm driver.

I see several ... hmpfs in both approaches: in a bitmap, you don't know the free page until you've found it in the bitmap. you have to search for it. Once you've gor the adress, you simply peek into the bitmap converting the page adress into an offset and bit position to find out whether the page is allocatae dor free.

with the stack approach, you need mo'mem but getting a free page is as simple as popping it off the stack. putting a page back on the stack is easy too. you just push it. But you don't know whether the page is already pushed without some iteration stuff.

To solve this and to keep track of page references around the system, one should take a bit of extra book keeping into consideration ... which processes own which pages and so forth ... Because if a referenced page is put back on the stack then woooohooo, we'll have a thunderstorm around mt doom.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
Post Reply