EmbLogic's Blog

Character_driver

RCS file: cleanup.c,v
Working file: cleanup.c
head: 1.25
branch:
locks: strict
root: 1.25
access list:
symbolic names:
keyword substitution: kv
total revisions: 25; selected revisions: 25
description:
This cleanup() is use to remove the driver from kernel.
—————————-
revision 1.25 locked by: root;
date: 2016/03/11 12:23:30; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.24
date: 2016/03/11 12:02:38; author: root; state: Exp; lines: +2 -0
*** empty log message ***
—————————-
revision 1.23
date: 2016/03/11 09:02:12; author: root; state: Exp; lines: +0 -2
*** empty log message ***
—————————-
revision 1.22
date: 2016/03/11 08:56:27; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.21
date: 2016/03/11 06:56:41; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.20
date: 2016/03/11 06:53:14; author: root; state: Exp; lines: +1 -0
declare the variable i.
—————————-
revision 1.19
date: 2016/03/11 06:52:45; author: root; state: Exp; lines: +4 -1
Delete all the node.
—————————-
revision 1.18
date: 2016/03/10 09:19:22; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.17
date: 2016/03/10 09:18:30; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.16
date: 2016/03/10 09:15:18; author: root; state: Exp; lines: +1 -0
Delete the structure and free the memory.
—————————-
revision 1.15
date: 2016/03/10 08:55:35; author: root; state: Exp; lines: +1 -0
Free the memory which assign to through kmalloc to dev struct.
—————————-
revision 1.14
date: 2016/03/10 05:52:43; author: root; state: Exp; lines: +2 -1
Here cahnge the 2nd argument we define in macro and provide the macro inside the unregister_region().
—————————-
revision 1.13
date: 2016/03/10 05:43:17; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.12
date: 2016/03/10 05:41:19; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.11
date: 2016/03/10 05:25:38; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.10
date: 2016/03/09 09:55:53; author: root; state: Exp; lines: +1 -1
Provide the devid variable insid the unregister_chrdev_region().
No. of devices.
—————————-
revision 1.9
date: 2016/03/09 09:36:05; author: root; state: Exp; lines: +2 -1
change the registeration process.
Now we register our driver through new call.
here we declare dev_t type variable.
2nd argument is no. of devices in starting we put one.
—————————-
revision 1.8
date: 2016/03/09 09:14:16; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.7
date: 2016/03/09 09:08:45; author: root; state: Exp; lines: +0 -1
*** empty log message ***
—————————-
revision 1.6
date: 2016/03/09 08:59:12; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.5
date: 2016/03/09 08:47:55; author: root; state: Exp; lines: +1 -0
Unregister the driver through unregister().
Here frist argument is major number and second command is name of the driver.
—————————-
revision 1.4
date: 2016/03/08 02:39:06; author: root; state: Exp; lines: +1 -1
Provide space between kern_info and “” statements.
—————————-
revision 1.3
date: 2016/03/06 04:18:11; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.2
date: 2016/03/06 04:14:09; author: root; state: Exp; lines: +1 -1
Now we set the priority of our driver by kern_info.
—————————-
revision 1.1
date: 2016/03/04 10:29:25; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: file_opr.h,v
Working file: file_opr.h
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2; selected revisions: 2
description:
Here change the routine of open file.
Now file open though our routine.
—————————-
revision 1.2 locked by: root;
date: 2016/03/11 10:57:11; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.1
date: 2016/03/11 10:46:22; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.16
branch:
locks: strict
root: 1.16
access list:
symbolic names:
keyword substitution: kv
total revisions: 16; selected revisions: 16
description:
Here all the libraray include which are use in basic driver program.
—————————-
revision 1.16 locked by: root;
date: 2016/03/11 12:23:33; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.15
date: 2016/03/11 10:54:46; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.14
date: 2016/03/11 10:53:09; author: root; state: Exp; lines: +2 -0
*** empty log message ***
—————————-
revision 1.13
date: 2016/03/11 06:28:21; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.12
date: 2016/03/11 06:25:49; author: root; state: Exp; lines: +1 -0
Add the header file modules_param.h
—————————-
revision 1.11
date: 2016/03/10 09:00:21; author: root; state: Exp; lines: +1 -0
Add the libaray cdev.h
—————————-
revision 1.10
date: 2016/03/10 08:59:40; author: root; state: Exp; lines: +1 -0
Add the library slab.h
—————————-
revision 1.9
date: 2016/03/10 08:56:07; author: root; state: Exp; lines: +14 -0
Add thr struct dev inside the header.h
—————————-
revision 1.8
date: 2016/03/10 05:12:58; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.7
date: 2016/03/09 10:40:31; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.6
date: 2016/03/09 10:35:34; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.5
date: 2016/03/09 09:44:07; author: root; state: Exp; lines: +0 -1
Remove the extern file inside the header.h
—————————-
revision 1.4
date: 2016/03/09 09:38:38; author: root; state: Exp; lines: +1 -1
Add the new extern dev_t majorno variable.
—————————-
revision 1.3
date: 2016/03/09 09:08:51; author: root; state: Exp; lines: +1 -0
define the major no. in the header.
Also provide the type .
—————————-
revision 1.2
date: 2016/03/09 08:48:58; author: root; state: Exp; lines: +1 -0
Add the new libraray #include<kernel/fs.h>
—————————-
revision 1.1
date: 2016/03/04 10:28:51; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: insert.c,v
Working file: insert.c
head: 1.51
branch:
locks: strict
root: 1.51
access list:
symbolic names:
keyword substitution: kv
total revisions: 51; selected revisions: 51
description:
This insert_driver() is use to insert the driver into the kernel.
—————————-
revision 1.51 locked by: root;
date: 2016/03/11 12:02:40; author: root; state: Exp; lines: +12 -0
*** empty log message ***
—————————-
revision 1.50
date: 2016/03/11 10:56:23; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.49
date: 2016/03/11 10:55:11; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.48
date: 2016/03/11 10:51:01; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.47
date: 2016/03/11 09:02:14; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.46
date: 2016/03/11 06:51:06; author: root; state: Exp; lines: +0 -1
*** empty log message ***
—————————-
revision 1.45
date: 2016/03/11 06:50:14; author: root; state: Exp; lines: +1 -1
Pass the address.
—————————-
revision 1.44
date: 2016/03/11 06:48:47; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.43
date: 2016/03/11 06:44:06; author: root; state: Exp; lines: +15 -12
Add the mkdev().
Print the value of devices which are connected to it.
—————————-
revision 1.42
date: 2016/03/11 06:26:12; author: root; state: Exp; lines: +1 -0
Declare the modules_param().
—————————-
revision 1.41
date: 2016/03/11 06:12:25; author: root; state: Exp; lines: +7 -2
Check the kernal if it crush then safely out.
—————————-
revision 1.40
date: 2016/03/11 06:02:51; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.39
date: 2016/03/11 05:48:05; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.38
date: 2016/03/11 05:46:49; author: root; state: Exp; lines: +0 -1
*** empty log message ***
—————————-
revision 1.37
date: 2016/03/10 09:52:22; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.36
date: 2016/03/10 09:49:21; author: root; state: Exp; lines: +5 -5
*** empty log message ***
—————————-
revision 1.35
date: 2016/03/10 09:40:54; author: root; state: Exp; lines: +5 -2
*** empty log message ***
—————————-
revision 1.34
date: 2016/03/10 09:34:58; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.33
date: 2016/03/10 09:32:03; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.32
date: 2016/03/10 09:23:40; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.31
date: 2016/03/10 09:22:50; author: root; state: Exp; lines: +2 -0
We cross check the program.
—————————-
revision 1.30
date: 2016/03/10 09:19:44; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.29
date: 2016/03/10 09:17:59; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.28
date: 2016/03/10 09:17:21; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.27
date: 2016/03/10 09:15:41; author: root; state: Exp; lines: +6 -4
Call the memset().
Call the cdev_init().
Call the cdev_add().
—————————-
revision 1.26
date: 2016/03/10 09:03:11; author: root; state: Exp; lines: +1 -0
Declare the variable of dev inside it.
—————————-
revision 1.25
date: 2016/03/10 08:56:32; author: root; state: Exp; lines: +7 -0
Malloc the memory for dev struct through kmalloc.
It takes two arguments frist type or bit o memory and 2nd is flag.
—————————-
revision 1.24
date: 2016/03/10 08:36:18; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.23
date: 2016/03/10 08:34:18; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.22
date: 2016/03/10 06:20:52; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.21
date: 2016/03/10 06:17:13; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.20
date: 2016/03/10 06:15:15; author: root; state: Exp; lines: +6 -6
*** empty log message ***
—————————-
revision 1.19
date: 2016/03/10 06:11:27; author: root; state: Exp; lines: +6 -4
*** empty log message ***
—————————-
revision 1.18
date: 2016/03/10 06:03:04; author: root; state: Exp; lines: +2 -3
Delete the majorno and minorno variable and declare it into the macro.h
Delete the dev_t devid and declare it into the macro.h
—————————-
revision 1.17
date: 2016/03/10 05:53:26; author: root; state: Exp; lines: +3 -1
Here declare the libraray #include”macro.h”.
We spacifie the macro inside the function.
—————————-
revision 1.16
date: 2016/03/09 10:24:50; author: root; state: Exp; lines: +1 -1
Pass the address.
—————————-
revision 1.15
date: 2016/03/09 10:23:00; author: root; state: Exp; lines: +1 -1
Here we use alloc_chrdev_region().
Now pass the argument where the minor no. startup and no. of devices.
—————————-
revision 1.14
date: 2016/03/09 10:01:33; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.13
date: 2016/03/09 09:58:32; author: root; state: Exp; lines: +3 -3
*** empty log message ***
—————————-
revision 1.12
date: 2016/03/09 09:56:35; author: root; state: Exp; lines: +3 -4
Add the dev_t variable and inside the register_chrdev_region().
Print the majar no. and minor no.
—————————-
revision 1.11
date: 2016/03/09 09:48:56; author: root; state: Exp; lines: +1 -1
Add the argument which tell no. of devices.
—————————-
revision 1.10
date: 2016/03/09 09:46:41; author: root; state: Exp; lines: +1 -1
Aplly condition to check the registeration through register_chrdev_region.
—————————-
revision 1.9
date: 2016/03/09 09:46:07; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.8
date: 2016/03/09 09:42:29; author: root; state: Exp; lines: +3 -3
Decalre a integer variable which name is mano.(major no.).
—————————-
revision 1.7
date: 2016/03/09 09:39:01; author: root; state: Exp; lines: +16 -3
Call the register_chrdev_region().
The frist argument is dev_t type in which major no. is save and 2nd argument strore the minor number.
3rd argument is name of driver i.e in which name you register your own driver in table.
—————————-
revision 1.6
date: 2016/03/09 09:20:55; author: root; state: Exp; lines: +1 -1
Add the termination condition.
—————————-
revision 1.5
date: 2016/03/09 09:19:21; author: root; state: Exp; lines: +0 -2
Add the prototype file.
Define the struct file_operations.
—————————-
revision 1.4
date: 2016/03/09 09:09:30; author: root; state: Exp; lines: +1 -1
Here declare the mno.
—————————-
revision 1.3
date: 2016/03/09 08:56:52; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.2
date: 2016/03/09 08:50:51; author: root; state: Exp; lines: +6 -0
Register().
Frist arguments is major no..
So put in 0 for default case.
2nd arguments are driver name
3rd arguments are file operations.
—————————-
revision 1.1
date: 2016/03/04 10:29:25; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: macro.h,v
Working file: macro.h
head: 1.10
branch:
locks: strict
root: 1.10
access list:
symbolic names:
keyword substitution: kv
total revisions: 10; selected revisions: 10
description:
Declare a new file.Here we define the macro.
—————————-
revision 1.10 locked by: root;
date: 2016/03/11 12:23:37; author: root; state: Exp; lines: +4 -0
Add the macro of DEBUG
—————————-
revision 1.9
date: 2016/03/11 05:58:19; author: root; state: Exp; lines: +0 -3
*** empty log message ***
—————————-
revision 1.8
date: 2016/03/11 05:52:49; author: root; state: Exp; lines: +3 -0
*** empty log message ***
—————————-
revision 1.7
date: 2016/03/11 05:51:42; author: root; state: Exp; lines: +0 -4
Remove the node macro.
—————————-
revision 1.6
date: 2016/03/10 08:57:42; author: root; state: Exp; lines: +15 -0
define the variale of structure like devicesize,quantumsize,qsetsize,datasize.
—————————-
revision 1.5
date: 2016/03/10 08:41:40; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.4
date: 2016/03/10 06:17:15; author: root; state: Exp; lines: +0 -3
*** empty log message ***
—————————-
revision 1.3
date: 2016/03/10 06:06:02; author: root; state: Exp; lines: +10 -0
Here declare the minorno and majorno .
We also declare dev_t devid variable.
—————————-
revision 1.2
date: 2016/03/10 05:56:12; author: root; state: Exp; lines: +1 -1
Defile the value of nod.
—————————-
revision 1.1
date: 2016/03/10 05:54:14; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: opendev.c,v
Working file: opendev.c
head: 1.7
branch:
locks: strict
root: 1.7
access list:
symbolic names:
keyword substitution: kv
total revisions: 7; selected revisions: 7
description:
Here open the device.
release the device.
—————————-
revision 1.7 locked by: root;
date: 2016/03/14 08:08:03; author: root; state: Exp; lines: +3 -0
*** empty log message ***
—————————-
revision 1.6
date: 2016/03/11 12:23:49; author: root; state: Exp; lines: +2 -2
*** empty log message ***
—————————-
revision 1.5
date: 2016/03/11 12:03:53; author: root; state: Exp; lines: +0 -2
*** empty log message ***
—————————-
revision 1.4
date: 2016/03/11 12:02:41; author: root; state: Exp; lines: +7 -1
*** empty log message ***
—————————-
revision 1.3
date: 2016/03/11 11:41:49; author: root; state: Exp; lines: +22 -2
Call the trim function which use to overwrite data.
—————————-
revision 1.2
date: 2016/03/11 10:51:03; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.1
date: 2016/03/11 10:04:55; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: prototype.h,v
Working file: prototype.h
head: 1.12
branch:
locks: strict
root: 1.12
access list:
symbolic names:
keyword substitution: kv
total revisions: 12; selected revisions: 12
description:
—————————-
revision 1.12 locked by: root;
date: 2016/03/11 12:23:50; author: root; state: Exp; lines: +0 -1
*** empty log message ***
—————————-
revision 1.11
date: 2016/03/11 11:50:42; author: root; state: Exp; lines: +1 -1
Defination of the trimdev().
—————————-
revision 1.10
date: 2016/03/11 11:42:31; author: root; state: Exp; lines: +1 -0
Add the int trimdev().
—————————-
revision 1.9
date: 2016/03/11 06:44:38; author: root; state: Exp; lines: +1 -1
Add the dev_t devno.
—————————-
revision 1.8
date: 2016/03/11 06:02:54; author: root; state: Exp; lines: +1 -2
*** empty log message ***
—————————-
revision 1.7
date: 2016/03/11 05:57:57; author: root; state: Exp; lines: +1 -0
*** empty log message ***
—————————-
revision 1.6
date: 2016/03/10 09:16:24; author: root; state: Exp; lines: +1 -1
Add the pointer structre.
—————————-
revision 1.5
date: 2016/03/10 09:03:33; author: root; state: Exp; lines: +1 -0
Add the variable of dev.\
—————————-
revision 1.4
date: 2016/03/10 08:37:52; author: root; state: Exp; lines: +2 -0
Add the two variables.
—————————-
revision 1.3
date: 2016/03/09 09:57:27; author: root; state: Exp; lines: +1 -1
Add the variable chrdev.
—————————-
revision 1.2
date: 2016/03/09 09:44:25; author: root; state: Exp; lines: +1 -0
Add the extern file
Declare the major no. inside the prototype.h.
—————————-
revision 1.1
date: 2016/03/09 09:14:21; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: releasedev.c,v
Working file: releasedev.c
head: 1.3
branch:
locks: strict
root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3; selected revisions: 3
description:
release the device.
—————————-
revision 1.3 locked by: root;
date: 2016/03/11 12:02:42; author: root; state: Exp; lines: +2 -1
*** empty log message ***
—————————-
revision 1.2
date: 2016/03/11 10:07:03; author: root; state: Exp; lines: +1 -1
*** empty log message ***
—————————-
revision 1.1
date: 2016/03/11 10:05:34; author: root; state: Exp;
Initial revision
=============================================================================

RCS file: trimdev.c,v
Working file: trimdev.c
head: 1.4
branch:
locks: strict
root: 1.4
access list:
symbolic names:
keyword substitution: kv
total revisions: 4; selected revisions: 4
description:
Trimdev().
—————————-
revision 1.4 locked by: root;
date: 2016/03/14 08:08:13; author: root; state: Exp; lines: +3 -0
*** empty log message ***
—————————-
revision 1.3
date: 2016/03/11 12:23:51; author: root; state: Exp; lines: +3 -2
*** empty log message ***
—————————-
revision 1.2
date: 2016/03/11 12:02:43; author: root; state: Exp; lines: +4 -0
*** empty log message ***
—————————-
revision 1.1
date: 2016/03/11 11:42:45; 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>