Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
02-13-2004, 11:34 AM
|
#1
|
|
LQ Newbie
Registered: Feb 2004
Posts: 7
Rep:
|
*** No rule to make target `modules'. Stop.
I am trying to build a hello world program for an external linux kernel module. I am getting the following results. Can someone help me??
@linux:~/projects/drivers> make -C /lib/modules/2.4.21-166-default/build SUBDIRS=$PWD modules
make: Entering directory `/usr/src/linux-2.4.21-166-include/default'
make -C /home/mac/projects/drivers CFLAGS="-D__KERNEL__ -I/usr/src/linux-2.4.21-166-include/default/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -fno-unit-at-a-time -pipe -msoft-float -mpreferred-stack-boundary=2 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.21-166-include/default/include/linux/modversions.h" MAKING_MODULES=1 modules
make[1]: Entering directory `/home/mac/projects/drivers'
make[1]: *** No rule to make target `modules'. Stop.
make[1]: Leaving directory `/home/mac/projects/drivers'
make: *** [_mod_/home/mac/projects/drivers] Error 2
make: Leaving directory `/usr/src/linux-2.4.21-166-include/default'
@linux:~/projects/drivers>
|
|
|
|
02-13-2004, 11:46 AM
|
#2
|
|
Member
Registered: Feb 2004
Location: AT
Distribution: debian etch and SUSE 10.2
Posts: 123
Rep:
|
it's clear that you are missing a rule in your Makefile in the `/home/mac/projects/drivers' directory, I think you should have a look in your Makefiles
I would put this driver in /usr/src/linux/drivers/misc as this is what the makefile says
#
# Makefile for misc devices that really don't fit anywhere else.
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
# Note 2! The CFLAGS definitions are now inherited from the
# parent makes..
#
O_TARGET := misc.o
include $(TOPDIR)/Rules.make
fastdep:
r3gard5
|
|
|
|
02-13-2004, 11:48 AM
|
#3
|
|
Member
Registered: Aug 2003
Location: Old Europe
Distribution: Debian Sid/Sarge
Posts: 37
Rep:
|
hi there. no idea about compiling. but i do get this error if i am trying to compile my kernel in a wrong way. for explample if i type "make menuconfigggggg" instead of "make menuconfig"
it will say smth like "no rule to make "menuconfigggggg" (translated into english)
does this help?
|
|
|
|
02-13-2004, 12:02 PM
|
#4
|
|
LQ Newbie
Registered: Feb 2004
Posts: 7
Original Poster
Rep:
|
Could this be an installation problem?? I am using Suse 9.0. It did not come with the kernel source code. (Took me a while to figure that out).
Here is my makefile and hello file included.
makefile:
obj-m: hello.o
hello.c
#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
int hello_init(void) {printk("<1>Hello, world\n"); return 0; }
void hello_exit(void) { printk("<1>Goodbye cruel world\n"); }
module_init(hello_init);
module_exit(hello_exit);
----------------------------------------------------------------------
*** No rule to make target `modules'. Stop. ( post #1)
I am trying to build a hello world program for an external linux kernel module. I am getting the following results. Can someone help me??
@linux:~/projects/drivers> make -C /lib/modules/2.4.21-166-default/build SUBDIRS=$PWD modules
make: Entering directory `/usr/src/linux-2.4.21-166-include/default'
make -C /home/mac/projects/drivers CFLAGS="-D__KERNEL__ -I/usr/src/linux-2.4.21-166-include/default/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -fno-unit-at-a-time -pipe -msoft-float -mpreferred-stack-boundary=2 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.21-166-include/default/include/linux/modversions.h" MAKING_MODULES=1 modules
make[1]: Entering directory `/home/mac/projects/drivers'
make[1]: *** No rule to make target `modules'. Stop.
make[1]: Leaving directory `/home/mac/projects/drivers'
make: *** [_mod_/home/mac/projects/drivers] Error 2
make: Leaving directory `/usr/src/linux-2.4.21-166-include/default'
@linux:~/projects/drivers>
|
|
|
|
02-14-2004, 10:47 AM
|
#5
|
|
LQ Newbie
Registered: Feb 2004
Posts: 7
Original Poster
Rep:
|
The problem ended up being that I was using instructions for build in 2.6 kernel when I was using a 2.4 kernel. I am still having other problems. I am getting "error unknown processor family" error now.
I also had to run
make mrproper
make cloneconfig
make dep
|
|
|
|
02-15-2004, 07:05 AM
|
#6
|
|
Member
Registered: Feb 2004
Location: AT
Distribution: debian etch and SUSE 10.2
Posts: 123
Rep:
|
Great, I think you didn't set this option in the config. Start again make xconfig or menuconfig and look for Processor type and features - you click the first field and set your CPU-type.
you can also look in the .config file and uncomment one option corresponding to you cpu
# Processor type and features
#
# CONFIG_M386 is not set
# CONFIG_M486 is not set
# CONFIG_M586 is not set
# CONFIG_M586TSC is not set
# CONFIG_M586MMX is not set
# CONFIG_M686 is not set
CONFIG_MPENTIUMIII=y
# CONFIG_MPENTIUM4 is not set
# CONFIG_MK6 is not set
# CONFIG_MK7 is not set
# CONFIG_MK8 is not set
# CONFIG_MELAN is not set
# CONFIG_MCRUSOE is not set
# CONFIG_MWINCHIPC6 is not set
# CONFIG_MWINCHIP2 is not set
# CONFIG_MWINCHIP3D is not set
# CONFIG_MCYRIXIII is not set
# CONFIG_MVIAC3_2 is not set
If it doesn't help I suggest you start over.
# cd /usr/src
# cp linux/.config .
# rm -rf linux......
# tar xjvf linux-.......
# ln -s linux-......... linux
# cd linux && make xconfig
(or menuconfig)
# make dep && make bzImage
(or zImage)
|
|
|
|
02-15-2004, 08:24 AM
|
#7
|
|
LQ Newbie
Registered: Feb 2004
Posts: 7
Original Poster
Rep:
|
I started a new thread w/ the following heading:
"question on usr/include/asm/module.h "
Below is the context, to continue this thread. This is what I found.
(Sorry for duplication)
SUSE 9.0 kernel 2.4.21-144 w/2.4.21-166 kernel-source
I am trying to compile a linux kernel module (hello world). I am getting an error unknown processor.
I noticed that in "/usr/src/linux/arch/i386/defconfig"
CONFIG_M586NOCX8=y
is set.
However, in "/usr/inlcude/asm/module.h" as seen below that option
is not available. Does any one know ehich MODULE_PROC_FAMILY to use??
how do I get around this??
#ifdef __KERNEL__
#ifdef CONFIG_M386
#define MODULE_PROC_FAMILY "386 "
#elif defined CONFIG_M486
#define MODULE_PROC_FAMILY "486 "
#elif defined CONFIG_M586
#define MODULE_PROC_FAMILY "586 "
#elif defined CONFIG_M586TSC
#define MODULE_PROC_FAMILY "586TSC "
#elif defined CONFIG_M586MMX
#define MODULE_PROC_FAMILY "586MMX "
#elif defined CONFIG_M686
#define MODULE_PROC_FAMILY "686 "
#elif defined CONFIG_MPENTIUMII
#define MODULE_PROC_FAMILY "PENTIUMII "
#elif defined CONFIG_MPENTIUMIII
#define MODULE_PROC_FAMILY "PENTIUMIII "
#elif defined CONFIG_MPENTIUM4
#define MODULE_PROC_FAMILY "PENTIUM4 "
#elif defined CONFIG_MK6
#define MODULE_PROC_FAMILY "K6 "
#elif defined CONFIG_MK7
#define MODULE_PROC_FAMILY "K7 "
#elif defined CONFIG_MK8
#define MODULE_PROC_FAMILY "K8 "
#elif defined CONFIG_MELAN
#define MODULE_PROC_FAMILY "ELAN "
#elif defined CONFIG_MCRUSOE
#define MODULE_PROC_FAMILY "CRUSOE "
#elif defined CONFIG_MWINCHIPC6
#define MODULE_PROC_FAMILY "WINCHIPC6 "
#elif defined CONFIG_MWINCHIP2
#define MODULE_PROC_FAMILY "WINCHIP2 "
#elif defined CONFIG_MWINCHIP3D
#define MODULE_PROC_FAMILY "WINCHIP3D "
#elif defined CONFIG_MCYRIXIII
#define MODULE_PROC_FAMILY "CYRIXIII "
#elif CONFIG_MVIAC3_2
#define MODULE_PROC_FAMILY "VIAC3-2 "
#else
#error unknown processor family
#endif
|
|
|
|
02-15-2004, 09:34 AM
|
#8
|
|
Member
Registered: Feb 2004
Location: AT
Distribution: debian etch and SUSE 10.2
Posts: 123
Rep:
|
are you willing to replace linus torvald or what?
the asm directory contains system-type specific definitions and a link is made to the directory containing your system definitions i.e. i386 for ibm-pc (386 style)
# root@bendida:/mnt/devel/src/linux# ls -al include/asm
# lrwxrwxrwx 1 root root 8 Feb 15 14:01 include/asm -> asm-i386
Uhh read the kernel docs finally - everything is written there!
first you are not reading the right manuals and now I doubt, you know what you are doing.
What do you need this all stuff for
Include the header files and they will find their way, otherwise I don't think your program will be usable - of course you should check (include) the architecture type but starting let say with standard 386 proccessor type would fit all.
It is in fact enough to
include asm/modules.h
from "YOUR_KERNELSRC_DIR"/include (YOUR_KERNELSRC_DIR is usally /usr/src/linux)
or something like this so your preprocessor knows the system type you are building for.
NB: asm is linked when you save and exit the configure script as you define the system type there. If you dont run make menuconfig or make xconfig than you should link asm yourself
r3gard5
|
|
|
|
02-15-2004, 06:42 PM
|
#9
|
|
LQ Newbie
Registered: Feb 2004
Posts: 7
Original Poster
Rep:
|
I am just a newbie trying to build a "hello world" kernel module before moving on.
From make menuconfig
the cpu type is "(586-w/o-cmpxchg8) Processor family"
It seems that this processor family (CONFIG_M586NOCX8=y) is not supported or is not accounted for. It is not in the if defs in module.h
what processor family do you have??
|
|
|
|
02-16-2004, 01:02 PM
|
#10
|
|
Member
Registered: Feb 2004
Location: AT
Distribution: debian etch and SUSE 10.2
Posts: 123
Rep:
|
What do you need this dummy kernel module before moveing on - where to are you moving - I don't understand, but anyway in my .config it stays CONFIG_MPENTIUMIII=y and that's what I have, but I build a kernel for another machine and it says CONFIG_M586=y and truly it's Pnetium I (585). When are you going to read the kernel doc's finally it's always there. You can find out what processor you have by typing
# less /proc/cpuinfo
optionally less /proc/cpuinfo | grep model
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 7
model name : Pentium III (Katmai)
stepping : 3
cpu MHz : 501.891
cache size : 512 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 2
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov
pat pse36 mmx fxsr sse
bogomips : 1002.70
r3gard5
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 07:53 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|