public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: "Richard Copeman" <richard.copeman@lauterbach.co.uk>
To: "'Woodruff, Richard'" <r-woodruff2@ti.com>,
	linux-omap-open-source@linux.omap.com
Subject: RE: How to build Kernel Modules
Date: Thu, 13 Jul 2006 16:37:46 +0100	[thread overview]
Message-ID: <000401c6a692$4a4c53b0$642aa8c0@Buffy> (raw)
In-Reply-To: <EA12F909C0431D458B9D18A176BEE4A506945C52@dlee02.ent.ti.com>

Hi Richard,

Thanks. I just had a look and couldn't see the wood for the trees. Do you
have a link or something that I can put into their search engine that will
get me close?

Thanks,

Richard.

-----Original Message-----
From: Woodruff, Richard [mailto:r-woodruff2@ti.com] 
Sent: 13 July 2006 16:24
To: Richard Copeman; linux-omap-open-source@linux.omap.com
Subject: RE: How to build Kernel Modules

Down load the Linux Device Drivers module examples.  It has a nice and
easy to use dummy module.  You can find them on the O'Riley site.

You can just compile and insmod .o like your trying.  There are a few
more steps.

Regards,
Richard W.

> -----Original Message-----
> From: linux-omap-open-source-bounces@linux.omap.com
[mailto:linux-omap-
> open-source-bounces@linux.omap.com] On Behalf Of Richard Copeman
> Sent: Thursday, July 13, 2006 8:30 PM
> To: linux-omap-open-source@linux.omap.com
> Subject: How to build Kernel Modules
> 
> Hi,
> 
> I don't know if this is the right place to ask...
> 
> I have OMAP 5912OSK with a 2.6.15 kernel cross compiled from SUSE 9.2
> using
> GCC 3.4.1. That works and I am happy with it. I can build my own tasks
and
> include them into my RAM disk image.
> 
> The next challenge is to build a kernel module. I followed the
guidelines
> in
> Peter Salzman's book/FAQ/tutorial and tried to adapt it for cross
> compiling:
> 
> Arm-linux-gcc -c hellomod.c -Wall
> 
> This produced hellomod.o but when I tried to insmod it on my target I
got
> an
> error:
> 
> / # ls
> ascii       etc         lib         proc        sys         var
> bin         hello       linuxrc     sbin        tmp
> dev         hellomod.o  lost+found  sieve       usr
> / # insmod ./hellomod.o
> Using ./hellomod.o
> No module found in object
> insmod: cannot insert `./hellomod.o': Invalid module format (-1): Exec
> format error
> / # _
> 
> I suspect I haven't done something right in the build stage for my KO.
> 
> My source code is simple and looks like this:
> 
> #define __KERNEL__
> #define MODULE
> 
> #include "/usr/local/arm/3.4.1/arm-linux/include/linux/module.h"
> #include "/usr/local/arm/3.4.1/arm-linux/include/linux/kernel.h"
> 
> #include "/usr/local/arm/3.4.1/arm-linux/include/linux/tty.h"
> 
> int init_module()
> {
> 	console_print("Hello World from Rico\n");
> 	return 0;
> }
> 
> void cleanup_module()
> {
> 	console_print("Goodbye from Rico!\n");
> }
> 
> Can somebody point me at an FAQ or how to for cross compiling Kernel
> Modules
> please?
> 
> TIA,
> 
> Richard.
> 
> _______________________________________________
> Linux-omap-open-source mailing list
> Linux-omap-open-source@linux.omap.com
> http://linux.omap.com/mailman/listinfo/linux-omap-open-source

  reply	other threads:[~2006-07-13 15:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-13 15:24 How to build Kernel Modules Woodruff, Richard
2006-07-13 15:37 ` Richard Copeman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-07-14  2:08 Ishigami, Tatsuya
2006-07-13 15:43 Woodruff, Richard
     [not found] <20060713083220.9E5768062E@linux.omap.com>
2006-07-13 15:00 ` Richard Copeman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000401c6a692$4a4c53b0$642aa8c0@Buffy' \
    --to=richard.copeman@lauterbach.co.uk \
    --cc=linux-omap-open-source@linux.omap.com \
    --cc=r-woodruff2@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox