History log of /freebsd-10.1-release/share/examples/drivers/
Revision Date Author Comments
272461 03-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


227844 22-Nov-2011 marius

Update to use DEVMETHOD_END.


222179 22-May-2011 uqs

Fix more typos to be a good example.

Found by: codespell


183416 27-Sep-2008 ed

Also use dev2unit() in the pseudo-driver example script.

Because I'm planning on MFC'ing my last change to this file, make sure
we use dev2unit() here as well.


183272 22-Sep-2008 ed

Make the make_pseudo_driver.sh shellscript work again.

It seems this script was broken because of the SYSINIT changes and a
rather awkward variable initialisation. For some reason the
make_device_driver.sh script is also broken, related to BUS_SETUP_INTR.
I have no experience with FreeBSD's interrupt handling, so I hope
someone else is willing to take a look at that shell script.

PR: misc/126435
MFC after: 1 month


161559 23-Aug-2006 rik

Fix path for source file in files.FOO.


161139 09-Aug-2006 rik

- Added ability to provide (optional) path to the kernel sources
- Added check of dirs used by example generator
- Fixed path for ${s}/conf/files.FOO and include it via files
directive from config file
- Changed kernel configuration example with the driver: it is
not produced by copying Generic but by including it
- KDB is added to config (for DDB)
- Added module building instead and fixed kernel building

Reviewed by: julian@


161137 09-Aug-2006 rik

Added copyright templete
Fixed compilation

Reviewed by: julian@


161118 09-Aug-2006 rik

- Added 'files "files.FOO"' to config for inclusion of user specific files.
- Added KDB option to config file (for DDB).
- Added ability to compile custom kernel.

Discussed with: julian@


161023 06-Aug-2006 rik

- Added ability to provide (optional) path to the kernel sources
- Fixed path for ${s}/conf/files.FOO and a note that it should be merged into
corresponding file to be able to compile the kernel
- Changed kernel configuration example with the driver: it is not produced by
copying Generic but by including it
- Changed from automatic module building to asking an user if it whants to

Reviewed by: julian@


161022 06-Aug-2006 rik

Fix compilation.

Reviewed by: julian@


143320 09-Mar-2005 stefanf

Device counts are gone.


143316 09-Mar-2005 stefanf

__FUNCTION__ -> __func__


120708 03-Oct-2003 dds

Style fixes: shell script indentation, if/then style, plus a lot
of comments in C code (capitalized, end with full stop).

Submitted by: schweikh


120707 03-Oct-2003 dds

Create a driver that will compile without warnings on -CURRENT
More changes are probably needed to create a correct driver.

Reviewed by: markm
Approved by: schweikh (mentor)


101214 02-Aug-2002 markm

Modernise and tidy up.


86327 13-Nov-2001 arr

- Modify to make the generated device driver code work with current.
- Use M_ZERO instead of another call to bzero().

Inspired by: misc/31905


76175 01-May-2001 schweikh

pseudo-device -> device in kernel config lines. Removed whitespace at EOL.
Reviewed by: joerg, dd


75517 14-Apr-2001 brian

Suggest that kernels are built with ``cd /usr/src; make buildkernel''
Add a comment saying that our softc is automatically allocated by the
parent bus.
Fix lots of spellings


74061 10-Mar-2001 billf

fix spelling errors, clarify comment, add $FreeBSD$


70165 18-Dec-2000 imp

o Add cardbus support (use pci attachment for now)
<bde>
o Add comments in some places to clarify some points.
o Don't typedef sc_p. This isn't usually done in the drivers and may
cause problems in teh future if C goes the C++ route of requiring
one and only one definition for each and every type. Instead use
the current convetion of expanding struct ${1}_softc * inline needed.
o change some comments to be more style(9)-like.
o Define and use DEV2SOFTC to encapsulate storing/getting softc from a
dev_t. This also takes care of the missing cast from the examples.
o Define and use DEVICE2SOFTC, similar to DEV2SOFTC for getting the
softc from a device_t.
</bde>

We still should have this generate foo_{isa,pci,pccard,cardbus,eisa}.c
and foovar.h from templates of some sort, but I was too lazy to do
that in this commit. I did document it in the comments, however.

Note: bde-like corrections made with the help of my my portable
plastic bde icon. Results with the real bde may vary with use.


68748 15-Nov-2000 julian

Slight cleanups after comments from John Hay (Thanks!)
Also add more comments.


68630 12-Nov-2000 julian

Share one devclass between ISA and PCI sections
This will ensure unit numbers will co-ordinate between them


68606 11-Nov-2000 julian

Add basic PCI capability
Not sure how unit numbers are carried across between
PCI and ISA though.. maybe there should be only one devclass between the two?


68533 09-Nov-2000 julian

Add more sample code having read the daemnnews article (August 2000)


68506 08-Nov-2000 julian

Having figured out a bit more of the new-bus puzzle
I have added support for finding non-PNP devices to this
sample loadable ISA driver.
PCI support will come later.

If someone with a clue about newbus were to look it over it would be
really cool.


67657 26-Oct-2000 julian

Add copyright to skeleton.


67653 26-Oct-2000 julian

some more cleanups
still need to handle non-PNP devices properly.


67568 25-Oct-2000 julian

Slowly add more functionality as I learn more about newbus etc.


67505 24-Oct-2000 julian

First effort at bringing these up-to-date.
This creates a skeleton ISA device driver.
I don't pretend that it's fully correct or even opitimal
but it at least creates (and compiles) a 'clean' ISA driver.

Hopefully PCI/PCCARD/etc. support will be added when I understand it.
Unlike the old version this just creates a module. The old one tried to
create a new kernel with the driver to be tested.


50476 28-Aug-1999 peter

$Id$ -> $FreeBSD$


44877 19-Mar-1999 msmith

more $d -> %d fixes


44876 19-Mar-1999 msmith

Fix some $d -> %d mistakes.

Submitted by: crb@crbowman.erols.com


40592 22-Oct-1998 bde

FIxed a bogus comment.


40591 22-Oct-1998 bde

Removed all `vector xxxintr' specifications. Interrupt handlers are now
configured in drivers.

Attempted to update the generated interrupt handler attachment to the
current "temporary" method. Not tested. To test it, someone would first
have to fix the bitrot in the ioctl command arg type.


32529 15-Jan-1998 cracauer

Fix typo


32468 12-Jan-1998 julian

Add code to the example 'driver-o-matic' to support being an LKM
This may not quite work yet but should head the user in the right
direction.


32111 30-Dec-1997 julian

The example drivers should use 'poll' now that it has replaced select.


22197 02-Feb-1997 julian

Description of what the files in this directory do..
(create sample device drivers on request)


22195 02-Feb-1997 julian

These two shell scripts will
create a skeleton device driver.
one for a real device and the other for a pseudo device.
they each take one argument which is the name (prefix) for the driver.

they add the new file to the /sys tree and add appropriate config files
etc for a build.

hopefully others will build on this so that we get
1/ these drivers improved and the shell scripts
improved in how/where that hook the new code in.
2/ similar tools for providing skeletons for other
modules (I'm tempted to do a VFS filesystem skeleton :)

please take a look and fix anything that maybe should be added.
they compile and link fine,
but I think I wouldn't trust them, as faar as RUNNING yet :)
(well they really wouldn't do very much being skeletons..

we need to add PCI and EISA skeletons as well
followed by a SCSI driver skeleton.