EmbLogic's Blog

Character Driver(Semaphore)

#applying the semaphore....here i run the 4 application(open, write and read) from the single node.....and its working fine....


RCS file: application.c,v
Working file: application.c
head: 1.17
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 17;	selected revisions: 17
description:
this is the application program in the user space
open write and close is used
----------------------------
revision 1.17
date: 2014/06/02 12:09:20;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.16
date: 2014/05/30 07:19:57;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.15
date: 2014/05/30 07:09:07;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.14
date: 2014/05/29 06:06:43;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.13
date: 2014/05/29 06:05:10;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.12
date: 2014/05/29 05:44:00;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.11
date: 2014/05/29 05:43:01;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.10
date: 2014/05/29 05:38:44;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.9
date: 2014/05/29 05:37:02;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.8
date: 2014/05/26 11:19:01;  author: root;  state: Exp;  lines: +2 -2
seeking operation applied
apply SEEK_SET. and call lseek in application layer
----------------------------
revision 1.7
date: 2014/05/26 06:00:53;  author: root;  state: Exp;  lines: +10 -4
not open the node in RDWR mode because the node either open in the WR mode or in RD mode because its tbecause if we make it fullduplex then data get mingle.
----------------------------
revision 1.6
date: 2014/05/25 11:29:25;  author: root;  state: Exp;  lines: +11 -7
open the file in the O_RDWR mode then its capable to read and write from the files.
----------------------------
revision 1.5
date: 2014/05/24 11:49:01;  author: root;  state: Exp;  lines: +9 -9
*** empty log message ***
----------------------------
revision 1.4
date: 2014/05/24 11:35:56;  author: root;  state: Exp;  lines: +12 -12
close the fd for the writing then open it again in the read mode.
----------------------------
revision 1.3
date: 2014/05/24 09:07:54;  author: root;  state: Exp;  lines: +16 -2
close the fd for the write operation(important to close the fd otherwise use lseek)
then open in the read mode then read while using its file descriptor.
----------------------------
revision 1.2
date: 2014/05/24 07:49:26;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.1
date: 2014/05/24 07:17:20;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: devopen.c,v
Working file: devopen.c
head: 1.3
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;	selected revisions: 3
description:
open the module in the kernel layer by passing the argument from the application layer of the open system call.
here we are not using the trim funciton.
----------------------------
revision 1.3
date: 2014/06/02 11:43:23;  author: root;  state: Exp;  lines: +5 -5
*** empty log message ***
----------------------------
revision 1.2
date: 2014/06/02 11:38:54;  author: root;  state: Exp;  lines: +7 -3
*** empty log message ***
----------------------------
revision 1.1
date: 2014/05/24 07:15:18;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: application2.c,v
Working file: application2.c
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
this is the application2.
here we are using the single node to exess the two application.
----------------------------
revision 1.1
date: 2014/05/30 07:55:15;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: cleanup.c,v
Working file: cleanup.c
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
this is used to remove and unregistered the module from the /proc/devices table.
----------------------------
revision 1.1
date: 2014/05/24 07:13:18;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: devread.c,v
Working file: devread.c
head: 1.18
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 18;	selected revisions: 18
description:
write the fuction for the read which is work in the kernel layer.
----------------------------
revision 1.18
date: 2014/06/03 04:29:10;  author: root;  state: Exp;  lines: +1 -1
making up the semaphore above the returing...
----------------------------
revision 1.17
date: 2014/06/03 04:23:54;  author: root;  state: Exp;  lines: +3 -1
*** empty log message ***
----------------------------
revision 1.16
date: 2014/06/02 12:00:36;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.15
date: 2014/06/02 11:45:09;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.14
date: 2014/06/02 05:14:57;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.13
date: 2014/06/02 05:08:38;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.12
date: 2014/06/02 04:52:46;  author: root;  state: Exp;  lines: +6 -0
making down and up the semaphore by using the down_interruptible() and up() respectively.
----------------------------
revision 1.11
date: 2014/05/30 11:03:46;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.10
date: 2014/05/30 07:09:09;  author: root;  state: Exp;  lines: +13 -8
implement the SEEK_SET again.
and it work file
----------------------------
revision 1.9
date: 2014/05/26 11:19:45;  author: root;  state: Exp;  lines: +28 -9
draw logic for the seek operation.
----------------------------
revision 1.8
date: 2014/05/24 11:40:26;  author: root;  state: Exp;  lines: +9 -5
give the defination for the read function.
----------------------------
revision 1.7
date: 2014/05/24 10:34:09;  author: root;  state: Exp;  lines: +7 -2
*** empty log message ***
----------------------------
revision 1.6
date: 2014/05/24 09:28:15;  author: root;  state: Exp;  lines: +5 -5
*** empty log message ***
----------------------------
revision 1.5
date: 2014/05/24 09:26:24;  author: root;  state: Exp;  lines: +7 -7
*** empty log message ***
----------------------------
revision 1.4
date: 2014/05/24 09:21:09;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.3
date: 2014/05/24 09:19:17;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.2
date: 2014/05/24 09:16:07;  author: root;  state: Exp;  lines: +1 -0
make a access to the private data to the sculldev
----------------------------
revision 1.1
date: 2014/05/24 09:09:26;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: fileopr.h,v
Working file: fileopr.h
head: 1.3
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;	selected revisions: 3
description:
used for the mapping purpose.
----------------------------
revision 1.3
date: 2014/05/25 11:30:20;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
----------------------------
revision 1.2
date: 2014/05/24 09:09:56;  author: root;  state: Exp;  lines: +2 -1
do the mapping of read
----------------------------
revision 1.1
date: 2014/05/24 07:18:55;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: prototype.h,v
Working file: prototype.h
head: 1.3
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;	selected revisions: 3
description:
declare the prototype.
----------------------------
revision 1.3
date: 2014/05/25 11:29:17;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.2
date: 2014/05/24 09:07:02;  author: root;  state: Exp;  lines: +2 -0
mention the prototype of the read call which is is fs.h header file and is in the struct file_operations {
----------------------------
revision 1.1
date: 2014/05/24 07:14:52;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: application3.c,v
Working file: application3.c
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
making the third application.
----------------------------
revision 1.1
date: 2014/05/30 09:20:55;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: declaration.h,v
Working file: declaration.h
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
define some macros which are freq	uently used in our program.
----------------------------
revision 1.1
date: 2014/05/24 07:14:06;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: devrelease.c,v
Working file: devrelease.c
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
for closeing the module
----------------------------
revision 1.1
date: 2014/05/24 07:16:45;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;	selected revisions: 2
description:
define macros and include header file in this and make a ScullDev and ScullQset structure in this.
----------------------------
revision 1.2
date: 2014/06/02 04:49:56;  author: root;  state: Exp;  lines: +3 -1
include the linux/semaphore.h header file for the semaphores.
----------------------------
revision 1.1
date: 2014/05/24 07:11:00;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: application4.c,v
Working file: application4.c
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
making the fourth application.
----------------------------
revision 1.1
date: 2014/05/30 09:21:09;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: devlseek.c,v
Working file: devlseek.c
head: 1.3
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;	selected revisions: 3
description:
----------------------------
revision 1.3
date: 2014/06/02 07:22:38;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.2
date: 2014/05/30 07:09:37;  author: root;  state: Exp;  lines: +4 -2
*** empty log message ***
----------------------------
revision 1.1
date: 2014/05/25 11:30:12;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: devwrite.c,v
Working file: devwrite.c
head: 1.9
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 9;	selected revisions: 9
description:
used to write in the multiple quantum
multiple qset
then use copy_from_user.
very important file and hard too.
----------------------------
revision 1.9
date: 2014/06/03 04:28:45;  author: root;  state: Exp;  lines: +2 -1
making up the semaphore above the returing.....
----------------------------
revision 1.8
date: 2014/06/03 04:21:25;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.7
date: 2014/06/02 12:11:54;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.6
date: 2014/06/02 11:45:08;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.5
date: 2014/06/02 05:14:55;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.4
date: 2014/06/02 04:51:17;  author: root;  state: Exp;  lines: +5 -0
making down and up the semaphore by using down_interruptible() and up() respectively
----------------------------
revision 1.3
date: 2014/05/25 09:31:31;  author: root;  state: Exp;  lines: +11 -4
use the loff and filep->f_pos to see the position of the pointer.
this loff and filep->f_pos could not be updated automatically so we make the updation.
----------------------------
revision 1.2
date: 2014/05/24 07:47:23;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.1
date: 2014/05/24 07:17:56;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: init.c,v
Working file: init.c
head: 1.3
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;	selected revisions: 3
description:
this is used to insert the module the register the module.
in this i dont use trim function.
----------------------------
revision 1.3
date: 2014/06/02 11:38:52;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.2
date: 2014/06/02 04:50:25;  author: root;  state: Exp;  lines: +1 -0
initilize the binary semaphore before the cdev_add using the sema_init()
----------------------------
revision 1.1
date: 2014/05/24 07:12:20;  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>