简体   繁体   中英

What is layout of kernel address space in linux kernel?

User space's layout in process address space is well known, they take 1G ~ 4G of virtual memory (32 bit os) and consists of data (bss), stack, heap area. But, I cannot find kernel space's layout.

I wonder like theses:

when vfs(virtual file system) code get memory via kmalloc, where does memory reside in? somewhere in kernel space( ~ 1G)? and how locate them later?

thanks

Typically, the address above 3G (0xC0000000) are reserved by kernel-space. You may change this during kernel configuration process.

Check this, all symbols that kernel exported are laying at address more than 0xC0000000. Just run 'sudo cat /proc/kallsyms | head -n 10' you'll see them.

Now for your question. I think you actually can find out the answer yourself, by printing the given address (that kmalloc returned) for example. Or even use the macro from kernel to translate physical address to virtual and vice versa.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM