For unix/Linux Low-Level I/O functions, you must master the module writing and the necessary application programming knowledge. Otherwise, how can you write an application to test your module or driver?
The most important thing is to understand the interfaces called by the upper layer, and you will understand what the upper layer developers need and what they can implement.
Let go of everything you read in your hands. First, familiarize yourself with the third chapter of the book "Advanced Programming in Unix environment.
The content includes:
Open), especially common parameters. For example, you can create an empty file: fd = open ("/tmp/xx.txt", O_RDWR | O_CREAT | O_TRUNC );
Read a file, fd = open ("/dev/hello", O_RDONLY );
If you want to write an existing file, fd = open ("/dev/hello", O_WRONLY );
Specific parameters: man 2 open
Read ),
Write)
Ioctl.
Lseek), file pointer Movement