#include #defineSCULL_MAJOR252
#define SCULL_NAME"scull"
#define MAX_DATA0x1000
staticint scull_major = SCULL_MAJOR;
struct scull_dev {
struct cdev cdev;
char data[MAX_DATA];
struct semaphore sem;
};
MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("BG2BKK");
structscull_dev *scull_devp;
intscull_open(struct inode *inode, struct file *filp)
{
struct scull_dev *dev = container_of(inode->i_cdev, struct scull_dev, cdev);
filp->private_data = dev;
printk(KERN_ALERT "open the scull device\n");
return 0;
}
intscull_release(struct inode *inode, struct file *filp)
{
printk(KERN_ALERT "close the scull device\n");
return 0;
}
ssize_tscull_read(struct file *filp, char __us