LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   any good book resource for device driver development? (https://www.linuxquestions.org/questions/linux-kernel-70/any-good-book-resource-for-device-driver-development-4175662026/)

gglq000 10-04-2019 07:50 PM

any good book resource for device driver development?
 
Few months back I have acquired "linux device drivers" nu Jonathan Corbet by OReilly 3rd edition which is based on 2.6 kernel. But now, the 5.0.0 is out and apparently samples in the book is not building at all in either 5.0.0 or 4.x.x kernel.

root@<hostname>:~/dev-learn/device-drivers# make
make -C /lib/modules/4.19.52+/build
make[1]: Entering directory '/usr/src/linux-headers-4.19.52+'
YACC scripts/kconfig/zconf.tab.c
/bin/sh: 1: bison: not found
scripts/Makefile.lib:196: recipe for target 'scripts/kconfig/zconf.tab.c' failed
make[3]: *** [scripts/kconfig/zconf.tab.c] Error 127
Makefile:532: recipe for target 'syncconfig' failed
make[2]: *** [syncconfig] Error 2
Makefile:631: recipe for target 'include/config/auto.conf.cmd' failed
make[1]: *** [include/config/auto.conf.cmd] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.19.52+'
Makefile:19: recipe for target 'all' failed
make: *** [all] Error 2


To solve
1. i can try to get antiqurated version of linux distro with 2.6 kernel so that I have a better chance of going smooth through examples but it may come with its own problems.

2. Obtain a newer version of the book that cover 4/5.x.x kernel.
But I dont see any newer version since 3d ed. which is based on 2.6. Any other book on device driver development that has good hands-on coverage with latest and newer kernels?

Ser Olmy 10-05-2019 02:21 AM

Quote:

Originally Posted by gglq000 (Post 6043953)
Few months back I have acquired "linux device drivers" nu Jonathan Corbet by OReilly 3rd edition which is based on 2.6 kernel. But now, the 5.0.0 is out and apparently samples in the book is not building at all in either 5.0.0 or 4.x.x kernel.

This issue may not have anything to do with the kernel or even your code:
Quote:

Originally Posted by gglq000 (Post 6043953)
root@<hostname>:~/dev-learn/device-drivers# make
make -C /lib/modules/4.19.52+/build
make[1]: Entering directory '/usr/src/linux-headers-4.19.52+'
YACC scripts/kconfig/zconf.tab.c
/bin/sh: 1: bison: not found

What does bison --version return on your system?

teckk 10-05-2019 12:39 PM

Lots of threads for this. Google.

https://www.gnu.org/software/bison/bison.html

https://www.oreilly.com/library/view...5903/ch01.html

https://www.apriorit.com/dev-blog/19...r-for-linux-os
https://www.phoronix.com/scan.php?pa...eds-Flex-Bison

http://freesoftwaremagazine.com/articles/drivers_linux/
https://stackoverflow.com/questions/...-device-driver

gglq000 10-16-2019 04:00 AM

Quote:

Originally Posted by Ser Olmy (Post 6044016)
This issue may not have anything to do with the kernel or even your code:

What does bison --version return on your system?

damn, fuck it. I have been tricked by this stupid library issue countless times. So subtle.


All times are GMT -5. The time now is 01:45 AM.