Minimal Linux character device implementing a FIFO circular queue (no locking)
A simple Linux kernel character device that implements a fixed-size circular queue with no locking.
This module allows user-space programs to write bytes into a kernel buffer and read them back in FIFO order.
- Character device driver
- Circular buffer of 256 bytes
- FIFO read/write behavior
- No locking (single-producer/single-consumer or non-concurrent use only)
- Minimal and easy to understand
Make sure you have kernel headers installed.
makeLoad the Module
sudo insmod circular_queue.ko
dmesg | tailCreate a Device Node
sudo mknod /dev/circular_queue c <MAJOR_NUMBER> 0
sudo chmod 666 /dev/circular_queueUsage Write to device
echo "hello world" > /dev/circular_queueRead from device
cat /dev/circular_queueOUTPUT: hello world