memory - Is there any way to inspect kernel space in GDB? -
memory - Is there any way to inspect kernel space in GDB? -
i may have more fundamental misunderstanding here, outline everything:
i wanted gain improve understanding of how programs laid out in memory. starting here went , made simple programs , opened them in gdb see things laid in more practical sense:
0x0 - 0x08048000 = ?? 0x08048000 = start .text section 0x08048000 = plt 0x08048300 = _start 0x08048400 = main 0x08048480 = other functions 0x0804a000 = got 0x0804a020 = start .data section 0x0804a028 = start .bss section (random offset) 0x0804b008 = start heap ... 0xf7?????? = start memory mapping section 0xf7e50000 = #included library function definitions 0xf7ff0000 = linux dynamic loader (random offset) 0xffffd010 = top of stack (grows negatively) (random offset) i understand lot of these addresses subject change, helped me visualize assigning numbers things.
anyway, in next image presented in source above, there's block dedicated kernel space @ top of programme address space:
but whole gigabyte allowed it! top of stack in programme examined @ 0xffffd010, leaving little space kernel-related things afterwards. there? ever grow, pushing rest of programme segments closer in virtual address space? more importantly, how can examine , play it?
the top of stack in programme examined @ 0xffffd010, leaving little space kernel-related things afterwards. there?
your stack @ top of memory — there's no kernel mapping. suggests 1 of next case:
you're running 32-bit binary on 64-bit system, kernel way off in 64-bit space can't see it. you're running weird kernel the 4gb/4gb patch applied, kernel (again) in totally separate address space you're on non-x86 architecture always has separate address spaces user , scheme processes (like powerpc, believe?)to @ address space actually looks like, take @ /proc/$pid/maps process while it's running.
does ever grow, pushing rest of programme segments closer in virtual address space?
no. size of kernel mapping compiled kernel, , never changes @ runtime. (it can configured 2gb/2gb instead of 3gb/1gb, that's uncommon.)
more importantly, how can examine , play it?
you can't — @ least, not user space. that's kernel lives.
memory x86 kernel
Comments
Post a Comment