EmbLogic's Blog

Kernel Timers

Timers are used to schedule execution of a function (a timer handler) at a particular time in the future. They thus work differently from task queues and in that you can specify when in the future your function will be called, whereas you can’t tell exactly when a queued task will be executed. On the other hand, kernel timers are similar to task queues in that a function registered in a kernel timer is executed only once — timers aren’t cyclic.

A timer is much easier to use. You register your function once, and the kernel calls it once when the timer expires. Such a functionality is used often within the kernel proper, but it is sometimes needed by the drivers as well, as in the example of the floppy motor. A timer is characterized by its time-out value (in jiffies) and the function to be called when the timer expires. The timer handler receives an argument, which is stored in the data structure, together with a pointer to the handler itself.

The data structure of a timer looks like the following, which is extracted from <linux/timer.h>):

 struct timer_list {
     unsigned long expires;            /* the timeout, in jiffies */
     unsigned long data;               /* argument to the handler */
     void (*function)(unsigned long);  /* handler of the timeout */
     };
These are the functions used to act on timers:
  • void init_timer(struct timer_list *timer);
  • void add_timer(struct timer_list *timer);
  • int del_timer(struct timer_list *timer);

The code for /proc/jitimer is as follows:

struct jit_data{

struct timer_list timer;

unsigned long prev-jiffies;

unsigned char*buff;

};

 

Posted in Character Driver | Leave a comment

Program to find the HCF and LCM of two numbers.

//HCF and LCM of two nos.

#include
int main()
{
int a,b,num1,num2,deno,nume,rem=1,lcm;

printf(“\nEnter two nos: “);
scanf(“%d %d”,&a,&b);

if(a>b)
{
num1=a;
num2=b;
}

else
{
num1=b;
num2=a;
}

nume=num1;
deno=num2;

while(rem!=0)
{
rem=nume%deno;
nume=deno;
deno=rem;
}

printf(“\nHCF: %d “,nume);
lcm=(num1*num2)/nume;
printf(“\nLCM: %d “,lcm);

return 0;

}

Posted in Data Structures with C | Leave a comment

how to install bluetooth drivers on fedora 17

please, tell me the steps to install bluetooth drivers on fedora 17….

Posted in Uncategorized | Leave a comment

create socket programme using client and server

CLIENT:-

head    1.1;
access;
symbols;
locks
root:1.1; strict;
comment    @ * @;

1.1
date    2014.06.17.10.36.05;    author root;    state Exp;
branches;
next    ;

desc
@creat reqclient for socket.
@

1.1
log
@Initial revision
@
text
@#include”header.c”
int main()
{
char data1[3]={5,4,’+’};
char sum;
int len,server_fd,count;
struct sockaddr_in client_addr;
client_addr.sin_family=AF_INET;
client_addr.sin_port=htons(2224);
client_addr.sin_addr.s_addr=inet_addr(“127.0.0.1″);
/*struct data data1;
data1.a=2;
data1.b=4;
data1.opr=’+’;*/
int client_fd=socket(AF_INET,SOCK_STREAM,0);
if(client_fd<0)
{
perror(“\n socket is failure”);
exit(-1);
}
int fd=connect(client_fd,(struct sockaddr *)&client_addr,sizeof(struct sockaddr_in));
if(fd<0)
{
perror(“\n connect is failure”);
exit(-1);
}
len=sizeof(struct data);
count=write(client_fd,&data1,3);
printf(“no.of bytes writtern %d\n”,count);
read(client_fd,&sum,1);
printf(“sum= %d\n”,sum);
return 0;

}
@

SERVER:-

locks
root:1.1; strict;
comment    @ * @;

1.1
date    2014.06.17.10.34.40;    author root;    state Exp;
branches;
next    ;

desc
@server for socket impl.
@

1.1
log
@Initial revision
@
text
@#include”header.c”
int main()
{
char buff[3];
socklen_t len;
len=sizeof(struct sockaddr_in);
struct data data1;
int server_fd,server_fd1,true=1,ret,count,count1;
char sum;
struct sockaddr_in server_addr,client_addr,reqclient_addr,server_addr1,client_addr1;
server_addr.sin_family=AF_INET;
server_addr.sin_port=htons(2224);
server_addr.sin_addr.s_addr=inet_addr(“127.0.0.1″);
server_fd=socket(AF_INET,SOCK_STREAM,0);
server_fd1=socket(AF_INET,SOCK_STREAM,0);
if(setsockopt(server_fd,SOL_SOCKET,SO_REUSEADDR,&true,sizeof(int))==-1)
{
perror(“\n setsockopt is failure”);
exit(-1);
}
if(setsockopt(server_fd1,SOL_SOCKET,SO_REUSEADDR,&true,sizeof(int))==-1)
{
perror(“\n setsockopt is failure”);
exit(-1);
}

ret=bind(server_fd,(const struct sockaddr *)&server_addr,sizeof(struct sockaddr_in));
if(ret<0)
{
perror(“\n bind is failure”);
exit(-1);
}
printf(“gfhgkjj,hkh,”);
ret=listen(server_fd,5);
if(ret<0)
{
perror(“\n listen is failure”);
exit(-1);
}

int fd=accept(server_fd,( struct sockaddr *)&client_addr,&len);
if(fd<0)
{
perror(” accept is failure\n”);
exit(-1);
}

//        len=sizeof(struct data);
count=read(fd,buff,3);
printf(“VALUE OF 1ST VARIABLE OF BUFF IN SERVER —>>[%d]\n”,buff[0]);
printf(“VALUE OF 2nd VARIABLE OF BUFF IN SERVER —>>[%d]\n”,buff[1]);
printf(“VALUE OF 3rd VARIABLE OF BUFF IN SERVER —>>[%c]\n”,buff[2]);
//printf(“\n count=%d,data1.a=%d,data1.b=%d,data1.opr=%c\n”,count,data1.a,data1.b,data1.opr);

server_addr1.sin_family=AF_INET;
server_addr1.sin_port=htons(6666);
server_addr1.sin_addr.s_addr=inet_addr(“127.0.0.1″);

ret=bind(server_fd1,(const struct sockaddr *)&server_addr1,sizeof(struct sockaddr_in));
if(ret<0)
{
perror(“\n bind is failure”);
exit(-1);
}
ret=listen(server_fd1,5);
if(ret<0)
{
perror(“\n listen is failure”);
exit(-1);
}
int fd1=accept(server_fd1,( struct sockaddr *)&reqclient_addr,&len);
if(fd<0)
{
perror(“\n accept is failure”);
exit(-1);
}
len=sizeof(struct data);
count=write(fd1,buff,3);
printf(“no.of bytes writtern %d\n”,count);
count1=read(fd1,&sum,1);
printf(“count is =%d,sum=%d”,count1,sum);
count=write(fd,&sum,1);
return 0;
}
@

Posted in Uncategorized | Leave a comment

check this code out on function pointers

snap1

Posted in Data Structures with C | Leave a comment

Character Driver(/proc)

#sucessfully implement the /proc in device driver....

RCS file: application.c,v
Working file: application.c
head: 1.34
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 34;	selected revisions: 34
description:
this is the application program in the user space
open write and close is used
----------------------------
revision 1.34
date: 2014/06/08 10:27:10;  author: root;  state: Exp;  lines: +3 -3
*** empty log message ***
----------------------------
revision 1.33
date: 2014/06/08 10:17:20;  author: root;  state: Exp;  lines: +4 -0
*** empty log message ***
----------------------------
revision 1.32
date: 2014/06/08 10:13:33;  author: root;  state: Exp;  lines: +2 -0
*** empty log message ***
----------------------------
revision 1.31
date: 2014/06/08 10:03:52;  author: root;  state: Exp;  lines: +1 -1
make arg instead of &arg
----------------------------
revision 1.30
date: 2014/06/08 07:10:04;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
----------------------------
revision 1.29
date: 2014/06/08 05:14:38;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.28
date: 2014/06/07 12:59:04;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.27
date: 2014/06/07 12:57:58;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.26
date: 2014/06/07 12:45:21;  author: root;  state: Exp;  lines: +3 -3
*** empty log message ***
----------------------------
revision 1.25
date: 2014/06/07 12:42:55;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.24
date: 2014/06/07 12:42:03;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
----------------------------
revision 1.23
date: 2014/06/07 12:37:56;  author: root;  state: Exp;  lines: +6 -2
call a system call for the SCULL_SQUANTUM
----------------------------
revision 1.22
date: 2014/06/07 12:31:14;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.21
date: 2014/06/07 10:20:19;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.20
date: 2014/06/07 10:11:16;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.19
date: 2014/06/07 09:55:19;  author: root;  state: Exp;  lines: +3 -1
make a call for the othe macro i.e for the SCUlL_GQUANTUM
----------------------------
revision 1.18
date: 2014/06/07 09:35:52;  author: root;  state: Exp;  lines: +5 -1
make a application call for the ioctl
----------------------------
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: 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.15
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 15;	selected revisions: 15
description:
used to write in the multiple quantum
multiple qset
then use copy_from_user.
very important file and hard too.
----------------------------
revision 1.15
date: 2014/06/05 06:54:22;  author: root;  state: Exp;  lines: +4 -2
*** empty log message ***
----------------------------
revision 1.14
date: 2014/06/05 05:56:16;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.13
date: 2014/06/05 05:07:03;  author: root;  state: Exp;  lines: +5 -3
use the spin_lock and spin_unlock
----------------------------
revision 1.12
date: 2014/06/03 12:48:15;  author: root;  state: Exp;  lines: +1 -0
given the complete call in the last...
----------------------------
revision 1.11
date: 2014/06/03 12:44:22;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.10
date: 2014/06/03 04:57:08;  author: root;  state: Exp;  lines: +4 -3
apply the wait_for_completion() same as the downing the semaphore...
apply the complete() same as the uping the semaphore...
----------------------------
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.11
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 11;	selected revisions: 11
description:
this is used to insert the module the register the module.
in this i dont use trim function.
----------------------------
revision 1.11
date: 2014/06/17 13:23:44;  author: root;  state: Exp;  lines: +18 -2
call the creat_proc_entry_read...
----------------------------
revision 1.10
date: 2014/06/16 13:23:35;  author: root;  state: Exp;  lines: +2 -0
*** empty log message ***
----------------------------
revision 1.9
date: 2014/06/16 13:02:05;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.8
date: 2014/06/16 12:33:57;  author: root;  state: Exp;  lines: +6 -0
create the proc entry as *create_proc_entry() and works fine for me....as the entry is listed in the /proc...
----------------------------
revision 1.7
date: 2014/06/05 06:54:20;  author: root;  state: Exp;  lines: +4 -4
*** empty log message ***
----------------------------
revision 1.6
date: 2014/06/05 05:55:48;  author: root;  state: Exp;  lines: +4 -2
use the rwlock_t
----------------------------
revision 1.5
date: 2014/06/05 05:05:37;  author: root;  state: Exp;  lines: +3 -1
make the init
init_apin_lock is applied here....
----------------------------
revision 1.4
date: 2014/06/03 04:56:36;  author: root;  state: Exp;  lines: +2 -1
initilize the completion by init_completion above the cdev_add...
----------------------------
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
=============================================================================

RCS file: prototype.h,v
Working file: prototype.h
head: 1.4
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;	selected revisions: 4
description:
declare the prototype.
----------------------------
revision 1.4
date: 2014/06/07 09:35:22;  author: root;  state: Exp;  lines: +2 -0
write the prototype for the scullioctl
----------------------------
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: 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: ioctl.c,v
Working file: ioctl.c
head: 1.22
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 22;	selected revisions: 22
description:
the file corresponds to unlocked_ioctl...
----------------------------
revision 1.22
date: 2014/06/08 08:09:38;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.21
date: 2014/06/08 08:09:05;  author: root;  state: Exp;  lines: +2 -0
*** empty log message ***
----------------------------
revision 1.20
date: 2014/06/08 05:36:29;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.19
date: 2014/06/08 05:23:12;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.18
date: 2014/06/08 05:15:34;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.17
date: 2014/06/08 05:14:39;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.16
date: 2014/06/07 13:09:16;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.15
date: 2014/06/07 13:08:24;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.14
date: 2014/06/07 13:07:43;  author: root;  state: Exp;  lines: +2 -0
*** empty log message ***
----------------------------
revision 1.13
date: 2014/06/07 12:48:51;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.12
date: 2014/06/07 12:44:11;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.11
date: 2014/06/07 12:40:50;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.10
date: 2014/06/07 12:38:55;  author: root;  state: Exp;  lines: +5 -0
make the defination for the SULL_SQUANTUM
----------------------------
revision 1.9
date: 2014/06/07 12:31:19;  author: root;  state: Exp;  lines: +4 -3
*** empty log message ***
----------------------------
revision 1.8
date: 2014/06/07 10:21:43;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.7
date: 2014/06/07 10:21:08;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.6
date: 2014/06/07 10:12:39;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.5
date: 2014/06/07 10:10:06;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.4
date: 2014/06/07 09:55:55;  author: root;  state: Exp;  lines: +1 -0
use put_user
use put_user() to written in the application layer.
----------------------------
revision 1.3
date: 2014/06/07 09:47:26;  author: root;  state: Exp;  lines: +9 -1
making the switch for the different MACRO of IOCTL
----------------------------
revision 1.2
date: 2014/06/07 09:43:12;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.1
date: 2014/06/07 09:30:35;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: cleanup.c,v
Working file: cleanup.c
head: 1.3
branch:
locks: strict
	root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;	selected revisions: 3
description:
this is used to remove and unregistered the module from the /proc/devices table.
----------------------------
revision 1.3	locked by: root;
date: 2014/06/16 13:00:23;  author: root;  state: Exp;  lines: +1 -1
pass 0 istead of NULL in the parent...
----------------------------
revision 1.2
date: 2014/06/16 12:35:08;  author: root;  state: Exp;  lines: +1 -0
remove the entry from the /proc.....and works file for me.... :)
----------------------------
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.29
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 29;	selected revisions: 29
description:
write the fuction for the read which is work in the kernel layer.
----------------------------
revision 1.29
date: 2014/06/08 10:29:24;  author: root;  state: Exp;  lines: +5 -5
*** empty log message ***
----------------------------
revision 1.28
date: 2014/06/08 10:26:24;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.27
date: 2014/06/08 10:21:43;  author: root;  state: Exp;  lines: +5 -5
*** empty log message ***
----------------------------
revision 1.26
date: 2014/06/05 06:54:23;  author: root;  state: Exp;  lines: +4 -2
*** empty log message ***
----------------------------
revision 1.25
date: 2014/06/05 06:29:11;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.24
date: 2014/06/05 06:02:00;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.23
date: 2014/06/05 05:56:16;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.22
date: 2014/06/05 05:07:23;  author: root;  state: Exp;  lines: +6 -3
use the spin_lock and the spin_unlock...
----------------------------
revision 1.21
date: 2014/06/03 12:48:40;  author: root;  state: Exp;  lines: +1 -0
give the wait_for_completion in the start...
and complete in the last....
work fine....in the different application accesing the same node....
----------------------------
revision 1.20
date: 2014/06/03 05:00:49;  author: root;  state: Exp;  lines: +3 -2
apply the completion in the devread.
----------------------------
revision 1.19
date: 2014/06/03 04:58:08;  author: root;  state: Exp;  lines: +2 -2
remove the semaphore...
----------------------------
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.4
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;	selected revisions: 4
description:
used for the mapping purpose.
----------------------------
revision 1.4
date: 2014/06/07 09:36:06;  author: root;  state: Exp;  lines: +2 -1
mapp the unlocked_ioctl with the scull_ioctl
----------------------------
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: ioctl.c,v
Working file: ioctl.c
head: 1.22
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 22;	selected revisions: 22
description:
the file corresponds to unlocked_ioctl...
----------------------------
revision 1.22
date: 2014/06/08 08:09:38;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.21
date: 2014/06/08 08:09:05;  author: root;  state: Exp;  lines: +2 -0
*** empty log message ***
----------------------------
revision 1.20
date: 2014/06/08 05:36:29;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.19
date: 2014/06/08 05:23:12;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.18
date: 2014/06/08 05:15:34;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.17
date: 2014/06/08 05:14:39;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.16
date: 2014/06/07 13:09:16;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.15
date: 2014/06/07 13:08:24;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.14
date: 2014/06/07 13:07:43;  author: root;  state: Exp;  lines: +2 -0
*** empty log message ***
----------------------------
revision 1.13
date: 2014/06/07 12:48:51;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.12
date: 2014/06/07 12:44:11;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.11
date: 2014/06/07 12:40:50;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.10
date: 2014/06/07 12:38:55;  author: root;  state: Exp;  lines: +5 -0
make the defination for the SULL_SQUANTUM
----------------------------
revision 1.9
date: 2014/06/07 12:31:19;  author: root;  state: Exp;  lines: +4 -3
*** empty log message ***
----------------------------
revision 1.8
date: 2014/06/07 10:21:43;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.7
date: 2014/06/07 10:21:08;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.6
date: 2014/06/07 10:12:39;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.5
date: 2014/06/07 10:10:06;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.4
date: 2014/06/07 09:55:55;  author: root;  state: Exp;  lines: +1 -0
use put_user
use put_user() to written in the application layer.
----------------------------
revision 1.3
date: 2014/06/07 09:47:26;  author: root;  state: Exp;  lines: +9 -1
making the switch for the different MACRO of IOCTL
----------------------------
revision 1.2
date: 2014/06/07 09:43:12;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.1
date: 2014/06/07 09:30:35;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: declaration.h,v
Working file: declaration.h
head: 1.4
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;	selected revisions: 4
description:
define some macros which are freq	uently used in our program.
----------------------------
revision 1.4
date: 2014/06/05 06:54:21;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.3
date: 2014/06/05 05:56:14;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
----------------------------
revision 1.2
date: 2014/06/05 05:06:10;  author: root;  state: Exp;  lines: +1 -0
make the extern variable spinlock_t lock
----------------------------
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.6
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 6;	selected revisions: 6
description:
define macros and include header file in this and make a ScullDev and ScullQset structure in this.
----------------------------
revision 1.6
date: 2014/06/16 12:33:19;  author: root;  state: Exp;  lines: +1 -0
include the header file for the proc i.e <linux/proc_fs.h>
----------------------------
revision 1.5
date: 2014/06/07 09:29:12;  author: root;  state: Exp;  lines: +3 -0
here we include the header file <asm-generic/ioctl.h>
here we also include the user define ioctl.h header file.
----------------------------
revision 1.4
date: 2014/06/05 05:05:01;  author: root;  state: Exp;  lines: +2 -0
include the header file for the spinlock....i.e spinlock.h
----------------------------
revision 1.3
date: 2014/06/03 04:56:00;  author: root;  state: Exp;  lines: +2 -0
include the header file <linux.completion.h> for the completion...
----------------------------
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: read_proc.h,v
Working file: read_proc.h
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
this is the read proc file...
----------------------------
revision 1.1
date: 2014/06/19 05:06:08;  author: root;  state: Exp;
Initial revision
=============================================================================
#sucessfully implement the /proc in device driver....

RCS file: application.c,v
Working file: application.c
head: 1.34
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 34;	selected revisions: 34
description:
this is the application program in the user space
open write and close is used
----------------------------
revision 1.34
date: 2014/06/08 10:27:10;  author: root;  state: Exp;  lines: +3 -3
*** empty log message ***
----------------------------
revision 1.33
date: 2014/06/08 10:17:20;  author: root;  state: Exp;  lines: +4 -0
*** empty log message ***
----------------------------
revision 1.32
date: 2014/06/08 10:13:33;  author: root;  state: Exp;  lines: +2 -0
*** empty log message ***
----------------------------
revision 1.31
date: 2014/06/08 10:03:52;  author: root;  state: Exp;  lines: +1 -1
make arg instead of &arg
----------------------------
revision 1.30
date: 2014/06/08 07:10:04;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
----------------------------
revision 1.29
date: 2014/06/08 05:14:38;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.28
date: 2014/06/07 12:59:04;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.27
date: 2014/06/07 12:57:58;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.26
date: 2014/06/07 12:45:21;  author: root;  state: Exp;  lines: +3 -3
*** empty log message ***
----------------------------
revision 1.25
date: 2014/06/07 12:42:55;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.24
date: 2014/06/07 12:42:03;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
----------------------------
revision 1.23
date: 2014/06/07 12:37:56;  author: root;  state: Exp;  lines: +6 -2
call a system call for the SCULL_SQUANTUM
----------------------------
revision 1.22
date: 2014/06/07 12:31:14;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.21
date: 2014/06/07 10:20:19;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.20
date: 2014/06/07 10:11:16;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.19
date: 2014/06/07 09:55:19;  author: root;  state: Exp;  lines: +3 -1
make a call for the othe macro i.e for the SCUlL_GQUANTUM
----------------------------
revision 1.18
date: 2014/06/07 09:35:52;  author: root;  state: Exp;  lines: +5 -1
make a application call for the ioctl
----------------------------
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: 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.15
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 15;	selected revisions: 15
description:
used to write in the multiple quantum
multiple qset
then use copy_from_user.
very important file and hard too.
----------------------------
revision 1.15
date: 2014/06/05 06:54:22;  author: root;  state: Exp;  lines: +4 -2
*** empty log message ***
----------------------------
revision 1.14
date: 2014/06/05 05:56:16;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.13
date: 2014/06/05 05:07:03;  author: root;  state: Exp;  lines: +5 -3
use the spin_lock and spin_unlock
----------------------------
revision 1.12
date: 2014/06/03 12:48:15;  author: root;  state: Exp;  lines: +1 -0
given the complete call in the last...
----------------------------
revision 1.11
date: 2014/06/03 12:44:22;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.10
date: 2014/06/03 04:57:08;  author: root;  state: Exp;  lines: +4 -3
apply the wait_for_completion() same as the downing the semaphore...
apply the complete() same as the uping the semaphore...
----------------------------
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.11
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 11;	selected revisions: 11
description:
this is used to insert the module the register the module.
in this i dont use trim function.
----------------------------
revision 1.11
date: 2014/06/17 13:23:44;  author: root;  state: Exp;  lines: +18 -2
call the creat_proc_entry_read...
----------------------------
revision 1.10
date: 2014/06/16 13:23:35;  author: root;  state: Exp;  lines: +2 -0
*** empty log message ***
----------------------------
revision 1.9
date: 2014/06/16 13:02:05;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.8
date: 2014/06/16 12:33:57;  author: root;  state: Exp;  lines: +6 -0
create the proc entry as *create_proc_entry() and works fine for me....as the entry is listed in the /proc...
----------------------------
revision 1.7
date: 2014/06/05 06:54:20;  author: root;  state: Exp;  lines: +4 -4
*** empty log message ***
----------------------------
revision 1.6
date: 2014/06/05 05:55:48;  author: root;  state: Exp;  lines: +4 -2
use the rwlock_t
----------------------------
revision 1.5
date: 2014/06/05 05:05:37;  author: root;  state: Exp;  lines: +3 -1
make the init
init_apin_lock is applied here....
----------------------------
revision 1.4
date: 2014/06/03 04:56:36;  author: root;  state: Exp;  lines: +2 -1
initilize the completion by init_completion above the cdev_add...
----------------------------
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
=============================================================================

RCS file: prototype.h,v
Working file: prototype.h
head: 1.4
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;	selected revisions: 4
description:
declare the prototype.
----------------------------
revision 1.4
date: 2014/06/07 09:35:22;  author: root;  state: Exp;  lines: +2 -0
write the prototype for the scullioctl
----------------------------
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: 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: ioctl.c,v
Working file: ioctl.c
head: 1.22
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 22;	selected revisions: 22
description:
the file corresponds to unlocked_ioctl...
----------------------------
revision 1.22
date: 2014/06/08 08:09:38;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.21
date: 2014/06/08 08:09:05;  author: root;  state: Exp;  lines: +2 -0
*** empty log message ***
----------------------------
revision 1.20
date: 2014/06/08 05:36:29;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.19
date: 2014/06/08 05:23:12;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.18
date: 2014/06/08 05:15:34;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.17
date: 2014/06/08 05:14:39;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.16
date: 2014/06/07 13:09:16;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.15
date: 2014/06/07 13:08:24;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.14
date: 2014/06/07 13:07:43;  author: root;  state: Exp;  lines: +2 -0
*** empty log message ***
----------------------------
revision 1.13
date: 2014/06/07 12:48:51;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.12
date: 2014/06/07 12:44:11;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.11
date: 2014/06/07 12:40:50;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.10
date: 2014/06/07 12:38:55;  author: root;  state: Exp;  lines: +5 -0
make the defination for the SULL_SQUANTUM
----------------------------
revision 1.9
date: 2014/06/07 12:31:19;  author: root;  state: Exp;  lines: +4 -3
*** empty log message ***
----------------------------
revision 1.8
date: 2014/06/07 10:21:43;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.7
date: 2014/06/07 10:21:08;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.6
date: 2014/06/07 10:12:39;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.5
date: 2014/06/07 10:10:06;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.4
date: 2014/06/07 09:55:55;  author: root;  state: Exp;  lines: +1 -0
use put_user
use put_user() to written in the application layer.
----------------------------
revision 1.3
date: 2014/06/07 09:47:26;  author: root;  state: Exp;  lines: +9 -1
making the switch for the different MACRO of IOCTL
----------------------------
revision 1.2
date: 2014/06/07 09:43:12;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.1
date: 2014/06/07 09:30:35;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: cleanup.c,v
Working file: cleanup.c
head: 1.3
branch:
locks: strict
	root: 1.3
