virtual memory layout and how to get it by the correspoinding functuon
2013-10-28 09:56
666 查看
/****************************************************************************/
fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0xf0000000 - 0xff000000 ( 240 MB)
lowmem : 0xc0000000 - 0xef800000 ( 760 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
.text : 0xc0008000 - 0xc0699000 (6724 kB)
.init : 0xc0699000 - 0xc06c3780 ( 170 kB)
.data : 0xc06c4000 - 0xc070cc80 ( 292 kB)
.bss : 0xc070cca4 - 0xc0934698 (2207 kB)
/****************************************************************************/
printk(KERN_NOTICE "Virtual kernel memory layout:\n"
" vector : 0x%08lx - 0x%08lx (%4ld kB)\n"
" fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
" vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n"
" lowmem : 0x%08lx - 0x%08lx (%4ld MB)\n"
" pkmap : 0x%08lx - 0x%08lx (%4ld MB)\n"
" modules : 0x%08lx - 0x%08lx (%4ld MB)\n"
" .text : 0x%p" " - 0x%p" " (%4d kB)\n"
" .init : 0x%p" " - 0x%p" " (%4d kB)\n"
" .data : 0x%p" " - 0x%p" " (%4d kB)\n"
" .bss : 0x%p" " - 0x%p" " (%4d kB)\n",
MLK(UL(CONFIG_VECTORS_BASE), UL(CONFIG_VECTORS_BASE) +
(PAGE_SIZE)),
MLK(FIXADDR_START, FIXADDR_TOP),
MLM(VMALLOC_START, VMALLOC_END),
MLM(PAGE_OFFSET, (unsigned long)high_memory),
MLM(PKMAP_BASE, (PKMAP_BASE) + (LAST_PKMAP) *
(PAGE_SIZE)),
MLM(MODULES_VADDR, MODULES_END),
MLK_ROUNDUP(_text, _etext),
MLK_ROUNDUP(__init_begin, __init_end),
MLK_ROUNDUP(_sdata, _edata),
MLK_ROUNDUP(__bss_start, __bss_stop));
#define CONFIG_VECTORS_BASE 0xffff0000
#define FIXADDR_START 0xfff00000UL
#define FIXADDR_TOP 0xfffe0000UL
#define FIXADDR_SIZE (FIXADDR_TOP - FIXADDR_START)
#define VMALLOC_OFFSET (8*1024*1024)
#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
#define VMALLOC_END 0xff000000UL
MLM(PAGE_OFFSET, (unsigned long)high_memory)
#define PKMAP_BASE (PAGE_OFFSET - PMD_SIZE) /*2M*/
#define LAST_PKMAP PTRS_PER_PTE/*512*/
#define LAST_PKMAP_MASK (LAST_PKMAP - 1)
#define PKMAP_NR(virt) (((virt) - PKMAP_BASE) >> PAGE_SHIFT)
#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
#define MODULES_VADDR (PAGE_OFFSET - 16*1024*1024)
#define MODULES_END (PAGE_OFFSET - PMD_SIZE)
how to get the corresponding address
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)
vmalloc : 0xf0000000 - 0xff000000 ( 240 MB)
lowmem : 0xc0000000 - 0xef800000 ( 760 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
.text : 0xc0008000 - 0xc0699000 (6724 kB)
.init : 0xc0699000 - 0xc06c3780 ( 170 kB)
.data : 0xc06c4000 - 0xc070cc80 ( 292 kB)
.bss : 0xc070cca4 - 0xc0934698 (2207 kB)
/****************************************************************************/
printk(KERN_NOTICE "Virtual kernel memory layout:\n"
" vector : 0x%08lx - 0x%08lx (%4ld kB)\n"
" fixmap : 0x%08lx - 0x%08lx (%4ld kB)\n"
" vmalloc : 0x%08lx - 0x%08lx (%4ld MB)\n"
" lowmem : 0x%08lx - 0x%08lx (%4ld MB)\n"
" pkmap : 0x%08lx - 0x%08lx (%4ld MB)\n"
" modules : 0x%08lx - 0x%08lx (%4ld MB)\n"
" .text : 0x%p" " - 0x%p" " (%4d kB)\n"
" .init : 0x%p" " - 0x%p" " (%4d kB)\n"
" .data : 0x%p" " - 0x%p" " (%4d kB)\n"
" .bss : 0x%p" " - 0x%p" " (%4d kB)\n",
MLK(UL(CONFIG_VECTORS_BASE), UL(CONFIG_VECTORS_BASE) +
(PAGE_SIZE)),
MLK(FIXADDR_START, FIXADDR_TOP),
MLM(VMALLOC_START, VMALLOC_END),
MLM(PAGE_OFFSET, (unsigned long)high_memory),
MLM(PKMAP_BASE, (PKMAP_BASE) + (LAST_PKMAP) *
(PAGE_SIZE)),
MLM(MODULES_VADDR, MODULES_END),
MLK_ROUNDUP(_text, _etext),
MLK_ROUNDUP(__init_begin, __init_end),
MLK_ROUNDUP(_sdata, _edata),
MLK_ROUNDUP(__bss_start, __bss_stop));
#define CONFIG_VECTORS_BASE 0xffff0000
#define FIXADDR_START 0xfff00000UL
#define FIXADDR_TOP 0xfffe0000UL
#define FIXADDR_SIZE (FIXADDR_TOP - FIXADDR_START)
#define VMALLOC_OFFSET (8*1024*1024)
#define VMALLOC_START (((unsigned long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1))
#define VMALLOC_END 0xff000000UL
MLM(PAGE_OFFSET, (unsigned long)high_memory)
#define PKMAP_BASE (PAGE_OFFSET - PMD_SIZE) /*2M*/
#define LAST_PKMAP PTRS_PER_PTE/*512*/
#define LAST_PKMAP_MASK (LAST_PKMAP - 1)
#define PKMAP_NR(virt) (((virt) - PKMAP_BASE) >> PAGE_SHIFT)
#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
#define MODULES_VADDR (PAGE_OFFSET - 16*1024*1024)
#define MODULES_END (PAGE_OFFSET - PMD_SIZE)
how to get the corresponding address
相关文章推荐
- Working on your thesis: how to get started and how to keep it going?
- How to get the kernel memory range on OpenSolaris
- LM_Sensors on Cent OS 5.4 How To Get And Install The Coretemp Module
- How to find a node by its text using the GetNodeByText method
- How can selenium web driver get to know when the new window has opened and then resume its execution
- How to Change the DBID and the DBNAME by using NID [ID 224266.1]
- Discover Feature Engineering, How to Engineer Features and How to Get Good at It
- How to design DL model(2):Inception(v4)-ResNet and the Impact of Residual Connections on Learning
- How To Reclaim Wasted Space on The Segment (Table, Index and LOB) and Tablespace Levels (文档 ID 16827
- the command 'vim' and how to use it
- [转贴]How to get the largest available continues memory block
- Warning: date_default_timezone_get(): It is not safe to rely on the system's timezone settings.
- How to get the value of a form element : check box and radio button
- Unable to allocate and lock memory. The virtual machine will be paused. Please close applications to
- What is the PPA and How to do with it ?
- When install ”matplotlib” with ”pip”, if you get the following error, it means the “freetype” and “png” libraries needed by matplotlib are not installed:
- CodeSnip: How to Get Id of the Record Using ASP.NET and SQL Server 2000
- How to Modify the Virtual Memory in a Mac
- How to power on/of the machine by KVM
- Memory Layout for Multiple and Virtual Inheritance (转载--By Edsko de Vries, January 2006)