Given the following device driver called sample.ko, what wou…
Given the following device driver called sample.ko, what would be the results of these actions: (Assume you are in the directory where sample.ko resides and are the superuser) – where cmd is any linux command that takes input insmod sample.ko echo “Embedded” > /dev/sample cmd < /dev/sample rmmod Sample Show what this command would display: tail \var\log\kern.log #include #include #include #include #include #include #define DEVICE_NAME "Sample" #define CLASS_NAME "Samp" static char msg;static int cnt =5;static char *name = "panther"; module_param(name, charp, S_IRUGO);static int majorNumber; static struct class* sampClass = NULL;static struct device* sampDevice = NULL;static int dev_open(struct inode *, struct file *);static int dev_release(struct inode *, struct file *);static ssize_t dev_read(struct file *, char *, size_t, loff_t *);static ssize_t dev_write(struct file *, const char *, size_t, loff_t *);static struct file_operations fops ={ .open = dev_open, .read = dev_read, .write = dev_write, .release = dev_release};static int __init sample_init(void){ majorNumber = register_chrdev(0, DEVICE_NAME, &fops); if (majorNumber