Date: Fri, 3 Mar 2006 11:15:30 -0500 From: John Baldwin <jhb@freebsd.org> To: Tanmay <tanmayinamdar@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: Accessing address space of a process through kld!! Message-ID: <200603031115.31529.jhb@freebsd.org> In-Reply-To: <cdc1d1310603030756t4586bba2l274b466f844d6d16@mail.gmail.com> References: <cdc1d1310602270026o6b17101et14ddf301269edc37@mail.gmail.com> <cdc1d1310603030756t4586bba2l274b466f844d6d16@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 03 March 2006 10:56, Tanmay wrote: > 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 ? I don't know unfortunately. Hopefully someone else on the list can help you out with this. -- John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200603031115.31529.jhb>