EmbLogic's Blog

User Interface to Character Device Driver

RCS file: writef.c,v
Working file: writef.c
head: 1.15
branch:
locks: strict
root: 1.15
access list:
symbolic names:
keyword substitution: kv
total revisions: 15;    selected revisions: 15
description:
chardev_write() function reside here.
—————————-
revision 1.15    locked by: root;
date: 2014/03/01 11:19:07;  author: root;  state: Exp;  lines: +5 -0.
Testing……….
—————————-
revision 1.14
date: 2014/03/01 11:13:18;  author: root;  state: Exp;  lines: +15 -7
The copy_from_user() function is used to copy a block of data from user space into the kernel buffer.copy_from_user() function contains 3 arguments:
1.A destination buffer,
2.A source buffer,and
3.length in bytes.
—————————-
revision 1.13
date: 2014/03/01 11:06:21;  author: root;  state: Exp;  lines: +2 -1
Done memset().
Testing the code…..
—————————-
revision 1.12
date: 2014/03/01 11:01:16;  author: root;  state: Exp;  lines: +54 -5
create_quantums() function that will create the required number of quantums.
Kmalloc() is used to allocate memory for each quantum. No. of quantums are dependent on how many number of bytes we are writing from user space.
Filling the memory allocated using kmalloc() with memset() so that it does not contain any garbage.
—————————-
revision 1.11
date: 2014/03/01 10:39:39;  author: root;  state: Exp;  lines: +1 -0
memset() function is used to fill the memory allocated for the qset array to ”.
—————————-
revision 1.10
date: 2014/03/01 10:36:59;  author: root;  state: Exp;  lines: +14 -4
Using kmalloc() memory is allocated to the required number of qsets , The memory allocated for qset depends upon the architecture of the OS, if the architecture is of 64 bytes then each qset required 8 byte of memory . and 4 bytes for 32 bit OS.Checking whether it is working fine or not.
—————————-
revision 1.9
date: 2014/03/01 10:26:27;  author: root;  state: Exp;  lines: +36 -2
Implemented create_scullqset() function.Now checking the number of qsets that needs to created by using the size argument of the chardev_write().After determining the number of qsets that needs to be created create_qset() function is called.
—————————-
revision 1.8
date: 2014/03/01 10:07:44;  author: root;  state: Exp;  lines: +2 -1
memset() function to clear the garbage ” .
—————————-
revision 1.7
date: 2014/03/01 10:04:21;  author: root;  state: Exp;  lines: +10 -0
Allocating memory for 1 scullqset using kmalloc
—————————-
revision 1.6
date: 2014/03/01 09:56:22;  author: root;  state: Exp;  lines: +22 -2
After finding out the number of scullqsets,create_scullqset() function is called to create the specified number of scullqsets.
Checking whether the function calling is taking place or not……
—————————-
revision 1.5
date: 2014/03/01 09:47:56;  author: root;  state: Exp;  lines: +19 -0
The size argument that specifies the size of the buffer pointed to by ubuff is used to find the number of scullqsets that needs to be created.
After finding out the exact number of scullqsets that needs to be created,the number of scullqsets are printed.
Creating scullqsets…….
—————————-
revision 1.4
date: 2014/03/01 09:32:34;  author: root;  state: Exp;  lines: +1 -1
Checking whether the ubuff pointer is actually pointing to the buffer in the application.Also checking the size field inside the 3rd argument of chardev_write().
—————————-
revision 1.3
date: 2014/03/01 09:28:31;  author: root;  state: Exp;  lines: +6 -1

Testing….
—————————-
revision 1.2
date: 2014/03/01 09:20:00;  author: root;  state: Exp;  lines: +9 -1
Printing the address inside filep->private_data to check whether it matches with the address returned by container_of() macro.
A local variable of type Sculldev is declared which will store the address that is present inside filep->private_data.
—————————-
revision 1.1
date: 2014/02/28 21:33:05;  author: root;  state: Exp;
Initial revision

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>