Problem writing a device driver

Colin Coe (colin.coe@wcl.wesfarmers.com.au)
Thu, 10 Sep 1998 11:08:26 +0800


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------ =_NextPart_000_01BDDC68.4CD08D4C
Content-Type: text/plain;
charset="iso-8859-1"

Hi all

I have started work on a device driver for the ACL family of multi-port
'intelligent' serial cards. This is the first time I have attempted to
do anything like this, so I have bought the following books: Linux
Device Drivers; Linux Kernel Internals; and Operating System Concepts.

After I have compiled 'acl_main.c' with 'gcc -c acl_main.c', 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

Please help! I have read these books, the ACL technical reference, but
I am still having problems...

Thanks

Colin

<<acl.h>> <<ACL_MAIN.C>>

------ =_NextPart_000_01BDDC68.4CD08D4C
Content-Type: application/octet-stream;
name="acl.h"
Content-Disposition: attachment;
filename="acl.h"

static char *version = "acl.c:v0.0 by Colin Coe, September 1998\n";

#define __NO_VERSION__

#include <linux/module.h>
#include <linux/version.h>
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h>
#include <linux/errno.h>
#include <linux/in.h>
#include <linux/malloc.h>
#include <linux/ioport.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/config.h> /* for CONFIG_MCA */
#include <linux/delay.h> /* for udelay() */

#include <asm/bitops.h>
#include <asm/io.h>

char kernel_version[] = "2.0.31";

/*
I/O Addresses can be 0x200, 0x300, 0x600, or 0x700
Interrupts can be 3, 4, 5, 9, 10, 11, 12, or 15
*/

#define IO_ADDR 0x600

/* Offset defines */

#define MAP_REGISTER 0x000
#define MEGABYTE_MAP_REGISTER 0x004

/* Global Control Block (GCB) fields */

/* The Dual Port RAM, which is selected by the driver, is deivided into
3 sections:
Global Command Block
Channel Control Blocks
Buffer Area

*/

#define GLOBAL_COMMAND_WORD 0x000
#define GLOBAL_STATUS_WORD 0x002
#define GLOBAL_SERVICE_REQUEST 0x004
#define AVAIL_BUFFER_SPACE 0x006
#define BOARD_TYPE 0x008
#define ACL_CONTROL_PROG_VER 0x00A
#define CHAN_CONTROL_BLOCK_COUNT 0x00C
#define CHAN_CONTROL_BLOCK_OFFSET 0x00E
#define CHAN_CONTROL_BLOCK_SIZE 0x010
#define GLOBAL_COMMAND_WORD_2 0x012
#define GLOBAL_STATUS_WORD_2 0x014
#define COMMS_ERROR_SERVICE_REQUEST 0x016
#define INPUT_BUFFER_SERVICE_REQUEST 0x018
#define OUTPUT_BUFFER_SERVICE_REQUEST 0x01A
#define MODEM_STATUS_CHANGE_SERVICE_REQUEST 0x01C
#define CHAN_COMMAND_SERVICE_REQUEST 0x01E

------ =_NextPart_000_01BDDC68.4CD08D4C
Content-Type: application/octet-stream;
name="ACL_MAIN.C"
Content-Disposition: attachment;
filename="ACL_MAIN.C"

#include <linux/module.h>
#include <linux/version.h>
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h>
#include <linux/errno.h>
#include <linux/in.h>
#include <linux/malloc.h>
#include <linux/ioport.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/config.h> /* for CONFIG_MCA */
#include <linux/delay.h> /* for udelay() */

#include <asm/bitops.h>
#include <asm/io.h>

#include "acl.h"

int init_module(void)
{
printk("<1>%s\n", version);

outb_p(0x0, IO_ADDR & MEGABYTE_MAP_REGISTER);
outb(0xD1, IO_ADDR & MAP_REGISTER);

return 0;
}

void cleanup_module(void)
{
printk("<1>ACL Module unloaded\n");
}

------ =_NextPart_000_01BDDC68.4CD08D4C--

-
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