Problem writing a device driver

Matthew Wilcox (Matthew.Wilcox@genedata.com)
Thu, 10 Sep 1998 13:57:20 +0200


> From: Colin Coe <colin.coe@wcl.wesfarmers.com.au>
> Date: Thu, 10 Sep 1998 11:08:26 +0800
> Subject: Problem writing a device driver
>
> After I have compiled 'acl_main.c' with 'gcc -c acl_main.c',

you generally also need -D__KERNEL__ and -I/usr/src/linux/include

> I run
> 'insmod acl_main.o' and get the following errors:
> __outbc_p undefined
> __outb_p undefined
> __outbc undefined
> __outb undefined
> Loading failed! The module symbols (from linux-2.0.31) don't match your
> linux-2.0.31

This is caused by not compiling with (at least) -O. Might I suggest
that the asm/io.h file contains a test against __OPTIMIZE__ to catch
this one at compile time & give a useful error message? Something like..

--- ../../include/asm-i386/io.h Thu Sep 10 13:40:51 1998
+++ /usr/include/asm/io.h Sun Oct 1 18:18:58 1995
@@ -84,15 +84,6 @@
#define eth_io_copy_and_sum(a,b,c,d) eth_copy_and_sum((a),(void *)(b),(c),(d))

/*
- * Any function which uses these must inline them, which only happens if
- * at least -O is used.
- */
-
-#ifndef __OPTIMIZE__
-#error You must use at least -O to compile this file
-#endif
-
-/*
* Talk about misusing macros..
*/

-- 
Matthew Wilcox <willy@bofh.ai>
"I decry the current tendency to seek patents on algorithms.  There are
better ways to earn a living than to prevent other people from making use of
one's contributions to computer science."  -- Donald E. Knuth, TAoCP vol 3

- 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/faq.html