aboutsummaryrefslogtreecommitdiff
path: root/share/examples/drivers
Commit message (Collapse)AuthorAgeFilesLines
* share: Delete bitrotted make_*_driver.sh scriptsJessica Clarke2025-07-102-477/+0
| | | | | | | | | | | | | | | | These scripts have not seen the necessary changes to keep them up to date with current KPIs and coding practices. They use I/O ports directly rather than any bus abstractions, use i386 (which is on the way out for kernel configs) as the architecture of choice for generated kernel configs, use ISA KPIs, use INTR_TYPE_FAST (renamed in 2000 to INTR_FAST and removed in 2011), and likely have other issues too that render them more harm than good for the uninitiated developer looking for a driver template. If anyone wants to invest time in modernising them they can do so and bring them back, but for now delete them. Reviewed by: cperciva, imp, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D50468
* newbus: replace leftover device unit wildcardsAhmad Khalifa2025-06-211-1/+2
| | | | | | Reviewed by: imp, jhb Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D50913
* make_*_driver.sh: Don't include $FreeBSD$ in generated filesJohn Baldwin2023-09-252-14/+0
| | | | | Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D41950
* Remove $FreeBSD$: one-line bare tagWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove 'All Rights Reserved' from the collection copyright and templates.Warner Losh2018-05-092-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original Berkeley Software Distributions were made in the 1980's and 1990's. At that time, the Buenos Ares Convention of 1910 was in force in most of the countries in the Americas. It required an affirmative statement of rights reservation, typically using 'All Rights Reserved.' The Regents included this phrase in their copyright notices to invoke this treaty to ensure maximal copyright protection. In the 1990's, Latin America coutries ratifeid the Berne Convention on copyrights which prohibited them from requiring an affirmative statement to reserve the rights. When Nicaragua ratified in 2000, the Buenos Ares Convention of 1910 was effectively repealed. This made all the 'All Rights Reserved' phrases obsolete and legal deadweight most of the time, and certainly in the cases removed here. Since it's no longer required, and is in fact meaningless, core has decided to dropped it from the project's collection copyright and sample templates. It encourages other rights holders to do the same after consultation with their legal department. More see https://en.wikipedia.org/wiki/Buenos_Aires_Convention for more information. Approved by: core@ (emaste@, jhb@) Differential Review: https://reviews.freebsd.org/D15264 Notes: svn path=/head/; revision=333391
* Remove EISA reference hereWarner Losh2017-02-161-1/+1
| | | | Notes: svn path=/head/; revision=313842
* Update to use DEVMETHOD_END.Marius Strobl2011-11-221-1/+1
| | | | Notes: svn path=/head/; revision=227844
* Fix more typos to be a good example.Ulrich Spörlein2011-05-221-1/+1
| | | | | | | Found by: codespell Notes: svn path=/head/; revision=222179
* Also use dev2unit() in the pseudo-driver example script.Ed Schouten2008-09-271-1/+1
| | | | | | | | Because I'm planning on MFC'ing my last change to this file, make sure we use dev2unit() here as well. Notes: svn path=/head/; revision=183416
* Make the make_pseudo_driver.sh shellscript work again.Ed Schouten2008-09-221-2/+2
| | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=183272
* Fix path for source file in files.FOO.Roman Kurakin2006-08-231-1/+1
| | | | Notes: svn path=/head/; revision=161559
* - Added ability to provide (optional) path to the kernel sourcesRoman Kurakin2006-08-091-22/+122
| | | | | | | | | | | | | | | - 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@ Notes: svn path=/head/; revision=161139
* Added copyright templeteRoman Kurakin2006-08-091-32/+57
| | | | | | | | | Fixed compilation Reviewed by: julian@ Notes: svn path=/head/; revision=161137
* - Added 'files "files.FOO"' to config for inclusion of user specific files.Roman Kurakin2006-08-091-3/+24
| | | | | | | | | | - Added KDB option to config file (for DDB). - Added ability to compile custom kernel. Discussed with: julian@ Notes: svn path=/head/; revision=161118
* - Added ability to provide (optional) path to the kernel sourcesRoman Kurakin2006-08-061-19/+32
| | | | | | | | | | | | | - 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@ Notes: svn path=/head/; revision=161023
* Fix compilation.Roman Kurakin2006-08-061-12/+9
| | | | | | | Reviewed by: julian@ Notes: svn path=/head/; revision=161022
* Device counts are gone.Stefan Farfeleder2005-03-091-1/+1
| | | | Notes: svn path=/head/; revision=143320
* __FUNCTION__ -> __func__Stefan Farfeleder2005-03-091-2/+2
| | | | Notes: svn path=/head/; revision=143316
* Style fixes: shell script indentation, if/then style, plus a lotDiomidis Spinellis2003-10-031-88/+83
| | | | | | | | | of comments in C code (capitalized, end with full stop). Submitted by: schweikh Notes: svn path=/head/; revision=120708
* Create a driver that will compile without warnings on -CURRENTDiomidis Spinellis2003-10-031-18/+21
| | | | | | | | | | More changes are probably needed to create a correct driver. Reviewed by: markm Approved by: schweikh (mentor) Notes: svn path=/head/; revision=120707
* Modernise and tidy up.Mark Murray2002-08-022-162/+131
| | | | Notes: svn path=/head/; revision=101214
* - Modify to make the generated device driver code work with current.Andrew R. Reiter2001-11-132-10/+11
| | | | | | | | | - Use M_ZERO instead of another call to bzero(). Inspired by: misc/31905 Notes: svn path=/head/; revision=86327
* pseudo-device -> device in kernel config lines. Removed whitespace at EOL.Jens Schweikhardt2001-05-011-1/+1
| | | | | | | Reviewed by: joerg, dd Notes: svn path=/head/; revision=76175
* Suggest that kernels are built with ``cd /usr/src; make buildkernel''Brian Somers2001-04-141-19/+23
| | | | | | | | | Add a comment saying that our softc is automatically allocated by the parent bus. Fix lots of spellings Notes: svn path=/head/; revision=75517
* fix spelling errors, clarify comment, add $FreeBSD$Bill Fumerola2001-03-101-8/+6
| | | | Notes: svn path=/head/; revision=74061
* o Add cardbus support (use pci attachment for now)Warner Losh2000-12-181-43/+81
| | | | | | | | | | | | | | | | | | | | | | | | | <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. Notes: svn path=/head/; revision=70165
* Slight cleanups after comments from John Hay (Thanks!)Julian Elischer2000-11-151-19/+54
| | | | | | | Also add more comments. Notes: svn path=/head/; revision=68748
* Share one devclass between ISA and PCI sectionsJulian Elischer2000-11-121-3/+3
| | | | | | | This will ensure unit numbers will co-ordinate between them Notes: svn path=/head/; revision=68630
* Add basic PCI capabilityJulian Elischer2000-11-111-42/+162
| | | | | | | | Not sure how unit numbers are carried across between PCI and ISA though.. maybe there should be only one devclass between the two? Notes: svn path=/head/; revision=68606
* Add more sample code having read the daemnnews article (August 2000)Julian Elischer2000-11-091-52/+113
| | | | Notes: svn path=/head/; revision=68533
* Having figured out a bit more of the new-bus puzzleJulian Elischer2000-11-081-52/+176
| | | | | | | | | | | | 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. Notes: svn path=/head/; revision=68506
* Add copyright to skeleton.Julian Elischer2000-10-261-6/+29
| | | | Notes: svn path=/head/; revision=67657
* some more cleanupsJulian Elischer2000-10-261-66/+113
| | | | | | | still need to handle non-PNP devices properly. Notes: svn path=/head/; revision=67653
* Slowly add more functionality as I learn more about newbus etc.Julian Elischer2000-10-251-22/+93
| | | | Notes: svn path=/head/; revision=67568
* First effort at bringing these up-to-date.Julian Elischer2000-10-241-288/+277
| | | | | | | | | | | | | 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. Notes: svn path=/head/; revision=67505
* $Id$ -> $FreeBSD$Peter Wemm1999-08-282-4/+4
| | | | Notes: svn path=/head/; revision=50476
* more $d -> %d fixesMike Smith1999-03-191-4/+4
| | | | Notes: svn path=/head/; revision=44877
* Fix some $d -> %d mistakes.Mike Smith1999-03-191-5/+5
| | | | | | | Submitted by: crb@crbowman.erols.com Notes: svn path=/head/; revision=44876
* FIxed a bogus comment.Bruce Evans1998-10-221-3/+3
| | | | Notes: svn path=/head/; revision=40592
* Removed all `vector xxxintr' specifications. Interrupt handlers are nowBruce Evans1998-10-221-7/+13
| | | | | | | | | | | 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. Notes: svn path=/head/; revision=40591
* Fix typoMartin Cracauer1998-01-151-1/+1
| | | | Notes: svn path=/head/; revision=32529
* Add code to the example 'driver-o-matic' to support being an LKMJulian Elischer1998-01-121-6/+101
| | | | | | | | This may not quite work yet but should head the user in the right direction. Notes: svn path=/head/; revision=32468
* The example drivers should use 'poll' now that it has replaced select.Julian Elischer1997-12-302-10/+10
| | | | Notes: svn path=/head/; revision=32111
* Description of what the files in this directory do..Julian Elischer1997-02-021-0/+45
| | | | | | | (create sample device drivers on request) Notes: svn path=/head/; revision=22197
* These two shell scripts willJulian Elischer1997-02-022-0/+721
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. Notes: svn path=/head/; revision=22195