From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 11 13:06:13 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 2635B106566B for ; Thu, 11 Feb 2010 13:06:13 +0000 (UTC) (envelope-from brampton@gmail.com) Received: from mail-fx0-f226.google.com (mail-fx0-f226.google.com [209.85.220.226]) by mx1.freebsd.org (Postfix) with ESMTP id AA5028FC14 for ; Thu, 11 Feb 2010 13:06:12 +0000 (UTC) Received: by fxm26 with SMTP id 26so1246110fxm.13 for ; Thu, 11 Feb 2010 05:06:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=Nao+qt1TkqKMQ9wxx8BVi2o7kyc31QVDNgc0NvyVWDY=; b=SSXDU9jva2ctyoglrytcnbSZiezUCodxapD1SXX+OROoa34PWnrmiRxG3E7R82NKbC nhR2UODoi/bG1wpzTALaSxzw8LbVOFQQNIwIbAper6mpm6PyYr2LXoWkPDJLvjpAemU/ jM4knMNBOwfzFEBOkoDakgaCsCvnYBrmdMXck= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=XwAYPG0QAN39lrV3W6MUzF2XBVxXC/h7Mj3qmT/2iy2yHMy9ecTc99GjimFi9o8xCy D3atflmcwJYtZrpNadlE0kySkULsBvj27i42T+IiGnduf9MWRtWZjhBT34/RYUL7fs6A lQ9Nts8w3YTewbZ1wagOIjE+TQC4GyW7Mpz8U= MIME-Version: 1.0 Sender: brampton@gmail.com Received: by 10.223.65.12 with SMTP id g12mr2188687fai.69.1265893567741; Thu, 11 Feb 2010 05:06:07 -0800 (PST) In-Reply-To: <11dbd75e1002101825u78d90ef0ufe6015045ecf788a@mail.gmail.com> References: <11dbd75e1002101825u78d90ef0ufe6015045ecf788a@mail.gmail.com> Date: Thu, 11 Feb 2010 13:06:07 +0000 X-Google-Sender-Auth: 8ddd07daf4d4c63f Message-ID: From: Andrew Brampton To: james toy Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers , David Hemmendinger 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: Thu, 11 Feb 2010 13:06:13 -0000 On Thu, Feb 11, 2010 at 2:25 AM, james toy wrote: > Hello Hackers, > > =C2=A0 =C2=A0I am working on learning to write FreeBSD drivers; however, = I have > some practice writing IOKit drivers for MacOSX (they are entirely > different I know!). =C2=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 =C2=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