How to print kernel stack's lower and upper address in linux for process using pid and without using pid -
how print kernel stack's lower , upper address in linux each process process
- using pid ,
- without using pid
you may want understand current_stack_pointer()
code. (for older kernels, stack size has been increased 16k)
the kernel stack starts on top of page , increases downwards, %esp
on x86 points (or %rsp on x86_64) bottom of stack. can derive current macro follows
current macro == current_thread_info(%esp)->task current->pid == (current_thread_info(%esp)->task)->pid
as know bottom of stack, need add/subtract number of pages top of kernel stack (using %esp or %rsp depends on arch).
Comments
Post a Comment