lkml.org 
[lkml]   [2004]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Problems compiling kernel modules
Hi friends,

I've askeed questions about errors compiling kernel modules caused by
including <stdio.h> and got some very helpful info here.

I changed those I/O stream and file operation in the code and get the
module compiled, however, there would be warnings like

In file included from /home/lei/modules/test.c:49:
/home/lei/modules/Kcomp.h:21: warning: function declaration isn't a
prototype
/home/lei/modules/Kcomp.h:27: warning: function declaration isn't a
prototype
/home/lei/modules/Kcomp.h:69: warning: function declaration isn't a
prototype

And the no prototype fuction looks like

int preset() // with no arguments
{
p = &nodes[0][0];
return 0;
}


So when I tried to install the module with insmod ./test.ko ,
there would be an error,

insmod: error inserting './test.ko': -1 Unknown symbol in module

Could anyone tell me what is wrong here? Is that because of the no
prototype function declaration?

TIA
Lei

Lee Revell wrote:
> On Sat, 2004-08-21 at 16:46, Lei Yang wrote:
>
>>What about multi-file module?
>>
>>Say test.c doesn't include stdio.h, while there is some other .c file
>>which is to be compiled and linked into test.ko, include stdio?
>>
>>Would that work?
>>
>
>
> Are you just trying to print from a kernel module? Use printk.
>
> The kernel does not really have its own standard input and standard
> output - the kernel manages those things for processes.
>
> Lee
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:05    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog