Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Aug 2000 09:02:02 -0400 (EDT)
From:      "Vladimir N.Silyaev" <vns@mindspring.com>
To:        dbutter@wireless.net
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Need help with driver....(long)
Message-ID:  <200008121302.JAA00442@jupiter.delta.ny.us>
In-Reply-To: <39953196.1103F555@wireless.net>
References:  <200008112235.PAA00839@mass.osd.bsdi.com> <39953196.1103F555@wireless.net>

next in thread | previous in thread | raw e-mail | index | archive | help
In muc.lists.freebsd.hackers, you wrote:
>One thing I did try, was to write a very simple program to open the
>device 
You can (should) just use echo -n >device_file, that's it.
BTW for testing purpose it doesn't required to put now in the /dev
directory, /dev doesn't mean nothing magical.

>(now that I have correctly created the node in /dev) and I
>inserted a printf in my ixj_open() in the driver to indicate that it
>entered the open function...and this does seem to work. If open
>succeeds, can I safely conclude that I'm doing things right?
That's just means that you are able to find your card in ISA bus.

>On another note, I also compiled my skeleton driver as a module and it
>loads ok, but if I try to use my little program to open the device, it
>fails. I then tried inserting printf's in the probe and attach
>functions, but when I load the module I still don't get any output. It
>doesn't seem the driver probes or attaches if I load it as a module.

How you are compiled your driver as a module.
You should to use Makefile like that:
-=-=-=-=-=--
NOMAN=          YES
KMOD=           ixj
SRCS=           ixj.c device_if.h bus_if.h isa_if.h

.include <bsd.kmod.mk>
-=-=-=-=-=--
What FreeBSD version you are using now?

--
Vladimir 

P.S. The line
sc->dev = make_dev(&ixj_cdevsw, 0, UID_ROOT, GID_WHEEL, 0666,
"phone0");

better to rewrite as
int unit = device_get_unit(dev);
...
"ilx%d", unit),

and after that to check the value of sc->dev.




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200008121302.JAA00442>