Re: linux/module.h does not exist

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 22, 2010 at 6:11 PM, Robert P. J. Day <rpjday@xxxxxxxxxxxxxx> wrote:
>
>  i'm just catching up with this thread and, if i read it correctly,
> the goal is to build a loadable kernel module using the proper
> incantation and options on the gcc command line, is that correct?
Yes yes right
>but
> i'm not sure i see the value in tha
I was reading and trying to understand the programs given in the Linux
Magazine to which I have posted the links.
>t -- why not just build the module
> using all of the compilation infrastructure built into the kernel
> source Makefile and accompanying build structure?
Sure here is my Makefile

ifeq($(KERNELRELEASE),)
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
.PHONY: build clean
build:
        $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
clean:
        rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c
        rm -rf modules.order Module.symvers
else
$(info Building with KERNELRELEASE =${KERNELRELEASE})
obj-m := sample2.o

endif

I did make but I got following error

Makefile:1: *** missing separator.  Stop.

I will try the Makefile approach also.
Since till now I just was trying an approach the author had described
so had not tried Makefile.
>  not trying to market, but i explain how to do that here:
>
> http://crashcourse.ca/introduction-linux-kernel-programming/introduction-linux-kernel-programming
:)
> in the first few lessons, which are publicly available to everyone.
>
>  granted, you *can* reproduce all of that manually if you want, but i
> don't see the point in making this any more difficult than it has to
> be.  of course, if i've misunderstood what this thread is about, you
> can ignore all this. :-)
>
No if interested do stay in this thread.
I am not sure if the program in magazine is wrong or correct
 or what did the author tried to convey?
Specially the asm_linkage part what is the author trying to explain the readers.
>
> p.s.  specifically, i demonstrate how to build your first kernel
> module here:
>
> http://crashcourse.ca/introduction-linux-kernel-programming/lesson-4-writing-and-running-your-first-kernel-module
>
> again, that lesson is publicly available to everyone.
Ya I found it quite useful.

-- 
Tapas
http://mightydreams.blogspot.com
http://wiki.xensource.com/xenwiki/Xen_on_4_app_servers

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux