From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 3 20:03:13 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 73E3516A420 for ; Fri, 3 Mar 2006 20:03:13 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD80043D49 for ; Fri, 3 Mar 2006 20:03:12 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k23K35dQ089829; Fri, 3 Mar 2006 15:03:10 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Tanmay Date: Fri, 3 Mar 2006 11:15:30 -0500 User-Agent: KMail/1.9.1 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200603031115.31529.jhb@freebsd.org> X-Virus-Scanned: ClamAV version 0.87.1, clamav-milter version 0.87 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED,AWL autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: freebsd-hackers@freebsd.org Subject: Re: Accessing address space of a process through kld!! X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2006 20:03:13 -0000 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 <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org