Post by Tim FinleyWell I don't think that Alloc_Page should ever involve itself in the
pageing system you've implemented.
Well it gets in because directories and page tables are allocated via
Alloc_Page()...Suppose you've spawned a process that eats up the freelist,
(rec 3300 for instance) and you try to spwan another process before
that rec 3300 exits/frees pages. Where will you take pages for the page
tables and page directories from ?
Post by Tim FinleyTo me it seems like Alloc_Page is the
basic unit of memory allocation in Geekos (I think that Malloc eventually
boils down to Alloc_Page at some point).
Not exactly. See that line at the beginning
"X KB memory detected, Y pages in freelist, Z bytes in kernel heap" ?
Alloc_Page() returns you pages from the freelist and Malloc() takes memory
from the kernel heap. They don't overlap.
Post by Tim FinleySo Alloc_Page should always give
you the next available page on the free list and if there are not pages
left, Alloc_Page should cause a crash since you are out of memory.
So anyways, I agree with you that swapping should only deal with pages
that are flagged as pageable. I'm fairly sure that you could implement a
kernel in (mostly) pageable memory with some effort, but we are not trying
to do that here.
Tim