Page 1 of 1

Paging

Posted: Wed Feb 21, 2007 1:36 am
by salil_bhagurkar
Ive just implemented paging into my os.. But i have reserved 1mb to 5mb thats 4mb of memory mapping to the whole 4gb address space.. But i dont think its optimal to create all pages at once without such a big requirement... Should i go about creating tables dynamically as required or statically allocate all tables in 4mb and modify them to present absent etc..

Posted: Wed Feb 21, 2007 1:58 am
by os64dev
that the nice thing about os developping, you can choose yourself. But as you already said loosing 4 MiB of memory for just the page map is not very memory efficient. well... if you have 256 Mib it's about 1.5% waisted memory and with 1GiB it's about 0.4% waisted which isn't that much :wink: but i would opt for the dynamic tables.

Posted: Wed Feb 21, 2007 10:24 am
by JAAman
that the nice thing about os developping, you can choose yourself. But as you already said loosing 4 MiB of memory for just the page map is not very memory efficient. well... if you have 256 Mib it's about 1.5% waisted memory and with 1GiB it's about 0.4% waisted which isn't that much :wink: but i would opt for the dynamic tables.
that is per address space
once you get multi-tasking, each process will (typically) have its own page tables, therefore each process needs its own copy of most of the structure (some parts can be shared -- such as tables mapping only kernel pages)

its definitely a good idea to not map pages-tables that arnt needed