access list:
symbolic names:
keyword substitution: kv
total revisions: 3;	selected revisions: 3
description:
this is used to remove and unregistered the module from the /proc/devices table.
----------------------------
revision 1.3	locked by: root;
date: 2014/06/16 13:00:23;  author: root;  state: Exp;  lines: +1 -1
pass 0 istead of NULL in the parent...
----------------------------
revision 1.2
date: 2014/06/16 12:35:08;  author: root;  state: Exp;  lines: +1 -0
remove the entry from the /proc.....and works file for me.... :)
----------------------------
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.29
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 29;	selected revisions: 29
description:
write the fuction for the read which is work in the kernel layer.
----------------------------
revision 1.29
date: 2014/06/08 10:29:24;  author: root;  state: Exp;  lines: +5 -5
*** empty log message ***
----------------------------
revision 1.28
date: 2014/06/08 10:26:24;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.27
date: 2014/06/08 10:21:43;  author: root;  state: Exp;  lines: +5 -5
*** empty log message ***
----------------------------
revision 1.26
date: 2014/06/05 06:54:23;  author: root;  state: Exp;  lines: +4 -2
*** empty log message ***
----------------------------
revision 1.25
date: 2014/06/05 06:29:11;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.24
date: 2014/06/05 06:02:00;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.23
date: 2014/06/05 05:56:16;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.22
date: 2014/06/05 05:07:23;  author: root;  state: Exp;  lines: +6 -3
use the spin_lock and the spin_unlock...
----------------------------
revision 1.21
date: 2014/06/03 12:48:40;  author: root;  state: Exp;  lines: +1 -0
give the wait_for_completion in the start...
and complete in the last....
work fine....in the different application accesing the same node....
----------------------------
revision 1.20
date: 2014/06/03 05:00:49;  author: root;  state: Exp;  lines: +3 -2
apply the completion in the devread.
----------------------------
revision 1.19
date: 2014/06/03 04:58:08;  author: root;  state: Exp;  lines: +2 -2
remove the semaphore...
----------------------------
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.4
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;	selected revisions: 4
description:
used for the mapping purpose.
----------------------------
revision 1.4
date: 2014/06/07 09:36:06;  author: root;  state: Exp;  lines: +2 -1
mapp the unlocked_ioctl with the scull_ioctl
----------------------------
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: ioctl.c,v
Working file: ioctl.c
head: 1.22
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 22;	selected revisions: 22
description:
the file corresponds to unlocked_ioctl...
----------------------------
revision 1.22
date: 2014/06/08 08:09:38;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.21
date: 2014/06/08 08:09:05;  author: root;  state: Exp;  lines: +2 -0
*** empty log message ***
----------------------------
revision 1.20
date: 2014/06/08 05:36:29;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.19
date: 2014/06/08 05:23:12;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.18
date: 2014/06/08 05:15:34;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.17
date: 2014/06/08 05:14:39;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.16
date: 2014/06/07 13:09:16;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.15
date: 2014/06/07 13:08:24;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.14
date: 2014/06/07 13:07:43;  author: root;  state: Exp;  lines: +2 -0
*** empty log message ***
----------------------------
revision 1.13
date: 2014/06/07 12:48:51;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.12
date: 2014/06/07 12:44:11;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.11
date: 2014/06/07 12:40:50;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.10
date: 2014/06/07 12:38:55;  author: root;  state: Exp;  lines: +5 -0
make the defination for the SULL_SQUANTUM
----------------------------
revision 1.9
date: 2014/06/07 12:31:19;  author: root;  state: Exp;  lines: +4 -3
*** empty log message ***
----------------------------
revision 1.8
date: 2014/06/07 10:21:43;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.7
date: 2014/06/07 10:21:08;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.6
date: 2014/06/07 10:12:39;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
----------------------------
revision 1.5
date: 2014/06/07 10:10:06;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.4
date: 2014/06/07 09:55:55;  author: root;  state: Exp;  lines: +1 -0
use put_user
use put_user() to written in the application layer.
----------------------------
revision 1.3
date: 2014/06/07 09:47:26;  author: root;  state: Exp;  lines: +9 -1
making the switch for the different MACRO of IOCTL
----------------------------
revision 1.2
date: 2014/06/07 09:43:12;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
----------------------------
revision 1.1
date: 2014/06/07 09:30:35;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: declaration.h,v
Working file: declaration.h
head: 1.4
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 4;	selected revisions: 4
description:
define some macros which are freq	uently used in our program.
----------------------------
revision 1.4
date: 2014/06/05 06:54:21;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
----------------------------
revision 1.3
date: 2014/06/05 05:56:14;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
----------------------------
revision 1.2
date: 2014/06/05 05:06:10;  author: root;  state: Exp;  lines: +1 -0
make the extern variable spinlock_t lock
----------------------------
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.6
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 6;	selected revisions: 6
description:
define macros and include header file in this and make a ScullDev and ScullQset structure in this.
----------------------------
revision 1.6
date: 2014/06/16 12:33:19;  author: root;  state: Exp;  lines: +1 -0
include the header file for the proc i.e <linux/proc_fs.h>
----------------------------
revision 1.5
date: 2014/06/07 09:29:12;  author: root;  state: Exp;  lines: +3 -0
here we include the header file <asm-generic/ioctl.h>
here we also include the user define ioctl.h header file.
----------------------------
revision 1.4
date: 2014/06/05 05:05:01;  author: root;  state: Exp;  lines: +2 -0
include the header file for the spinlock....i.e spinlock.h
----------------------------
revision 1.3
date: 2014/06/03 04:56:00;  author: root;  state: Exp;  lines: +2 -0
include the header file <linux.completion.h> for the completion...
----------------------------
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: read_proc.h,v
Working file: read_proc.h
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;	selected revisions: 1
description:
this is the read proc file...
----------------------------
revision 1.1
date: 2014/06/19 05:06:08;  author: root;  state: Exp;
Initial revision
=============================================================================
Posted in Uncategorized | Leave a comment

