Question: Use gcc and the C programming language, on the version of Linux we have in our VM. Write a character-mode Linux device driver as a

Use gcc and the C programming language, on the version of Linux we have in our VM. Write a character-mode Linux device driver as a kernel module. Your driver must: Store bytes written to it up to a constant buffer size (at least 1KB) Allow them to be read back out in FIFO fashion Remove them from the buffer as they are read back out Additionally, the driver must handle the following overflow conditions: If not enough buffer is available to store a write request, the driver must store only up to the amount available If not enough data is available to service a read request, the driver must respond with only the amount available (including 0 bytes) The driver will need to: Successfully initialize and de-initialize itself, including registering itself and obtaining a new major device number. Report using printk each time its character device is opened, closed, read or written. To do this, you will need to implement the expected device driver functions to: Initialize the kernel module. including registering the device. You do not need to create the device file, but you do need to log the device number you are assigned so that mknod can be called to do so after your kernel module is installed. De-initialize the kernel module. including de-registering the device. Open the device. Close the device. Read from the device. Write to the device
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
