Paging
- salil_bhagurkar
- Member
- Posts: 261
- Joined: Mon Feb 19, 2007 10:40 am
- Location: India
Paging
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..
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
but i would opt for the dynamic tables.
![Wink :wink:](./images/smilies/icon_wink.gif)
Author of COBOS
that is per address spacethat 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 muchbut i would opt for the dynamic tables.
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