The learning of Linux device drivers is a huge project. Readers must first master the following basics.
1. writing Linux device drivers requires engineers to have a good hardware foundation, understand the reading and writing methods of SRAM, Flash, SDRAM, disks, and interfaces of UART, I2C, USB, and other devices, the principle of polling, interruption, DMA, the working mode of the PCI bus, and the memory management unit (MMU) of the CPU.
2. Writing Linux device drivers requires engineers to have a good C language foundation and be able to flexibly apply for and release the structures, pointers, function pointers, and memory in the C language.
3. writing a Linux Device Driver requires engineers to have a certain Linux kernel Foundation. Although engineers are not required to have in-depth research on each part of the kernel, they should at least understand the interfaces between the device driver and the kernel, especially for Block devices, network devices, flash devices, serial devices, and other complex devices.
4. writing a Linux Device Driver requires engineers to have a good foundation for multi-task concurrency control and synchronization, because the device driver will use a large number of concurrent and synchronization mechanisms, such as spin lock, mutex, semaphore, and waiting queue.