can't access kernel with device driver

viehoff (uzsjdz@uni-bonn.de)
Sun, 24 Oct 1999 02:16:43 +0200


Hi,

I added a file (robin.c) with a varible (robactive) to the kernel
network
code and want to change its value and output other kernel data
(rob_head).
So I wrote a char device-driver module (robindevice.c), but when I try
to
insmod robindevice.o it, I get the message:
robindevice: "unresolved symbol robactive".

Sources:
kernel:
/usr/src/linux-2.2.10-robin/include/net/robin.h
... struct ratenglied{...}; ...

net/ipv4/robin.c
... #include <net/robin.h>
int robactive = 1;
struct ratenglied *rob_head=NULL; ...

module:
/Robin/DeviceDriver/robindevice.c
... #include "/usr/src/linux-2.2.10-robin/include/net/robin.h"
extern int robinactive;
extern struct ratenglied *rob_head; ...

/Robin/DeviceDriver/Makefile
... CC = gcc
MODCFLAGS := -O -Wall -Wstrict-prototypes -DMODULE -D__KERNEL__
TARGET = robindevice
SOURCES = robindevice.c
OBJECTS = $(SOURCES:%.c=%.o)
all: $(TARGET).o
$(TARGET).o: $(SOURCES) /usr/include/linux/version.h
$(CC) $(MODCFLAGS) -c $(SOURCES)

I found an entry robinactive in /usr/src/linux-2.2.10/System.map.

(I added 'int robinactive=1;' to robin.h and made it extern in robin.c,
no problem to insmod the driver, but then it only used a copy; printk
showed two different values in kernel and module.)

Why is robinactive a unresolved symbol, what have I to do, so that I
can use the char driver module to read and write data to kernel
variable and structures?

Thanks,

Guido

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/