EmbLogic's Blog

Category Archives: Character Driver

character driver-seek_SET,SEEK_CUR and SEEK_END working fine for reading

RCS file: ./read2.c,v Working file: ./read2.c head: 1.40 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 40; selected revisions: 40 description: this is working fine with lseek —————————- revision 1.40 date: 2014/05/27 17:52:40; author: root; state: … Continue reading

Posted in Character Driver | Leave a comment

Character driver -lseek operation

ranch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 19; selected revisions: 19 description: this is working fine with lseek —————————- revision 1.19 date: 2014/05/26 18:30:46; author: root; state: Exp; lines: +1 -0 working successfully for read … Continue reading

Posted in Character Driver | Leave a comment

writing in character driver with multiple quantum

#include”header.h” #include”declration.c” struct ScullQset *create_scullqset(int nosqset) { struct ScullQset *lscullqset,*temp,*new; int i,flag=1; lscullqset=NULL; //int i; printk(KERN_INFO”begin=%s\n”,__func__); for(i=0;inext=NULL; lscullqset->data=NULL; } else { new = (struct ScullQset *)kmalloc(sizeof(struct ScullQset),GFP_KERNEL); new->next=NULL; new->data=NULL; temp->next=new; temp=temp->next; } #include”header.h” #include”declration.c” struct ScullQset *create_scullqset(int nosqset) { struct … Continue reading

Posted in Character Driver | Leave a comment

Character driver-sucessfully working for min 32 distinct user

The code is working fine for 32 distinct user acessing 2 nodes node0 and node1 ie, 32 user can acess this driver at a time without reporting a bug. there are 2 operation that i perform for each application 1.write … Continue reading

Posted in Character Driver | Leave a comment

character driver—>devwrite.c

Major reasons for kernel Crash 1>>you trying to access a location in kernel space which you are not authorised. 2>>you are trying to write data in the memory location which is not part of quantums(***MAJOR CRASH***).  

Posted in Character Driver, Device Drivers | Leave a comment

CHARACTER Driver :entered data in multiple scullqsets ,qsets and quantums

RCS file: write.c,v Working file: write.c head: 1.81 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 81; selected revisions: 81 description: this is the file for user write like operation —————————- revision 1.81 date: 2014/05/16 12:53:09; … Continue reading

Posted in Character Driver | Leave a comment

project05==character driver

Common Errors which most of us will face while doing character drivers 1) Multiple definitions of the variable {bcoz of wrong use of extern} 2)control reaches end of non-void function{bcoz not returning any value to that non-void function} 3)warning: variable … Continue reading

Posted in Character Driver | Leave a comment

project 05==character driver

things to be kept in mind while doing “Character Driver” 1>Be very patient as you will get different errors with silly solutions. 2>As you are dealing with multiple files like in my case files are header.h,declaration.h,init.c,clean.c,fops.h,prototypes.h,devopen.c, devrelease.c,devwrite.c…BE CAREFUL about the … Continue reading

Posted in Character Driver | Leave a comment

Character_Driver

RCS file: header.h,v Working file: header.h head: 1.3 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 3;    selected revisions: 3 description: include header files that are needed in this program struct sculldev structure is included here … Continue reading

Posted in Character Driver | Leave a comment

Character driver driver

head 1.32; access; symbols; locks; strict; comment @ * @; 1.32 date 2014.05.06.06.20.21; author root; state Exp; branches; next 1.31; 1.31 date 2014.05.04.09.46.22; author root; state Exp; branches; next 1.30; 1.30 date 2014.05.04.08.15.17; author root; state Exp; branches; next 1.29; … Continue reading

Posted in Character Driver | Leave a comment

character driver proc with kernel 3.12

Add two header proc_fs.h, seq_file.h Initialize the proc by proc_create() and remove by remove_proc_entry() Map the file operation in structure write open proc function and give entry

Posted in Character Driver | Leave a comment

Linux /proc File System

  /proc is very special in that it is a virtual filesystem. It’s sometimes referred to as a process information pseudo-file system. It doesn’t contain ‘real’ files but runtime system information (e.g. system memory, devices mounted, hardware configuration, etc).Inside the … Continue reading

Posted in Character Driver, Device Drivers | Leave a comment

Module code to show how to implement a semaphore(a type of locking technique) in scull to synchronize same operations issued by multiple applications.

Semaphore in Scull Scenario :Writer application must execute before the reader application. There are two applications which have to perform several operations on the node 1. Application 1: Application 1 is a multithreaded application in which open() , write() and … Continue reading

Posted in Character Driver, Device Drivers | Leave a comment

Module code showing the difference between *loff and filep->f_pos when multiple write() system calls are issued by the application.

  Difference between loff_t *loff and filep->f_pos: When an application issues write() system call , chardev_write() function is called because it is mapped to (*write) function pointer.chardev_write() function contains 4 arguments namely: 1. A pointer to the struct file structure. … Continue reading

Posted in Character Driver, Device Drivers | Leave a comment

Module code to show how to perform read operation in multiple qset arrays.

RCS file: readf.c,v Working file: readf.c head: 1.18 branch: locks: strict root: 1.18 access list: symbolic names: keyword substitution: kv total revisions: 18;    selected revisions: 18 description: chardev_read() function reside here which is responsible for performing the read operation. —————————- … Continue reading

Posted in Character Driver, Device Drivers | Leave a comment