Re: linux/module.h does not exist

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

 



On Sun, 22 Aug 2010, Mulyadi Santosa wrote:

> On Sun, Aug 22, 2010 at 12:41, Tapas Mishra <mightydreams@xxxxxxxxx> wrote:
> >
> > Following is the program for which it was Makefile I am mentioning it
> > here for the sake of clarity so that you dont have to read first post
> >
> > #include <linux/kernel.h>
> > #include <sys/syscall.h>
> > #include <linux/module.h>
> > extern void *sys_table[];
> ^^^
>
> uhum? AFAIK sys call table is not exported in 2.6.x.... so even if
> your code is perfectly compiled and produced valid .ko kernel
> module, I doubt it will work.
>
> Unless I missed something in recent development....
>
> Regarding the missing __NR_exit, I think you forgot to include
> asm/unistd.h. And try to include asm/syscalls

  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?  but
i'm not sure i see the value in that -- why not just build the module
using all of the compilation infrastructure built into the kernel
source Makefile and accompanying build structure?

  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. :-)

rday

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.

-- 

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

        Top-notch, inexpensive online Linux/OSS/kernel courses
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

--
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