On Monday 24 November 2003 16:27, Guillaume Thouvenin wrote: > Another question with kernel virtual memory. Is "mem_map" global table > storing pages that represent the whole kernel virtual area? In fact I don't > see if it is just for kernel pages or for both (kernel and user). > > Thanks > I'm a completely newbie in kernel hacking, I've started about a mounth ago, so sorry if I'm wrong. Let's look at definition (significant part of it): #define PAGE_OFFSET (0xC0000000) #define __pa(x) ((unsigned long)(x)-PAGE_OFFSET) #define virt_to_page(kaddr) (mem_map + (__pa(kaddr) >> PAGE_SHIFT)) it uses macro __pa so subtract PAGE_OFFSET from addres. So it only valid when kaddr if greater then PAGE_OFFSET so when the one is in kernel space. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/