[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

utilizing another device driver routine..



Hello people,
I am playing with device drivers for my hardware, and I've got  a few
questions:
I found out that I could use another device's routine which works with
the same chip, but I get `undefined symbol' errors, when I try to link the
bsd image, though in the other device driver these are declared as
`static', and I declare them as `extern'. Is there anything I am missing
here? What I think is that these symbols get stripped off before the bsd
image gets linked, is there any way to make these symbols available? I
think I found one, but I am not quite sure:
I can place common routines into a file, say foobar.c and then in
files.pci (considering that it's a pci device) I can put:

device mydev
attach mydev at pci
file	dev/pci/foobar.c
file	dev/pci/mydev.c

then things seem to work, but I wonder if there's a better way to do such
things (maybe playing with declarations and such).

Also if anyone could point out to some more essential config(8)
documentation which explains the syntaxis of files which it uses to build
kernel compilation directories, it would be just great. I've figured some
syntaxis by reading files.* in kernel sources, but I still don't
understand a few things there... (I haven't yet received my copy of `The
design and Implementation of 4.4BSD operating system'. maybe I would find
answers to some my questions there).

 Thanks beforehands

Fyodor