Difference between revisions of "Device drivers"
(→Sample drivers) |
(→Sample drivers) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
* [http://en.wikibooks.org/wiki/The_Linux_Kernel Linux kernel internals reference, wikibook] - under construction | * [http://en.wikibooks.org/wiki/The_Linux_Kernel Linux kernel internals reference, wikibook] - under construction | ||
* [http://www.makelinux.net/ldd3/ Linux Device Drivers, 3rd Edition] | * [http://www.makelinux.net/ldd3/ Linux Device Drivers, 3rd Edition] | ||
− | |||
== Sample drivers == | == Sample drivers == | ||
* [https://github.com/makelinux/ldt/ LDT - Linux Driver Template] - sample template of Linux device driver for learning and starting source for a custom driver. Implements UART char device driver for example. Uses following Linux facilities: module, platform driver, file operations (read/write, mmap, ioctl, blocking and nonblocking mode, polling), kfifo, completion, interrupt, tasklet, work, kthread, timer, misc device, proc fs, UART 0x3f8, HW loopback, SW loopback, ftracer. The code is in working condition and runs with test script. | * [https://github.com/makelinux/ldt/ LDT - Linux Driver Template] - sample template of Linux device driver for learning and starting source for a custom driver. Implements UART char device driver for example. Uses following Linux facilities: module, platform driver, file operations (read/write, mmap, ioctl, blocking and nonblocking mode, polling), kfifo, completion, interrupt, tasklet, work, kthread, timer, misc device, proc fs, UART 0x3f8, HW loopback, SW loopback, ftracer. The code is in working condition and runs with test script. | ||
+ | * [https://github.com/makelinux/ldt/blob/master/pci-ldt.c PCI Linux Driver Template] | ||
* [https://github.com/martinezjavier/ldd3/ LDD3 - Samples for boot Linux Device Driver, 3rd edition, updated], compiled with kernel 3.2.0 | * [https://github.com/martinezjavier/ldd3/ LDD3 - Samples for boot Linux Device Driver, 3rd edition, updated], compiled with kernel 3.2.0 | ||
** [https://github.com/martinezjavier/ldd3/blob/master/pci/pci_skel.c pci_skel.c] - PCI skeleton | ** [https://github.com/martinezjavier/ldd3/blob/master/pci/pci_skel.c pci_skel.c] - PCI skeleton | ||
Line 11: | Line 11: | ||
** [https://github.com/martinezjavier/ldd3/tree/master/scull scull] - simple char device | ** [https://github.com/martinezjavier/ldd3/tree/master/scull scull] - simple char device | ||
** [https://github.com/martinezjavier/ldd3/blob/master/snull/snull.c snull.c] - simple network device | ** [https://github.com/martinezjavier/ldd3/blob/master/snull/snull.c snull.c] - simple network device | ||
− | * [ | + | * [https://elixir.bootlin.com/linux/latest/source/drivers/media/platform/vivid/ Virtual Video driver, uses V4L2] - works |
− | * [ | + | * [https://elixir.bootlin.com/linux/v3.18/source/drivers/media/platform/mem2mem_testdev.c mem2mem_testdev.c - virtual v4l2-mem2mem example device driver] |
− | * [ | + | * [https://elixir.bootlin.com/linux/latest/source/drivers/usb/usb-skeleton.c usb-skeleton.c - USB driver skeleton] (can be compiled with trivial fix) |
− | * [ | + | * [https://elixir.bootlin.com/linux/v4.10/source/drivers/pci/hotplug/pcihp_skeleton.c skeletonfb.c - Frame Buffer device skeleton] (can't be compiled) |
− | * [ | + | * [https://elixir.bootlin.com/linux/latest/source/drivers/pci/hotplug/pcihp_skeleton.c pcihp_skeleton.c - PCI Hot Plug Controller Skeleton Driver] |
− | * [ | + | * [https://elixir.bootlin.com/linux/latest/source/drivers/net/loopback.c loopback.c - simple net_device implementing ifconfig lo] |
* [https://github.com/23ars/linux_gpio_driver gpio_driver - simple GPIO driver for Raspberry Pi model B+ ] ( not fully tested yet) | * [https://github.com/23ars/linux_gpio_driver gpio_driver - simple GPIO driver for Raspberry Pi model B+ ] ( not fully tested yet) | ||
== Resources == | == Resources == | ||
* [[Device Tree]] - information about device tree (increasingly required for new embedded drivers) | * [[Device Tree]] - information about device tree (increasingly required for new embedded drivers) |
Latest revision as of 05:21, 20 October 2020
Manuals
- Linux kernel internals reference, wikibook - under construction
- Linux Device Drivers, 3rd Edition
Sample drivers
- LDT - Linux Driver Template - sample template of Linux device driver for learning and starting source for a custom driver. Implements UART char device driver for example. Uses following Linux facilities: module, platform driver, file operations (read/write, mmap, ioctl, blocking and nonblocking mode, polling), kfifo, completion, interrupt, tasklet, work, kthread, timer, misc device, proc fs, UART 0x3f8, HW loopback, SW loopback, ftracer. The code is in working condition and runs with test script.
- PCI Linux Driver Template
- LDD3 - Samples for boot Linux Device Driver, 3rd edition, updated, compiled with kernel 3.2.0
- pci_skel.c - PCI skeleton
- sbull.c - simple block device
- scull - simple char device
- snull.c - simple network device
- Virtual Video driver, uses V4L2 - works
- mem2mem_testdev.c - virtual v4l2-mem2mem example device driver
- usb-skeleton.c - USB driver skeleton (can be compiled with trivial fix)
- skeletonfb.c - Frame Buffer device skeleton (can't be compiled)
- pcihp_skeleton.c - PCI Hot Plug Controller Skeleton Driver
- loopback.c - simple net_device implementing ifconfig lo
- gpio_driver - simple GPIO driver for Raspberry Pi model B+ ( not fully tested yet)
Resources
- Device Tree - information about device tree (increasingly required for new embedded drivers)