Accessing address space of a process through kld!!

Tanmay tanmayinamdar at gmail.com
Fri Mar 3 07:56:37 PST 2006


On Tue, Feb 28, 2006 at 01:33:47PM -0500,
John Baldwin wrote:
>you can use the proc_rwmem() function (it takes a uio >and a struct proc)
>to do the actual I/O portion.  You can see example use in >the ptrace()
>syscall.

Thanks.The memory of the process could be read using the proc_rwmem function
.
    How can i access the stack segment of a process ? I tried knowing more
about the stack allocation by running a small (user-level) program and
observing its addresses using GDB.Then I printed the max VA address and
stack size for that process from my KLD using  p->p_vmspace->vm_maxsaddr and
p->p_vmspace->vm_ssize respectively.But i could not infer anything
useful.Can you shed some light on this ? At what address does the stack
segment start ? where can we get this address from for a running process ?

TIA.

Regards,
Tanmay


More information about the freebsd-hackers mailing list