From owner-freebsd-hackers@FreeBSD.ORG Fri Feb 12 15:52:14 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D319B106566B for ; Fri, 12 Feb 2010 15:52:14 +0000 (UTC) (envelope-from nil@opensesame.st) Received: from mail-px0-f176.google.com (mail-px0-f176.google.com [209.85.216.176]) by mx1.freebsd.org (Postfix) with ESMTP id B3D1B8FC16 for ; Fri, 12 Feb 2010 15:52:14 +0000 (UTC) Received: by pxi6 with SMTP id 6so2698577pxi.14 for ; Fri, 12 Feb 2010 07:52:14 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.152.30 with SMTP id z30mr1028563wfd.293.1265989934237; Fri, 12 Feb 2010 07:52:14 -0800 (PST) X-Originating-IP: [149.106.192.131] In-Reply-To: References: <11dbd75e1002101825u78d90ef0ufe6015045ecf788a@mail.gmail.com> From: james toy Date: Fri, 12 Feb 2010 10:51:54 -0500 Message-ID: <11dbd75e1002120751k7c7ef432m4efbe68f6fed95e8@mail.gmail.com> To: Andrew Brampton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers Subject: Re: KLD hello.ko: depends on kernel - not available or version mismatch 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, 12 Feb 2010 15:52:14 -0000 On Thu, Feb 11, 2010 at 08:06, Andrew Brampton wrote: > On Thu, Feb 11, 2010 at 2:25 AM, james toy wrote: >> Hello Hackers, >> >> =A0 =A0I am working on learning to write FreeBSD drivers; however, I hav= e >> some practice writing IOKit drivers for MacOSX (they are entirely >> different I know!). =A0The code I am working with can be found here: >> >> http://pastebin.com/m2bbb393c >> >> and I am getting the error: >> >> dontpanic# kldload ./hello.ko >> kldload: can't load ./hello.ko: Exec format error >> >> dmesg reads: >> >> dontpanic# kldload ./hello.ko >> kldload: can't load ./hello.ko: Exec format error >> >> and finally uname -a: >> >> FreeBSD dontpanic.union.edu 9.0-CURRENT FreeBSD 9.0-CURRENT #1 >> r198859: Wed Feb 10 09:59:54 EST 2010 >> james@dontpanic.union.edu:/usr/obj/usr/src_klog/sys/DONTPANIC =A0amd64 >> >> any information pointing me to being able to load this driver would be >> greatly appreciated. >> >> respectfully, >> >> james toy > > I just built your code on my FreeBSD 8 box and it compiles and loads > fine. How are you compiling your code? I used this makefile > http://pastebin.com/f3ab71917 and all I typed was this: > > make > sudo make install > sudo make load > > and I get the "hello, fail" message, and then I typed > sudo make unload > > and I got the "unload fail" message. > > Andrew > Andrey was correct, param.h and kern.osreldate were not the same. thanks very much for the prompt responses. =3Djt