Inter-Process Communication with Sockets

Inter-Process Communication with Sockets

Client-Server Model

A standard model for distributed applications is the client-server model. A server is a process that is waiting to be contacted by a client process so that the server can do something or the client. A typical scenario is as follows:

  • The server process is started on some computer system. It initializes itself, then goes to sleep waiting for a client process to contact it requesting some service.
  • A client process is started, either on the same system or on another system that is connected to the server’s system with a network. The client process sends a request across the network to the server requesting a service of some form.
  • When the server process has finished providing its service to the client, the server goes back to sleep, waiting for the next client request to arrive.

Socket definition

A communication between two processes running on two computer systems can be completely specified by the association: {protocol, local-address, local-process, remote-address, remote-process} We also define a half association as either {protocol, local-address, local-process} or {protocol, remote-address, remote-process}, which specify half of a connection. This half association is also called socket, or transport address. The term socket has been popularized by the Berkeley Unix networking system, where it is “an end point of communication”, which corresponds to the definition of half association.

System calls related to sockets

For a UNIX file, there are six system calls for input/output (I/O): open, create, close, read, write and lseek. All these system calls work with a file descriptor, a number corresponding to a certain file. It would be nice if the interface to the network facilities maintained the file descriptor semantics of the Unix file system, but network I/O involves more details and options than the file input/output. However, the difference is not extremely big.

This figure shows a time line of a typical scenario that takes place for a connection-oriented transfer. First the server is started, then sometimes later a client is started that connects to the server.

To do network I/O, the first thing a process must do is call the socket (see the man page for the system calls presented, e.g. man -s3n socket) system call, specifying the type of communication protocol desired.

#include <sys/types.h>
#include <sys/socket.h>

int socket(int family, int type, int protocol);

for our lab, we will use only the internet protocols and stream socket type, so the function call will look like: sockfd = socket(AF_INET, SOCK_STREAM, 0); The socket system call returns a small integer value, similar to a file descriptor. We call this a socket descriptor, or a sockfd.

Up to now, for the association {protocol, local-address, local-process, remote-address, remote-process} we have only specified the protocol. In order to fill the local-address and local-process elements of the association we will use the bind system call.

#include <sys/types.h>
#include <sys/socket.h>

int bind(int sockfd, struct sockaddr *myaddr, int addrlen);

The second argument of bind is a pointer to a protocol-specific address, and the third argument is the size of the address structure. bind tells the system “this is my address and any messages received for this address are to be given to me”.

Then, the server indicates that is willing to receive connections:

 
int listen(int sockfd, int backlog); 

The backlog argument specifies how many connection requests can be queued by the system while it waits for the server to execute the accept system call.

After executing the listen system call, an actual connection is waited for by having the server execute the accept system call.

#include <sys/types.h>
#include <sys/socket.h>

int accept(int sockfd, struct sockaddr *peer, int *addrlen);

accept takes the first connection request from the queue, and creates another socket with the same proprieties as sockfd. When a connection request is received and accepted, the new socket descriptor returned by accept refers to a complete association {protocol, remote-address, remote-process} with the last two fields filled with information from the client. The client’s address is also set in the second (*peer) parameter together with its length, *addrlen;

A client process connects to a socket descriptor following the socket system call to establish a connection with a server:

#include <sys/types.h>
#include <sys/socket.h>

int connect(int sockfd, struct sockaddr *servaddr, int addrlen);

The sockfd is a socket descriptor that was returned by the socket system call. The second and the third argument are a pointer to a socket address, and its size.

From now on, the server and the client can use the write/read system calls for file descriptors in order to communicate. Stream sockets exhibit a behaviour with the read and write system calls that differs from normal file I/O. A read or a write on a socket might input or output fewer bytes than requested, but this is not an error condition. The reason is that buffer limits might be reached for the socket in the kernel and all that is required is for the caller to invoke the read or write system call again, for the remaining bytes.

Many of the socket system calls require a pointer to a socket address structure as an argument. The definition of this structure is in

<sys/socket.h>:

struct sockaddr {
	u_short 	sa_family; /* address_family: AF_xxx value */	
	char 		sa_data[14];
};

The contents of the 14 bytes of protocol-specific address are interpreted according to the type of address. For the Internet family, the following structures are defined in <netinet/in.h>:

struct in_addr {
	u_long 		s_addr; /* 32 bit netid/hostid */
};

struct sockaddr_in {
	short 		sin_family; 		/* AF_INET */
	u_short 	sin_port; 		/* 16 bit port number, network byte ordered */
	srtuct in_addr 	sin_addr; 		/* 32 bit netid/hostid, network byte ordered */
	char 		sin_zero[8]; 		/* unused */
}

Both the client and the server close their sockets using the close function call.

Posted in Uncategorized | Leave a comment

TCP/IP Based client & server using socket

Abstract:

The POSIX thread libraries are a standards based thread API for C/C++. It allows one to spawn a new concurrent process flow. It is most effective on multi-processor or multi-core systems where the process flow can be scheduled to run on another processor thus gaining speed through parallel or distributed processing. Threads require less overhead than “forking” or spawning a new process because the system does not initialize a new system virtual memory space and environment for the process. While most effective on a multiprocessor system, gains are also found on uniprocessor systems which exploit latency in I/O and other system functions which may halt process execution. Parallel programming technologies such as MPI and PVM are used in a distributed computing environment while threads are limited to a single computer system. All threads within a process share the same address space. A thread is spawned by defining a function and its arguments which will be processed in the thread. The purpose of using the POSIX thread library in your software is to execute software faster.

Sockets are the fundamental technology for programming software to communicate on TCP/IP networks. A socket provides a bidirectional communication endpoint for sending and receiving data with another socket. Socket connections normally run between two different computers on a LAN or across the Internet, but they can also be used for interprocess communication on a single computer.

Introduction:

A thread is a semi-process, that has its own stack, and executes a given piece of code. Unlike a real process, the thread normally shares its memory with other threads (where as for processes we usually have a different memory area for each one of them). A Thread Group is a set of threads all executing inside the same process. They all share the same memory, and thus can access the same global variables, same heap memory, same set of file descriptors, etc. All these threads execute in parallel (i.e. using time slices, or if the system has several processors, then really in parallel).

The advantage of using a thread group instead of a normal serial program is that several operations may be carried out in parallel, and thus events can be handled immediately as they arrive (for example, if we have one thread handling a user interface, and another thread handling database queries, we can execute a heavy query requested by the user, and still respond to user input while the query is executed).

