From owner-freebsd-hackers@FreeBSD.ORG Fri Mar 3 15:56:37 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 03B4D16A420 for ; Fri, 3 Mar 2006 15:56:37 +0000 (GMT) (envelope-from tanmayinamdar@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 312B143D45 for ; Fri, 3 Mar 2006 15:56:36 +0000 (GMT) (envelope-from tanmayinamdar@gmail.com) Received: by zproxy.gmail.com with SMTP id z31so718682nzd for ; Fri, 03 Mar 2006 07:56:35 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=IKrzOdt8BcwSShivThrfB9UWxKO2220+o70pvrvHtcm4my38bKyjyDD/nV3dK7Ro4QjUnWdmnoH3nhoKHWr48Utt3aIdi7rB0W3/detGeBKtTv6gJsSUTgFucVUqcrPsOqESCg/S3tCi4ihmV/nhdm1Rfv0rY90TFlJbt68Wop4= Received: by 10.35.12.13 with SMTP id p13mr1125382pyi; Fri, 03 Mar 2006 07:56:35 -0800 (PST) Received: by 10.35.13.10 with HTTP; Fri, 3 Mar 2006 07:56:35 -0800 (PST) Message-ID: Date: Fri, 3 Mar 2006 21:26:35 +0530 From: Tanmay To: jhb@freebsd.org In-Reply-To: MIME-Version: 1.0 References: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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 15:56:37 -0000 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