From owner-freebsd-hackers@FreeBSD.ORG Thu Jan 27 15:51:34 2005 Return-Path: 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 1397A16A4CE for ; Thu, 27 Jan 2005 15:51:34 +0000 (GMT) Received: from smtpout-2.priv.cc.uic.edu (smtpout-2.cc.uic.edu [128.248.155.233]) by mx1.FreeBSD.org (Postfix) with SMTP id 4A5A843D1F for ; Thu, 27 Jan 2005 15:51:33 +0000 (GMT) (envelope-from zholla1@uic.edu) Received: (qmail 15497 invoked from network); 27 Jan 2005 09:51:32 -0600 Received: from icarus.cc.uic.edu (128.248.155.80) by smtpout-2.cc.uic.edu with SMTP; 27 Jan 2005 09:51:32 -0600 Date: Thu, 27 Jan 2005 09:51:32 -0600 (CST) From: Zera William Holladay X-X-Sender: zholla1@icarus.cc.uic.edu To: Jacques Fourie In-Reply-To: <41F90140.3020705@trispen.com> Message-ID: References: <41F90140.3020705@trispen.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org Subject: Re: kernel vm question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2005 15:51:34 -0000 On Thu, 27 Jan 2005, Jacques Fourie wrote: > Hi, > > I have a kernel module with the following entry point : > > static int test_modevent(module_t mod, int type, void *unused) > { > int s; > unsigned char *p = NULL; > unsigned char v = 0x55; > > switch (type) > { > case MOD_LOAD: > p = (unsigned char *)ip_output; What is ip_output? Do you believe it is a function or variable? It might help if you just state to yourself in your native language what you want to do here. > s = splhigh(); > > v = p[0]; /* Page fault without this line */ > p[0] = v; The above makes no sense. Why would you assign v to p[0] and then set p[0] to the value of v? What is the error message you get? Also, it might help to compile with -Wall since it help to catch some subtle errors. Good luck, -Zera