In Linux, each device is referenced by a major number and a minor number. The list of these numbers can be found by executing the command “ls -l /dev“. A small snippet is shown below Each driver that loads itself to the linux kernel must register its major number with the linux kernel. The specific […]
Character Device driver – creating device file instance in code
In the previous example character driver code <character driver sample>, we used the “mknod command” to create the device file instance. it is possible to create a device file instance via code in the driver itself allowing the code to come up “on the go”. The below code snippet provides an example implementation of the […]
Character device driver sample user space code
The character device driver code can be looked at in the article placed at this location – <character device driver example>. The below user space sample code is to invoke the device file via the device driver. The output of the sample code is provided below The dmesg output indicates that the open, read, write […]
Device drivers – character device driver Example
Device driver – as the name suggests – it controls a device. It could a physical resource or a non-physical resource. In the following articles, we will ook through some device The character device driver is the most basic device driver that an interested developer will see and needs to learn in the Linux kernel. […]