Merge from vendor branch LIBSTDC++:
[dragonfly.git] / share / examples / drivers / README
1 $FreeBSD: src/share/examples/drivers/README,v 1.2.6.1 2002/11/16 13:24:28 blackend Exp $
2 $DragonFly: src/share/examples/drivers/README,v 1.2 2003/06/17 04:36:57 dillon Exp $
3
4 Author: Julian Elischer
5
6 The files in this directory are shell scripts.
7
8 They will, when run, create an example skeleton driver
9 for you. You can use this driver as a starting point for
10 writing drivers for your own devices. They have all the hooks needed
11 for initialization, probing, attaching, as well as DEVFS
12 node creation. They also create sample ioctl commands and a sample
13 ioctl definition .h file in /sys/sys. In other words they are fully
14 functional in a 'skeleton' sort of a way. They support multiple devices
15 so that you may have several of your 'foobar' devices probed and attached
16 at once.
17
18 I expect that these scripts will improve with time.
19
20 At present these scripts also link the newly created driver into
21 the kernel sources in /sys. Possibly a better way would be
22 to make them interactive. (and ask what kernel tree to use as well as
23 a name for the driver.).
24
25 There are presently two scripts.
26 One for making a real device driver for ISA devices, and 
27 one for making a device driver for pseudo devices (e.g. /dev/null).
28 Hopefully they will be joined by similar scripts for creating
29 skeletons for PCI and EISA devices as well.
30
31 Give them a single argument: the name of the driver.
32 They will use this given name in many places within the driver,
33 both in lower and upper case form.  (conforming to normal usage).
34
35 The skeleton driver should already link with the kernel 
36 and in fact the shell script will compile a kernel with the new 
37 drive linked in..  The new kernel should still be 
38 runnable and the new driver should be
39 fully callable (once you get your device to probe).
40 You should simply edit the driver and continue to use
41 'make' (as done in the script) until your driver does what you want.
42
43 The driver will end up in /sys/i386/isa for the device driver script,
44 and in /sys/dev for the pseudo driver script.