From owner-freebsd-drivers@FreeBSD.ORG Tue Jul 31 12:34:17 2007 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 89CBA16A417 for ; Tue, 31 Jul 2007 12:34:17 +0000 (UTC) (envelope-from die.gestalt@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.250]) by mx1.freebsd.org (Postfix) with ESMTP id 3E61313C465 for ; Tue, 31 Jul 2007 12:34:17 +0000 (UTC) (envelope-from die.gestalt@gmail.com) Received: by an-out-0708.google.com with SMTP id c14so438319anc for ; Tue, 31 Jul 2007 05:34:16 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=maMlTJzjPvJFLAHKr5UYvSoxDXA4pc5Ri8YlfGbdPpbfWKrLbhoqEutXKdxUZF2JzZIQdZ9zjbgoCX8UG2CGRGM7Um4Of2EzM69RNlosEFutMC5bwvGPKsObbqxBrL2Rz3XC2iMv+m3G2n8h0OZoPpgbOc5N//Xoi/K9AFX4GWE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=UowsPjc/IJwkaHm0W9oqY/Sb2OiQqqsoI3YpxDpWKaM6JEYPuOkgR1E9pZBCr6OnFIX/JGa5yGhrwFeZbl90xJN6LxnaMp9daj0OPGbWtjCwwrNDduAKeb+7cMJgtjI+7Pw9SwQk/hc2H/yiblimMmUuKAOzHemJYyvNCXFnAKw= Received: by 10.100.110.16 with SMTP id i16mr5200747anc.1185883632769; Tue, 31 Jul 2007 05:07:12 -0700 (PDT) Received: by 10.100.96.15 with HTTP; Tue, 31 Jul 2007 05:07:12 -0700 (PDT) Message-ID: <5bf3e10d0707310507p1c2bd7dbx381e2c96bce39f10@mail.gmail.com> Date: Tue, 31 Jul 2007 14:07:12 +0200 From: "Die Gestalt" To: freebsd-drivers@freebsd.org In-Reply-To: <001001c7d2ee$283f8790$54759a52@Lusitania> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <001001c7d2ee$283f8790$54759a52@Lusitania> Subject: Re: Simple driver X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jul 2007 12:34:17 -0000 That's because when you program a driver you really don't need to check the input values. You can cast values and dereference them and hope it will work, that's no problem. Oh no wait, that's exactly the other way around. Read this: http://www.freebsd.org/doc/en_US.ISO8859-1/books/arch-handbook/book.html Work on the examples, spend some time and if you still have a problem feel free to ask. By the way I think you can do what you want without writing a driver. Which brings me to some rules regarding driver development: 1 - You don't need to write a driver. 2 - If you really need to write a driver, see rule #1 3 - If you absolutely need to write a driver and the sake of humanity depends on this very driver you are about to write then OMG A THREE HEADED MONKEY!!! On 7/30/07, Ar3s wrote: > Hello everyone, > Im not sure if this is the right list for my question. I'm trying to make a simple module that will echo some information of a given pid. But the problem is that it causes the kernel to panic, and I have no idea why. I have attached the source. > > cheers, > Bruno > _______________________________________________ > freebsd-drivers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-drivers > To unsubscribe, send any mail to "freebsd-drivers-unsubscribe@freebsd.org" > > >