The advantage of using a thread group over using a process group is that context switching between threads is much faster then context switching between processes (context switching means that the system switches from running one thread or process, to running another thread or process). Also, communications between two threads is usually faster and easier to implement then communications between two processes.

On the other hand, because threads in a group all use the same memory space, if one of them corrupts the contents of its memory, other threads might suffer as well. With processes, the operating system normally protects processes from one another, and thus if one corrupts its own memory space, other processes won’t suffer. Another advantage of using processes is that they can run on different machines, while all the threads have to run on the same machine (at least normally).

Synopsys:

FTP based Client Server project using sockets and threads

??Sockets are the fundamental technology for programming software to communicate on TCP/IP networks. A socket provides a bidirectional communication endpoint for sending and receiving data with another socket. Socket connections normally run between two different computers on a LAN or across the Internet, but they can also be used for inter-process communication on a single computer.
It involves the use of Socket Programming. Client creates a local TCP socket specifying the IP and port ?number of server process , the client’s TCP establishes connection to server’s TCP. When contacted by a client, server creates a new socket for server process to communicate with client. Client sends a request to the Server and then  Server responds to the client . Data Transmission is over TCP/ IP protocol. Data exchanging protocol is build by creating our own network protocol stack over the socket stack.

Objective:

  • This project is designed to ensure that students of Engineering College with academic capabilities will have the skill set needed to deal with the challenges involved in real-world linux system programming and network programming and associated protocols / technologies to meet the needs of industries both today and in the future.
  • The course considers linux based network programming and communication techni
Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

tcp/ip protocol project imlement using socket

head    1.1;
access;
symbols;
locks
root:1.1; strict;
comment    @ * @;

1.1
date    2014.06.17.10.36.05;    author root;    state Exp;
branches;
next    ;

desc
@creat reqclient for socket.
@

1.1
log
@Initial revision
@head    1.1;
access;
symbols;
locks
root:1.1; strict;
comment    @ * @;

1.1
date    2014.06.17.10.34.40;    author root;    state Exp;
branches;
next    ;

desc
@server for socket impl.
@

1.1
log
@Initial revision
@
text

head    1.1;
access;
symbols;
locks
root:1.1; strict;
comment    @ * @;

1.1
date    2014.06.17.10.37.39;    author root;    state Exp;
branches;
next    ;

desc
@creat processing client for socket.
@

1.1
log
@Initial revision
@

Posted in Uncategorized | Leave a comment

FTP based Client Server project using sockets and threads

Sockets are the fundamental technology for programming software to communicate on TCP/IP networks. A socket provides a bidirectional communication endpoint for sending and receiving data with another socket. Socket connections normally run between two different computers on a LAN or across the Internet, but they can also be used for inter-process communication on a single computer.

It involves the use of Socket Programming. Client creates a local TCP socket specifying the IP and port ?number of server process , the client’s TCP establishes connection to server’s TCP. When contacted by a client, server creates a new socket for server process to communicate with client. Client sends a request to the Server and then  Server responds to the client . Data Transmission is over TCP/ IP protocol. Data exchanging protocol is build by creating our own network protocol stack over the socket stack.
Posted in Uncategorized | Leave a comment

what is the difference between sign that we include in headers and “headers.h”??????

sign denotes the path of that header file.
“header.h” includes the path of current directory in which various directories are placed.

Posted in Uncategorized | Leave a comment

IMPLEMENTATION OF IPC WITH SOCKETS

RCS file: server.c,v
Working file: server.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
successfully implemented socket programming.
this is server,in which we create two sockets.
one for requesting client and other for processing client.
socket domain we are using is AF_INET.
—————————-
revision 1.1 locked by: root;
date: 2014/06/16 13:07:28; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: client1.c,v
Working file: client1.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
this is requesting client.
connect call is used in this to connect with server.
—————————-
revision 1.1 locked by: root;
date: 2014/06/16 13:12:57; author: root; state: Exp;
Initial revision
=============================================================================
RCS file: proc1.c,v
Working file: proc1.c
head: 1.1
branch:
locks: strict
client1: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1; selected revisions: 1
description:
this is processing client.
connect call is used to connect with server with different port numberr.
—————————-
revision 1.1 locked by: client1;
date: 2014/06/16 13:17:20; author: client1; state: Exp;
Initial revision
=============================================================================

Posted in Uncategorized | Leave a comment

client server programme using socket

#include
#include
//#include
#include
#include
int main()
{
int sockfd,true,aret,bret;
char ch[5];
struct sockaddr_in server_add,client_add;
socklen_t len;

server_add.sin_family = AF_INET;
server_add.sin_port=htons(7770);
server_add.sin_addr.s_addr = inet_addr(“127.0.0.1″);
if(setsockopt(sockfd,SOL_SOCKET,SO_REUSEADDR,&true,sizeof(int))==-1)
{
sockfd = socket(AF_INET,SOCK_STREAM,0);
if(sockfd==-1)
{
printf(“fail in openning socket”);
}
}

printf(“sockfd =%d\n”,sockfd);

bret = bind(sockfd,(struct sockaddr *)&server_add,sizeof(struct sockaddr));
printf(“bind return %d\n”,bret);
if(bret==-1)
{
printf(“error in binding”);
}

listen(sockfd,3);

len = sizeof(client_add);
//printf(“len %d\n”,*len);
aret = accept(sockfd,(struct sockaddr *)&client_add,&len);
printf(“accept return %d\n”,aret);
read(aret,ch,5);
printf(“SERVER:%s\n”,ch);
return 0;
}

Posted in Uncategorized | Leave a comment

code to pass more than one number of variables into a thread by parent thread

snap

Posted in Project 04: FTP based Client Server using Threads and Sockets | Leave a comment

character driver till ioctl.

This is rcs file of init function where this function helps in initialisation of our driver and

file operations .

file operations which are used further to mapped various function to the kernel mode function.

similarly there is open function , read function ,lseek function , ioctl function .

(these all are different from generic open ,read function).

 

 

