ldd3_training | Examples for learning how to write linux device drivers | Learning library
kandi X-RAY | ldd3_training Summary
kandi X-RAY | ldd3_training Summary
I am writing these sample codes for a personal reason: I really want to learn how to write (correctly!) Linux device drivers. Note that, in order to try all examples, you need a Linux-based OS running on a PYNQ board (or something equivalent/similar: a dual core ARM + an FPGA). [the tcl scripts to create the hw for the FPGA are coming soon. For more details, send me an email]. In order to achieve this goal, the best source/documentation is, of course, the famous Linux Device Drivers 3rd edition (a.k.a ldd3) by Jonathan Corbet, Alessandro Rubini, and Greg Kroah-Hartman. Reading the book (normally every engineering book) is not enough to deeply understand the topic: the best way is almost always to directly try what you read. This is exactly what I am doing: step by step I try to implement the new acquired concepts. The folders are divided per chapter and, in every one of them, there should be at least one example where the newly learned techniques were applied. I am sure the code it is not so clean, can be improved, it is not optimized and so on and so forth: I will try to improve my coding skills with these exercises.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of ldd3_training
ldd3_training Key Features
ldd3_training Examples and Code Snippets
Community Discussions
Trending Discussions on ldd3_training
QUESTION
I wrote a Linux device driver in which the functions read
and write
are implemented. The problem is with the function write, here the portion of the code:
ANSWER
Answered 2018-Feb-04 at 17:49Value returned by the kernel's .write
function is interpreted as:
error code, if it is less than zero (
<0
),number of bytes written, if it is more than or equal to zero (
>=0
)
So, for tell user that all bytes has been written, .write
function should return its count
parameter.
In case of .write
function, returning zero has a little sense: every "standard" utility like echo
will just call write()
function again.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ldd3_training
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page