* Problem for "insmod: unresolved symbol printk"
@ 2006-06-22 14:31 Zhou Rui
2006-06-22 17:48 ` Olof Johansson
0 siblings, 1 reply; 3+ messages in thread
From: Zhou Rui @ 2006-06-22 14:31 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1206 bytes --]
Hi, all
I'm a newbie for linuxppc. I've tried to write a simple hello.c as a kernel module.
/*hello.c*/
#ifndef MODULE
#define MODULE
#endif
#ifndef __KERNEL__
#define __KERNEL__
#endif
#include <linux/module.h>
#include <linux/kernel.h>
int init_module(void)
{
printk("Hello world 1.\n");
return 0;
}
void cleanup_module(void)
{
printk("Goodbye world 1.\n");
}
I wrote the code on a machine with Slackware installed. There was a PowerPC405EP board connected to the machined with NFS used. On the PowerPC board, the kernel is linuxppc-2.4.25-rthal5 and can be logged in via telnet. On the machine, there was also a toolchain for PowerPC and there were a series of commands beginning with "powerpc-linux-" existing. I've tried to cross-compile the source file with "powerpc-linux-gcc -c hello.c" or "powerpc-linux-gcc -c -DMODVERSIONS -I/usr/src/linuxppc-2.4.25/include hello.c" for PowerPC. But when I telneted into the board and run "insmod hello.o" on the PowerPC board, there always was "insmod: unresolved symbol printk". So would anyone give me some advice about the problem? Thank you very much.
---------------------------------
雅虎免费邮箱-3.5G容量,20M附件
[-- Attachment #2: Type: text/html, Size: 1458 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Problem for "insmod: unresolved symbol printk"
2006-06-22 14:31 Problem for "insmod: unresolved symbol printk" Zhou Rui
@ 2006-06-22 17:48 ` Olof Johansson
2006-06-23 3:43 ` Zhou Rui
0 siblings, 1 reply; 3+ messages in thread
From: Olof Johansson @ 2006-06-22 17:48 UTC (permalink / raw)
To: Zhou Rui; +Cc: linuxppc-dev
On Thu, Jun 22, 2006 at 10:31:56PM +0800, Zhou Rui wrote:
> Hi, all
> I'm a newbie for linuxppc. I've tried to write a simple hello.c as a kernel module.
Hi,
http://kernelnewbies.org/ should have information on kernel module
basics, and where to find help if you still have problems.
-Olof
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Problem for "insmod: unresolved symbol printk"
2006-06-22 17:48 ` Olof Johansson
@ 2006-06-23 3:43 ` Zhou Rui
0 siblings, 0 replies; 3+ messages in thread
From: Zhou Rui @ 2006-06-23 3:43 UTC (permalink / raw)
To: Olof Johansson; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1216 bytes --]
Hi,
My host machine kernel was 2.4.28 and the PowerPC board was 2.4.25-rthal5. I followed the Standard Makefile for 2.4(<=) kernels on the page http://kernelnewbies.org/FAQ/LinuxKernelModuleCompile?highlight=%28insmod%29, and do some changes based on my situation:
TARGET := hello
INCLUDE := -I/lib/modules/2.4.25-rthal5/build/include
CFLAGS := -O2 -Wall -DMODULE -D__KERNEL__ -DLINUX
CC := powerpc-linux-gcc
${TARGET}.o: ${TARGET}.c
$(CC) $(CFLAGS) ${INCLUDE} -c ${TARGET}.c
The problem is still "insmod: unresolved symbol printk". But when I logged in the PowerPC board, and # fgrep 'printk' /proc/ksyms, there was "c0015500 printk_Rdd132261".
Olof Johansson <olof@lixom.net> : On Thu, Jun 22, 2006 at 10:31:56PM +0800, Zhou Rui wrote:
> Hi, all
> I'm a newbie for linuxppc. I've tried to write a simple hello.c as a kernel module.
Hi,
http://kernelnewbies.org/ should have information on kernel module
basics, and where to find help if you still have problems.
-Olof
Zhou Rui
Distributed & Embedded System Lab
School of Information Science & Engineering
Lanzhou University, P. R. China
http://dslab.lzu.edu.cn/~zr/
---------------------------------
Mp3疯狂搜-新歌热歌高速下
[-- Attachment #2: Type: text/html, Size: 1697 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-06-23 3:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-22 14:31 Problem for "insmod: unresolved symbol printk" Zhou Rui
2006-06-22 17:48 ` Olof Johansson
2006-06-23 3:43 ` Zhou Rui
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).