duplicating kernel memory mapping across page directories

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
stdcall
Member
Member
Posts: 78
Joined: Thu Mar 14, 2013 1:30 am

duplicating kernel memory mapping across page directories

Post by stdcall »

Hi.
I'm wondering how to map kernel memory that will be represented in all available page_directories.
The only way I can think of is to keep a linked list of all page_directories and update them on every mapping / unmapping.
Is there a better way ?

Thanks,
Ramon.
“Meaningless! Meaningless!”
says the Teacher.
“Utterly meaningless!
Everything is meaningless.” - Ecclesiastes 1, 2

Educational Purpose Operating System - EPOS
Korona
Member
Member
Posts: 1000
Joined: Thu May 17, 2007 1:27 pm
Contact:

Re: duplicating kernel memory mapping across page directorie

Post by Korona »

Share the top-level paging struct entries, as I explained here.
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: duplicating kernel memory mapping across page directorie

Post by JAAman »

of course if you are using PAE (or LMode) you can take an entire directory entry (or 2) for the global kernel, then updates to the kernel address space are automatically propagated to all address spaces without doing anything at all (of course with SMP you will need to notify any other CPUs so they can invalidate any necessary TLBs) and no modification of any address spaces other than the current one are ever necessary
Post Reply