Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Mar 2006 21:26:35 +0530
From:      Tanmay <tanmayinamdar@gmail.com>
To:        jhb@freebsd.org
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Accessing address space of a process through kld!!
Message-ID:  <cdc1d1310603030756t4586bba2l274b466f844d6d16@mail.gmail.com>
In-Reply-To: <cdc1d1310602270026o6b17101et14ddf301269edc37@mail.gmail.com>
References:  <cdc1d1310602270026o6b17101et14ddf301269edc37@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 functio=
n
.
    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 an=
d
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?cdc1d1310603030756t4586bba2l274b466f844d6d16>