Paging

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.
Post Reply
User avatar
salil_bhagurkar
Member
Member
Posts: 261
Joined: Mon Feb 19, 2007 10:40 am
Location: India

Paging

Post 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..
User avatar
os64dev
Member
Member
Posts: 553
Joined: Sat Jan 27, 2007 3:21 pm
Location: Best, Netherlands

Post 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.
Author of COBOS
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Post 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
Post Reply