linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Simple module, but won't build
@ 2006-08-31 22:55 Steven Kaiser
  2006-09-01  6:35 ` Josu Onandia
  0 siblings, 1 reply; 10+ messages in thread
From: Steven Kaiser @ 2006-08-31 22:55 UTC (permalink / raw)
  To: linuxppc-embedded

Hi gurus:

Newbie here.  I am using ELDK 3.1.1, 2.4.25 kernel, and a Lite5200b board.
I run the kernel in RAM, and mount a filesystem via NFS.  So far so good,
and I move on to trying to build a simple module to write to a few LEDs.

Simple hello world modules compile and insmod/rmmod fine, but when I try to
#include <asm/io.h>, here I have the exact same problem as Richard Danter
did: CONFIG_KERNEL_START and CONFIG_TASK_SIZE are not defined anywhere in
any headers-- just in the config files.

http://ozlabs.org/pipermail/linuxppc-embedded/2004-May/014037.html

My little wrinkle to add to this problem is I have recompiled the kernel, as
advised in the replies to Richard's post, with the 'Set Custom Kernel Base
Address' and 'Set Custom user task size' options enabled, but in my case I
still I cannot find CONFIG_KERNEL_START and CONFIG_TASK_SIZE defined
anywhere noteworthy.

My 'include/linux/autoconf.h' file is empty, and I don't even have an
'include/config/' directory at all.  Where in the steps of recompiling the
kernel should these files and directories get generated?

My process for building the kernel is:

$ cd /opt/eldk/usr/src/linuxppc_2_4_devel
$ make mrproper
$ make lite5200b_config
$ make menuconfig
$ make dep
$ make uImage
$ cp arch/ppc/boot/images/uImage /tftpboot/MPC5200/uImage

I can manually include CONFIG_KERNEL_START and CONFIG_TASK_SIZE in my module
source, compile, insmod, and all goes well (except my LEDs don't light up
but first things first).

When my kernel boots, I get a few gripes which I think are related to this
issue:

Finding module dependencies:  depmod: Can't open
/lib/modules/2.4.25/modules.deg [FAILED]
modprobe: Can't open dependencies file /lib/modules/2.4.25/modules.dep (No
such)

Young and foolish, I figured maybe I should try:

$ make modules
$ make modules_install

Oops.  That was bad.  Now I cannot even compile the simplest hello.c module
without a page of errors, the first being a complaint of not being able to
find linux/autoconf.h.  Before I only had trouble when I tried to #include
<asm/io.h>, now it happens 100% of the time.

So I went back and turned off module support, recompiled the kernel, and
still cannot compile hello.c.  I also tried recompiling the kernel after
doing a "make oldconfig", and still cannot compile a simple module anymore.
I think I am going to have to go back to square 1 and reinstall ELDK and
everything from scratch.  But before I do:

Any insight into the generation of autoconf.h, and whereabouts this file
should come from?  I will watch for it when I redo the whole process.

Steven Kaiser
Chemistry Electronics Facility
University of California, Irvine
2347 Natural Sciences 2
Irvine, CA  92697-2025
(949)824-7520

^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE: Simple module, but won't build
@ 2006-09-06 19:29 Steven Kaiser
  0 siblings, 0 replies; 10+ messages in thread
From: Steven Kaiser @ 2006-09-06 19:29 UTC (permalink / raw)
  To: linuxppc-embedded


Thanks Josu for the LED source code.  It works!

Turns out my basic problem with autoconf.h was my confusion with all the
kernel trees I have around.  I was downloading and compiling new kernels
into:
/opt/eldk/
but my NFS filesystem was targeted at:
/opt/eldk/ppc_82xx/
 
autoconf.h is generated during the $make menuconfig step (I'm pretty sure),
and so was placed in:
/opt/eldk/usr/src/linuxppc_2_4_devel/include/linux
but my running kernel was looking for it in:
/opt/eldk/ppc_82xx/usr/src/linuxppc_2_4_devel/include/linux

So I downloaded new kernel sources into /opt/eldk/ppc_82xx/, recompiled,
fixed some symbolic links, and did a little makefile magic to ensure the
right stuff is included when I compile modules, and all now seems well.

Steven Kaiser
Chemistry Electronics Facility
University of California, Irvine
2347 Natural Sciences 2
Irvine, CA  92697-2025

^ permalink raw reply	[flat|nested] 10+ messages in thread
* Simple module, but won't build
@ 2004-05-04 18:03 Richard Danter
  2004-05-04 19:10 ` Wolfgang Denk
  2004-05-04 19:38 ` Joshua Lamorie
  0 siblings, 2 replies; 10+ messages in thread
From: Richard Danter @ 2004-05-04 18:03 UTC (permalink / raw)
  To: linuxppc-embedded


Hi All,

I am trying to build a simple module which will let me write to a bank
of LED's on my board.

When I #include <asm/io.h> I get this error:

/opt/eldk3.0/ppc_82xx/usr/include/asm/io.h: In function `virt_to_bus':
/opt/eldk3.0/ppc_82xx/usr/include/asm/io.h:235: `CONFIG_KERNEL_START'
undeclared (first use in this function)

the error also occurs in several other functions. I also see errors when
I #include <asm/uaccess.h> as follows:

/opt/eldk3.0/ppc_82xx/usr/include/asm/uaccess.h: In function `verify_area':
/opt/eldk3.0/ppc_82xx/usr/include/asm/uaccess.h:37: `CONFIG_TASK_SIZE'
undeclared (first use in this function)

also in several functions.

I know I have used these with no problems with an older kernel and
compiler. Is there something I need to add to make these work??

I am using ELDK 3.0 with the 2.4.24-pre2 kernel on an 8260 target.

Many thanks,
Rich

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2006-09-06 19:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-31 22:55 Simple module, but won't build Steven Kaiser
2006-09-01  6:35 ` Josu Onandia
  -- strict thread matches above, loose matches on Subject: below --
2006-09-06 19:29 Steven Kaiser
2004-05-04 18:03 Richard Danter
2004-05-04 19:10 ` Wolfgang Denk
2004-05-04 19:46   ` Richard Danter
2004-05-04 20:19     ` Wolfgang Denk
2004-05-04 21:15     ` Sam Ravnborg
2004-05-04 21:46       ` Wolfgang Denk
2004-05-04 19:38 ` Joshua Lamorie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).