RCS file: init.c,v
Working file: init.c
head: 1.58
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 58;    selected revisions: 58
description:
inserting our msg in kernel table list.
—————————-
revision 1.58
date: 2014/06/15 08:00:09;  author: root;  state: Exp;  lines: +8 -1
mapped ioctl function with unlocked ioctl in file operations .
used module param for taking the device size and quantum_size through command line argument i.e argument during run time .
—————————-
revision 1.57
date: 2014/06/13 11:20:08;  author: root;  state: Exp;  lines: +3 -2
*** empty log message ***
—————————-
revision 1.56
date: 2014/05/27 09:12:07;  author: root;  state: Exp;  lines: +3 -1
fileoperations updated .
added function for llseek.
nd mapped with that function.
—————————-
revision 1.55
date: 2014/05/19 07:23:22;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.54
date: 2014/05/18 19:38:37;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.53
date: 2014/05/15 15:31:37;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
—————————-
revision 1.52
date: 2014/05/15 09:09:59;  author: root;  state: Exp;  lines: +0 -1
*** empty log message ***
—————————-
revision 1.51
date: 2014/05/15 09:08:24;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
—————————-
revision 1.50
date: 2014/05/15 08:28:40;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
—————————-
revision 1.49
date: 2014/05/11 08:55:50;  author: root;  state: Exp;  lines: +0 -1
*** empty log message ***
—————————-
revision 1.48
date: 2014/05/11 08:51:00;  author: root;  state: Exp;  lines: +2 -2
added open nd close function nd mapped with generic call function
—————————-
revision 1.47
date: 2014/05/11 08:15:27;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.46
date: 2014/05/11 08:14:01;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.45
date: 2014/05/11 08:13:07;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.44
date: 2014/05/11 08:11:01;  author: root;  state: Exp;  lines: +4 -5
just checking if the mapping of fops is done correctly or not.
by checking the value it from dev of cdev.
—————————-
revision 1.43
date: 2014/05/09 10:41:03;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.42
date: 2014/05/09 09:29:46;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.41
date: 2014/05/09 06:52:11;  author: root;  state: Exp;  lines: +0 -1
*** empty log message ***
—————————-
revision 1.40
date: 2014/05/09 06:51:16;  author: root;  state: Exp;  lines: +8 -10
*** empty log message ***
—————————-
revision 1.39
date: 2014/05/07 13:16:58;  author: root;  state: Exp;  lines: +4 -4
solved the syntax errors.
—————————-
revision 1.38
date: 2014/05/07 12:56:32;  author: root;  state: Exp;  lines: +10 -2
defined the structure for sculldev
defined the structure scull c_dev .
used cdev_init to make internally mapping…just it initliase the cdev_ onto kernel
—————————-
revision 1.37
date: 2014/05/05 14:55:51;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.36
date: 2014/05/05 14:54:53;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.35
date: 2014/05/05 14:52:44;  author: root;  state: Exp;  lines: +1 -0
printing the size of structure that we have already allocated for cdev in scull dev
—————————-
revision 1.34
date: 2014/05/05 10:07:36;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.33
date: 2014/05/05 09:40:43;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.32
date: 2014/05/05 09:37:55;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.31
date: 2014/05/05 09:36:40;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.30
date: 2014/05/05 09:33:52;  author: root;  state: Exp;  lines: +2 -0
assigned the memory for struct scull .
further it can hold the memory for virtual devices.
—————————-
revision 1.29
date: 2014/05/04 09:37:28;  author: root;  state: Exp;  lines: +1 -1
moved the position of dev1
—————————-
revision 1.28
date: 2014/05/04 09:35:27;  author: root;  state: Exp;  lines: +6 -4
*** empty log message ***
—————————-
revision 1.27
date: 2014/05/04 09:24:48;  author: root;  state: Exp;  lines: +1 -1
changed the value of i so that no repititon ocur
occur
—————————-
revision 1.26
date: 2014/05/04 09:19:16;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.25
date: 2014/05/04 09:17:53;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.24
date: 2014/05/04 09:16:27;  author: root;  state: Exp;  lines: +4 -2
*** empty log message ***
—————————-
revision 1.23
date: 2014/05/04 08:56:59;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
—————————-
revision 1.22
date: 2014/05/04 08:54:17;  author: root;  state: Exp;  lines: +1 -0
defined header file
—————————-
revision 1.21
date: 2014/05/04 08:47:22;  author: root;  state: Exp;  lines: +1 -1
warning problem solved
/
—————————-
revision 1.20
date: 2014/05/04 08:45:10;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.19
date: 2014/05/04 08:37:38;  author: root;  state: Exp;  lines: +1 -0
created n no. of arrays ….basicallly n no. of nodes that will linked to one driver.
—————————-
revision 1.18
date: 2014/05/04 08:16:36;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.17
date: 2014/05/04 07:58:45;  author: root;  state: Exp;  lines: +1 -0
*** empty log message ***
—————————-
revision 1.16
date: 2014/05/04 07:56:26;  author: root;  state: Exp;  lines: +4 -2
taking nod value 3
—————————-
revision 1.15
date: 2014/05/04 07:05:22;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.14
date: 2014/05/04 07:03:20;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.13
date: 2014/05/04 06:56:04;  author: root;  state: Exp;  lines: +4 -1
now giving a nod no. using command line argument
using module_param
—————————-
revision 1.12
date: 2014/05/04 06:44:42;  author: root;  state: Exp;  lines: +1 -2
registerd the driver.
nd its working
—————————-
revision 1.11
date: 2014/05/04 06:32:03;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
—————————-
revision 1.10
date: 2014/05/03 17:18:29;  author: root;  state: Exp;  lines: +7 -6
updated included #ifdef
..
—————————-
revision 1.9
date: 2014/04/30 14:07:00;  author: root;  state: Exp;  lines: +5 -4
removed def micro
—————————-
revision 1.8
date: 2014/04/30 08:07:57;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.7
date: 2014/04/29 17:33:46;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
—————————-
revision 1.6
date: 2014/04/29 17:04:29;  author: root;  state: Exp;  lines: +17 -0
new character driver can be  allocated in kernel using alloc_chrdev_region();

nd same we allocated our own driver .
—————————-
revision 1.5
date: 2014/04/28 15:04:01;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.4
date: 2014/04/28 14:59:33;  author: root;  state: Exp;  lines: +0 -19
just checking , is mesg get printed in kernel table or not!
—————————-
revision 1.3
date: 2014/04/28 08:25:55;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.2
date: 2014/04/28 08:20:38;  author: root;  state: Exp;  lines: +1 -1
upadated
—————————-
revision 1.1
date: 2014/04/28 08:14:39;  author: root;  state: Exp;
Initial revision
===========================================================================

Posted in Uncategorized | Leave a comment