-----Original Message----- From: kernelnewbies-bounces@kernelnewbies.org [mailto:kernelnewbies- bounces@kernelnewbies.org] On Behalf Of kernelnewbies- request@kernelnewbies.org Sent: Tuesday, March 05, 2013 5:53 PM To: kernelnewbies@kernelnewbies.org Subject: Kernelnewbies Digest, Vol 28, Issue 9
Send Kernelnewbies mailing list submissions to kernelnewbies@kernelnewbies.org
To subscribe or unsubscribe via the World Wide Web, visit http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies or, via email, send a message with subject or body 'help' to kernelnewbies-request@kernelnewbies.org
You can reach the person managing the list at kernelnewbies-owner@kernelnewbies.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of Kernelnewbies digest..."
Today's Topics:
1. Module compilation error (Pietro Paolini) 2. Re: Module compilation error (Mulyadi Santosa) 3. Re: Module compilation error (Valdis.Kletnieks@vt.edu) 4. pthread_lock (ishare) 5. Re: pthread_lock (Mandeep Sandhu) 6. Re: pthread_lock (Valdis.Kletnieks@vt.edu) 7. Major/minor numbers (Shraddha Kamat) 8. Re: pthread_lock (Mandeep Sandhu) 9. Re: pthread_lock (ishare) 10. Re: Major/minor numbers (Anuz Pratap Singh Tomar)
----------------------------------------------------------------------
Message: 1 Date: Mon, 4 Mar 2013 19:48:33 -0500 (EST) From: Pietro Paolini <pulsarpietro@aol.com> Subject: Module compilation error To: kernelnewbies@kernelnewbies.org Message-ID: <8CFE7524C1296F0-1764-9EDF@webmail- m235.sysops.aol.com> Content-Type: text/plain; charset="us-ascii"; format=flowed
Hi all,
I tried, as beginner, to compile a simple module downloaded by internet, hello_printk, I am using ArchLinux and I followed the simplest way for compile a new kernel tree from here :
https://wiki.archlinux.org/index.php/Kernels/Compilation/Arch_Build_Syste m
But when I try to compile I catch these errors:
echo >&2 " ERROR: Kernel configuration is invalid."; \ echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\ echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \ echo >&2 ; \ /bin/false)
Of course I checked the path of the kernel and under the directory wrote on the error messages I can find the files autoconf.h and auto.conf that I really don't understand what could be wrong, the makefile is really really simple then I can post it:
obj-m := hello_printk.o KDIR ?= mypersonalpath/core/linux/src/linux-3.7 PWD := $(shell pwd) default: $(MAKE) -C $(KDIR) M=$(PWD) modules
Someone can help me ?
Pietro Paolini pulsarpietro@aol.com
------------------------------
Message: 2 Date: Tue, 5 Mar 2013 09:07:51 +0700 From: Mulyadi Santosa <mulyadi.santosa@gmail.com> Subject: Re: Module compilation error To: Pietro Paolini <pulsarpietro@aol.com> Cc: kernelnewbies@kernelnewbies.org Message-ID: <CAGdaadZ=eziBhY6zTFzSC5PZ_yTzgnVjQ0rgbk_SQQCjyt6ZBA@mail. gmail.com> Content-Type: text/plain; charset=ISO-8859-1
On Tue, Mar 5, 2013 at 7:48 AM, Pietro Paolini <pulsarpietro@aol.com> wrote:
Hi all,
I tried, as beginner, to compile a simple module downloaded by internet, hello_printk, I am using ArchLinux and I followed the simplest way for compile a new kernel tree from here :
https://wiki.archlinux.org/index.php/Kernels/Compilation/Arch_Build_Sy stem
But when I try to compile I catch these errors:
echo >&2 " ERROR: Kernel configuration is invalid."; \ echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\ echo >&2 " Run 'make oldconfig && make prepare' on kernel src
try the suggested above step. IIRC, those commands will do things like preparing the neccessary object files, headers and so on, so it is ready for you to be used on your kernel programming.
Apologize since I can't provide deeper details about this.
-- regards,
Mulyadi Santosa Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
------------------------------
Message: 3 Date: Mon, 04 Mar 2013 21:47:46 -0500 From: Valdis.Kletnieks@vt.edu Subject: Re: Module compilation error To: Mulyadi Santosa <mulyadi.santosa@gmail.com> Cc: Pietro Paolini <pulsarpietro@aol.com>, kernelnewbies@kernelnewbies.org Message-ID: <6607.1362451666@turing-police.cc.vt.edu> Content-Type: text/plain; charset="us-ascii"
On Tue, 05 Mar 2013 09:07:51 +0700, Mulyadi Santosa said:
On Tue, Mar 5, 2013 at 7:48 AM, Pietro Paolini <pulsarpietro@aol.com> wrote:
echo >&2 " Run 'make oldconfig && make prepare' on kernel src
try the suggested above step. IIRC, those commands will do things like preparing the neccessary object files, headers and so on, so it is ready for you to be used on your kernel programming.
In addition, note that 'make oldconfig' followed by 'make prepare' will only do the right thing and result in a usable module if the source tree matches your running kernel. Doing 'make prepare' on a 3.7.2 source tree and then building a module against it will result in a module that loads in a 3.7.2 kernel with the same .config - but a different .config and/or release will have anything from a module that simply won't load to one that blows up the system for mysterious reasons.
It's *highly* recommended that you first learn how to build, install, and boot a self-compiled kernel (and remember to keep your distro kernel around), and then once you got that down, *then* start building external modules against it.