From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 27 18:31:50 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 4711616A420 for ; Mon, 27 Feb 2006 18:31:50 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.FreeBSD.org (Postfix) with ESMTP id 99DF543D58 for ; Mon, 27 Feb 2006 18:31:44 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (iqc2mdz5jbblsey9@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.3/8.13.3) with ESMTP id k1RIVhTA037294; Mon, 27 Feb 2006 10:31:43 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.3/8.13.3/Submit) id k1RIVg2I037293; Mon, 27 Feb 2006 10:31:42 -0800 (PST) (envelope-from jmg) Date: Mon, 27 Feb 2006 10:31:42 -0800 From: John-Mark Gurney To: Tanmay Message-ID: <20060227183142.GJ840@funkthat.com> Mail-Followup-To: Tanmay , freebsd-hackers@freebsd.org References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html 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 Reply-To: John-Mark Gurney List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2006 18:31:50 -0000 Tanmay wrote this message on Mon, Feb 27, 2006 at 13:56 +0530: > How do I access the address space ie text,data and stack of a (user > level)process whose pid I know from my kld. for eg: Suppose 'vi' is running > and I want to access its address space through my kld, then how do I do it? You look up the process with pfind(9), and then you can use uio(9) to transfer data into kernel space... Don't forget to PROC_UNLOCK the struct once you are done referencing it. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."