EmbLogic's Blog

Write a Program for quadric equation?

code:

#include<stdio.h>
#include<math.h>
int main()
{
int a,b,c,d,e,f;
float s,g,h,r1,r2;
printf(“Enter constant:”);
scanf(“%d%d%d”,&a,&b,&c);
d=(b*b-4*a*c);
if(a==0 && b==0)
{
printf(“There is no solution\n”);
}
else if(a==0)
{
e=-c/b;
printf(“There is only one root:%d\n”,e);
}
else if(d<1)
{
printf(“Roots are complex\n”);
f=abs(d);
s=sqrt(f);
printf(“root1=%d+j%f\n”,-b/(2*a),s/(2*a));
printf(“root2=%d-j%f\n”,-b/(2*a),s/(2*a));
}
else if(d>1)
{
printf(“d=%d\n”,d);
s=sqrt(d);
printf(“s=%f\n”,s);
g=(-b+s)/(2*a);
h=(-b-s)/(2*a);
printf(“root1=%f\n”,g);
printf(“root2=%f\n”,h);

}
return 0;
}

Posted in Data Structures with C | Leave a comment

Using dd command to Convert a file

dd—Convert a file while copying it (data dumper)

Syntax:

dd [—help] [—version] [if=file] [of=file] [ibs=bytes] [obs=bytes] [bs=bytes]
[cbs=bytes] [skip=blocks] [seek=blocks] [count=blocks] [conv={ascii,
ebcdic, ibm, block, unblock, lcase, ucase, swab, noerror, notrunc, sync}]

DESCRIPTION:

The GNU version of dd copies a file (from the standard input to the standard output, by default) with a user-selectable blocksize, while optionally performing conversions on it.

OPTIONS:

Numbers can be followed by a multiplier:
b=512, c=1, k=1024, w=2, xm=number m

These options are available:
—help Print a usage message on standard output and exit successfully.
—version Print version information on standard output then exit successfully.
if=file Read from file instead of the standard input.
of=file Write to file instead of the standard output. Unless conv=notrunc is given, truncate
file to the size specified by seek= (0 bytes if seek= is not given).
ibs=bytes Read bytes bytes at a time.
obs=bytes Write bytes bytes at a time.
bs=bytes Read and write bytes bytes at a time. Override ibs and obs.

cbs=bytes Convert bytes bytes at a time.
skip=blocks Skip blocks ibs-sized blocks at start of input.
seek=blocks Skip blocks obs-sized blocks at start of output.
count=blocks Copy only blocks ibs-sized input blocks.
conv=conversion[,conversion...] Convert the file as specified by the conversion arguments.

Conversions:

ascii Convert EBCDIC to ASCII.
ebcdic Convert ASCII to EBCDIC.
ibm Convert ASCII to alternate EBCDIC.
block Pad newline-terminated records to size of cbs, replacing newline with trailing spaces.
unblock Replace trailing spaces in cbs-sized block with newline.
lcase Change uppercase characters to lowercase.
ucase Change lowercase characters to uppercase.
swab Swap every pair of input bytes. Unlike the UNIX dd, this works when an odd
number of bytes are read. If the input file contains an odd number of bytes, the last
byte is simply copied (since there is nothing to swap it with).
noerror Continue after read errors.
notrunc Do not truncate the output file.
sync Pad every input block to size of ibs with trailing NULLs.

Posted in Project 1: A Linux Administration based Project, Project 2: Multiple Data Compression and Encryption, Uncategorized | Leave a comment

Write a program to concatenate two string?

CODE :
#include<stdio.h>
#include<stdlib.h>
int main()
{
char *str1,*str2;
int i,j,k,m=0,o;
str1=(char *)malloc(sizeof(char));
str2=(char *)malloc(sizeof(char));
printf(“Enter String1:”);
gets(str1);
printf(“Enter String2:”);
gets(str2);
for(i=0;str1[i]!=”;i++)
{
printf(“String[%d]=%c\n”,i,*(str1+i));
}
for(j=0;str2[j]!=”;j++)
{
printf(“String[%d]=%c\n”,j,*(str2+j));
}
printf(“string1: %s i is %d\n”,str1,i);
printf(“string2: %s j is %d\n”,str2,j);
o=i+j;
for(k=i;k<o;k++)
{
*(str1+k)=*(str2+m);
m++;
}
printf(“Concatetinated String:%s\n”,str1);
return 0;
}

Posted in Data Structures with C | Leave a comment

Write a program to reverse the Array?

CODE:

#include<stdio.h>
#include<stdlib.h>
int main()
{
int n,temp,i,j;
printf(“Enter size of Array\n”);
scanf(“%d”,&n);
int a[n];
printf(“Enter Elements \n”);
for(i=0;i<n;i++)
{
scanf(“%d”,&a[i]);
}
printf(“Elements Are:\n”);
for(i=0;i<n;i++)
{
printf(“%d\t”,a[i]);
}
printf(“\n”);
for(i=0,j=n-1;i<=n/2;i++,j–)
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
printf(“Reversed array:\n”);
for(i=0;i<n;i++)
{
printf(“a[%d]=%d\n”,i,a[i]);
}
}

Posted in Data Structures with C | Leave a comment

character driver(Hello kernel)

RCS file: exit_p.c,v
Working file: exit_p.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
file contain init_exit module and function.
—————————-
revision 1.1    locked by: root;
date: 2016/03/10 17:09:14;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this having all header files used in program.
init.h kernel.h module.h.
—————————-
revision 1.1
date: 2016/03/10 17:10:03;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: init_p.c,v
Working file: init_p.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
file having module_init and its function.
—————————-
revision 1.1    locked by: root;
date: 2016/03/10 17:11:49;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: exit_p.c,v
Working file: exit_p.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
file contain init_exit module and function.
—————————-
revision 1.1    locked by: root;
date: 2016/03/10 17:09:14;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
this having all header files used in program.
init.h kernel.h module.h.
—————————-
revision 1.1    locked by: root;
date: 2016/03/10 17:10:03;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: init_p.c,v
Working file: init_p.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
file having module_init and its function.
—————————-
revision 1.1    locked by: root;
date: 2016/03/10 17:11:49;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: exit_p.c,v
Working file: exit_p.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
file contain init_exit module and function.
—————————-
revision 1.1    locked by: root;
date: 2016/03/10 17:09:14;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
this having all header files used in program.
init.h kernel.h module.h.
—————————-
revision 1.2    locked by: root;
date: 2016/03/10 17:15:45;  author: root;  state: Exp;  lines: +4 -0
using the MODULE LICENSE AUTHOR & DESCRIPTION.
—————————-
revision 1.1
date: 2016/03/10 17:10:03;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: init_p.c,v
Working file: init_p.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
file having module_init and its function.
—————————-
revision 1.1    locked by: root;
date: 2016/03/10 17:11:49;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: exit_p.c,v
Working file: exit_p.c
head: 1.1
branch:
locks: strict
root: 1.1
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;    selected revisions: 1
description:
file contain init_exit module and function.
—————————-
revision 1.1    locked by: root;
date: 2016/03/10 17:09:14;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: header.h,v
Working file: header.h
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
this having all header files used in program.
init.h kernel.h module.h.
—————————-
revision 1.2    locked by: root;
date: 2016/03/10 17:15:45;  author: root;  state: Exp;  lines: +4 -0
using the MODULE LICENSE AUTHOR & DESCRIPTION.
—————————-
revision 1.1
date: 2016/03/10 17:10:03;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: init_p.c,v
Working file: init_p.c
head: 1.2
branch:
locks: strict
root: 1.2
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;    selected revisions: 2
description:
file having module_init and its function.
—————————-
revision 1.2    locked by: root;
date: 2016/03/10 17:18:11;  author: root;  state: Exp;  lines: +1 -1
KERN_INFO flag in printk().
—————————-
revision 1.1
date: 2016/03/10 17:11:49;  author: root;  state: Exp;
Initial revision
=============================================================================

Posted in Device Drivers | Leave a comment

Write a program to Transpose the Matrix?

#include<stdio.h>
#include<stdlib.h>
int main()
{
int r,c,i,j,a[10][10],t[10][10];
printf(“Enter Max Size\n”);
scanf(“%d”,&r);
printf(“Enter Column\n”);
scanf(“%d”,&c);
printf(“Enter Element of Matrix1\n”);
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
scanf(“%d”,&a[i][j]);
}
}
printf(“Elements are:\n”);
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
printf(“%d\t”,a[i][j]);
}
printf(“\n”);
}
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
t[j][i]=a[i][j];
}
}
printf(“Transpose of Matrixs\n”);
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
printf(“%d\t”,t[i][j]);
}
printf(“\n”);
}
}

Posted in Data Structures with C | Leave a comment

Character_driver

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

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

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

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

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

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

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

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

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

Posted in Uncategorized | Leave a comment

Single Client Server Communication Using Socket In Using UNIX_AF With Use The Shell Script

RCS file: header.h,v
Working file: header.h
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;     selected revisions: 1
description:
In file all header files included this project related .
—————————-
revision 1.1
date: 2016/02/28 12:03:13;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: request.h,v
Working file: request.h
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;     selected revisions: 1
description:
In file structure declare named socket struct type in member varible are three all varibale char array type in
all array size 10-10 bytes.
—————————-
revision 1.1
date: 2016/02/28 12:29:12;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: request_client.c,v
Working file: request_client.c
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;     selected revisions: 1
description:
In file include a two user defined header file names are header.h and request.h them declare struct socket s3 variable^then call a strcpy function call this help the strings store the in member char array in variable then predefined socke^[[un.h header file in declare a structure named is struct sockaddr_un and in two member varible first is sun_family and second is sun_path and set the value in sun_family in give the domain name is AF_UNIX and then second in give the path is socket socket name is which derectory you want to created give the full path before a struct sockaddr_un type decalre a object
>> then give the assign path then call a socket and in give the argument first domain is AF_UNIX second is type is SOCK_STREAM then give the protocol is NULL because if u give the NULL then second agrument acording put the agrument is bydefsulkt bydefault and if second argument is SOCK_STREAM then put the protocol is TCP/IP then socket is created but unnamed then then call the connect and give the agrument socket fd and then type cast the sockaddr_un to sockaddr * because in seond argumet give the this data * then give then length socklen_t type then write the all structure data give the server in help help of the socket and if any condtions write return a 0 then report the write call .
----------------------------
revision 1.1
date: 2016/02/28 12:30:06;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: server.c,v
Working file: server.c
head: 1.1
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 1;     selected revisions: 1
description:
In file include a two user defined header file names are header.h and request.h them declare struct socket s3 variablethen call a strcpy function call this help the strings store the in member char array in variable then predefined socun.h header file in declare a structure named is struct sockaddr_un and in two member varible first is sun_family and second is sun_path and set the value in sun_family in give the domain name is AF_UNIX and then second in give the path is socket socket name is which derectory you want to created give the full path before a struct sockaddr_un type decalre a object
then give the assign path then call a socket and in give the argument first domain is AF_UNIX second is type is SOCK_STREAM then give the protocol is NULL because if u give the NULL then second agrument acording put the agrument is bydefsulkt bydefault and if second argument is SOCK_STREAM then put the protocol is TCP/IP then socket is created but unnamed then  call the bind in which give the argument in help of socket return fd on then bind is return succfully then call to return
then call to listen in agrumnet socket fd and how many client want a connect to server this listen is make a queue then
call to accept In give the arguement this make duplicate same unnamed socket and return the fd then
read the client data help of the socket and then check the how many succesfully bytes read if any condtion is falied rreturn is 0 then report the write call then if data successfully read then display this .
----------------------------
revision 1.1
date: 2016/02/28 12:04:47;  author: root;  state: Exp;
Initial revision
=============================================================================

SHELL SCRIPT

 

#! /bin/bash

delete()
{
rm -rf request_client
rm -rf server
rm -rf socket
}

edit()
{
read -p "do you want a edit further (y or n)" answer

if [ 'y' = $answer ]
then

for file in $(ls *.h,v)
do
co -l $file
done

for file in $(ls *.c,v)
do
co -l $file
done
delete
exit 0
fi
}

execute()
{
read -p “do you want a compile a project” answer

if [ 'y' = $answer ]
then
if ( gcc -o server  server.c)
then
echo “compile is successfull”
else
echo “compile is failed”
edit
fi

if ( gcc -o request_client request_client.c )
then
echo “compile is sucessfull”
else
echo “compile is failed”
edit
fi

else
edit
fi
read -p “do you want a execute this project” answer

if [ 'y' = $answer ]
then
./server & ./request_client

else
echo “execution is failed”
edit
fi

}

logfile()
{
read -p “do you want a run a logfile” answer

if [ 'y' = $answer ]
then
chmod +x rlog.sh
./rlog.sh
fi
}

for file in $(ls *.h)
do
ci $file
done

for file in $(ls *.c)
do
ci $file
done

for file in $(ls *.h,v)
do
co $file
done
for file in $(ls *.c,v)
do
co $file
done
execute
logfile
edit

logfile creted in shell script

#! /bin/bash

read -p “do you want a delete old file” answer

if [ 'y' = $answer ]
then
if [ -f logfile ]
then
rm -rf logfile
touch logfile
else
echo “logfile is not found”
fi
fi

read -p “do you want a update a logfile” answer

if [ 'y' = $answer ]
then
for file in $(ls *.h,v)
do
rlog $file >> logfile
done

for file in $(ls *.c,v)
do
rlog $file >> logfile
done
fi

Posted in Uncategorized | Leave a comment

Basic program for socket_inet

SERVER

#include<stdio.h>
#include<stdlib.h>
#include<linux/types.h>
#include<linux/socket.h>
#include<sys/un.h>
#include<netinet/in.h>
int main(int argc,char *argv[])
{
int sfd,s_len,b,a,l,nfd,c_len,spn;
struct sockaddr_in addr;
struct sockaddr_in c_addr;
sfd = socket(AF_INET,SOCK_STREAM,0);
spn = atoi(argv[1]);//for command line arrguments
//int socket(int domain, int type, int protocol);3rd arrguments 0 for defalut 1 for udp and 2 for tcp;
if(sfd == -1)
{
perror(“Error due the sfd\n”);
exit(EXIT_FAILURE);
}
printf(“Print the socket fd–>>%d\n”,sfd);
addr.sin_family = AF_INET;
addr.sin_port = htons(spn);
addr.sin_addr.s_addr=htonl(INADDR_ANY);//chack man 7 ip
s_len = sizeof(addr);
b = bind(sfd, (struct sockaddr*)&addr,s_len);
//int bind(int sockfd, const struct sockaddr *addr,socklen_t addrlen);
if(b == -1)
{
perror(“Error due the bind call\n”);
exit(EXIT_FAILURE);
}
listen(sfd,6);
//int listen(int sockfd, int backlog); 2nd arrguments is depth of queue.
if(sfd == -1)
{
perror(“Error due the slisten call\n”);
exit(EXIT_FAILURE);
}
char ch[20];
c_len = sizeof(c_addr);
nfd = accept(sfd,(struct sockaddr*)&c_addr,&c_len);
printf(“hellow\n”);
// int accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen);
if(a == -1)
{
perror(“Error due the accept call fail\n”);
exit(EXIT_FAILURE);
}
while(1)
{
read(nfd,&ch,20);
// ssize_t read(int fd, void *buf, size_t count);
printf(“Print the client word–>>%s\n”,ch);
}
close(nfd);
return 0;
}

CLIENT

int main(int argc,char *argv[])
9 {
10 int cfd,c_len,c,pn;
11 char ch[20];
12 pn = atoi(argv[2]);
13 struct sockaddr_in c_addr;
14 cfd = socket(AF_INET,SOCK_STREAM,0);
15 printf(“Print the cfd value —>>%d\n”,cfd);
16 if(cfd == -1)
17 {
18 perror(“Error due the socket call\n”);
19 exit(EXIT_FAILURE);
20 }
21 c_addr.sin_family = AF_INET;
22 c_addr.sin_port = htons(pn);
23 c_addr.sin_addr.s_addr =inet_addr(argv[1]);
24 c_len = sizeof(c_addr);
25 c = connect(cfd,(struct sockaddr*)&c_addr,c_len);
26 if(c == -1)
27 {
28 perror(“Error due the connect call fail\n”);
29 exit(EXIT_FAILURE);
30 }
31 while(1)
32 {
33 scanf(“%s”,ch);
34 write(cfd,&ch,20);
35 }
36 return 0;
37 }

Posted in Uncategorized | Leave a comment

Basic_program of socket

server_program

int main()
9 {
10 int s_sockfd,c_sockfd;
11 int c_len,s_len,s_result;
12 struct sockaddr_un s_address;
13 struct sockaddr_un c_address;
14 unlink(“emblogic”);
15 s_sockfd = socket(AF_UNIX,SOCK_STREAM,0);
16 printf(“Print the s_sockfd %d\n”,s_sockfd);
17 if(s_sockfd == -1)
18 {
19 perror(“Error due to fd\n”);
20 exit(EXIT_FAILURE);
21 }
22 s_address.sun_family = AF_UNIX;
23 strcpy(s_address.sun_path,”emblogic”);
24 s_len = sizeof(s_address);
25 bind(s_sockfd,(struct sockaddr*)&s_address,s_len);
26 listen(s_sockfd,5);
27 while(1)
28 {
29 char ch;
30 printf(“Server is waiting\n”);
31 c_len = sizeof(c_address);
32 c_sockfd = accept(s_sockfd,(struct sockaddr*)&c_address,&c_len);
33 if(c_sockfd == -1)
34 {
35 perror(“Error due the accept call\n”);
36 exit(EXIT_FAILURE);
37 }
38 read(c_sockfd,&ch,1);
39 printf(“Print the value of ch–>>%c\n”,ch);
40 ch++;
41 write(c_sockfd,&ch,1);
42 close(c_sockfd);
43 }
44 return 0;
45 }

client_program

1 #include<stdio.h>
2 #include<stdlib.h>
3 #include<string.h>
4 #include<sys/types.h>
5 #include<unistd.h>
6 #include<sys/un.h>
7 #include<sys/socket.h>
8 int main()
9 {
10 int sockfd;
11 int len,result;
12 struct sockaddr_un address;
13 char ch = ‘A’;
14 sockfd = socket(AF_UNIX,SOCK_STREAM,0);
15 printf(“Print the client sockfd–>>>%d\n”,sockfd);
16 if(sockfd < 0)
17 {
18 perror(“Error due the sockfd\n”);
19 exit(EXIT_FAILURE);
20 }
21 address.sun_family = AF_UNIX;
22 strcpy(address.sun_path,”emblogic”);
23 len = sizeof(address);
24 result = connect(sockfd,(struct sockaddr*)&address,len);
25 if(result == -1)
26 {
27 perror(“Error due the client1\n”);
28 exit(EXIT_FAILURE);
29 }
30 write(sockfd,&ch,1);
31 read(sockfd,&ch,1);
32 printf(“Char in server=%c\n”,ch);
33 close(sockfd);
34 return 0;
35 }
~

 

 

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

Single Client Server And Single Thread Communication Using FIFO With Use The Shell Script

RCS file: header.h,v
Working file: header.h
head: 1.15
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 15;    selected revisions: 15
description:
In file all include header files related this project.
—————————-
revision 1.15
date: 2016/02/25 06:18:43;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.14
date: 2016/02/25 06:15:12;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.13
date: 2016/02/24 09:13:23;  author: root;  state: Exp;  lines: +1 -0
In file include a semaphore.h header files .
—————————-
revision 1.12
date: 2016/02/24 08:44:38;  author: root;  state: Exp;  lines: +0 -1
In file remove a prototype second thread hendler function
—————————-
revision 1.11
date: 2016/02/23 16:38:46;  author: root;  state: Exp;  lines: +1 -0
In file decalre a prototypes another handler function this handler in server in handler function return type void.
—————————-
revision 1.10
date: 2016/02/23 11:41:03;  author: root;  state: Exp;  lines: +2 -1
In file declare a prototypes of signal handler is return type is chany void not a void .
void *.
—————————-
revision 1.9
date: 2016/02/23 11:39:06;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.8
date: 2016/02/23 10:30:18;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.7
date: 2016/02/23 10:28:18;  author: root;  state: Exp;  lines: +1 -0
In file now include a signal.h header file before declare a prototype signal handler functions.
—————————-
revision 1.6
date: 2016/02/23 10:18:53;  author: root;  state: Exp;  lines: +1 -0
In file include a new a header file signal.h
—————————-
revision 1.5
date: 2016/02/21 08:40:55;  author: root;  state: Exp;  lines: +1 -1
In file check how working
—————————-
revision 1.4
date: 2016/02/21 08:08:10;  author: root;  state: Exp;  lines: +1 -1
In file decalre a prototypes in will agrument pass in thread is type void *
—————————-
revision 1.3
date: 2016/02/21 07:49:17;  author: root;  state: Exp;  lines: +2 -0
In file decalre a prototypes of processing client thread .
—————————-
revision 1.2
date: 2016/02/20 05:54:00;  author: root;  state: Exp;  lines: +3 -0
In file include a header files.
—————————-
revision 1.1
date: 2016/02/20 05:33:07;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: request.h,v
Working file: request.h
head: 1.2
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 2;     selected revisions: 2
description:
In file assgin a data in structure then open a fifo in write only mode then write the data .
—————————-
revision 1.2
date: 2016/02/23 10:19:14;  author: root;  state: Exp;  lines: +1 -0
In file in structure member decalre a pid variable in int type.
—————————-
revision 1.1
date: 2016/02/20 05:34:10;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: processing_client.c,v
Working file: processing_client.c
head: 1.30
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 30;    selected revisions: 30
description:
In file this is processing client thread this call from the server in file return and pasing argument is void *
then decalre a struct operations type a variable then open a fifo in read only mode then read the data all.
—————————-
revision 1.30
date: 2016/02/25 06:27:07;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
—————————-
revision 1.18
date: 2016/02/24 11:00:55;  author: root;  state: Exp;  lines: +11 -1
In fioe        fd=open(“fifo”,O_RDONLY);

In file calling a sem_wait and sem_post and display this values.
—————————-
revision 1.17
date: 2016/02/24 09:59:46;  author: root;  state: Exp;  lines: +1 -2
*** empty log message ***
—————————-
revision 1.16
date: 2016/02/24 09:28:27;  author: root;  state: Exp;  lines: +2 -0
In file this thread starting call to the sem_wait beacuse now this thread for read for the working and any another
thread don’t interupted so then this thread complete the work then call to the sem_post beacuse this thread works are complted and out of critical section this thread .
—————————-
revision 1.15
date: 2016/02/24 09:17:08;  author: root;  state: Exp;  lines: +1 -1
In file removes a sum bugs.
—————————-
revision 1.14
date: 2016/02/24 09:16:27;  author: root;  state: Exp;  lines: +0 -1
*** empty log message ***
—————————-
revision 1.13
date: 2016/02/24 09:15:13;  author: root;  state: Exp;  lines: +2 -2
In file decalre a properly sem
sem_t type sem2 variable .
—————————-
revision 1.12
date: 2016/02/24 08:45:16;  author: root;  state: Exp;  lines: +5 -3
In file fretch a semaphore a variable void * type then this variable type cast in sem_init type and before signals methmethod are falied in thread because thread to main thread don’t send a signals always because thread id we do not can find
in main_thread so that reason is falied
—————————-
revision 1.11
date: 2016/02/23 16:44:20;  author: root;  state: Exp;  lines: +1 -0
decalre a pthread_t type id variable
—————————-
revision 1.10
date: 2016/02/23 16:39:52;  author: root;  state: Exp;  lines: +4 -1
In file frecth the value in thread id void * type then type cast of pthread_id data type then pthread_kill using the
SIGINT signal send the the main thread .
—————————-
revision 1.9
date: 2016/02/21 09:48:10;  author: root;  state: Exp;  lines: +1 -1
In file some corrections in code.
—————————-
revision 1.8
date: 2016/02/21 09:42:17;  author: root;  state: Exp;  lines: +7 -1
In file a get a data then solve the result means two variable add and in store a result variable then open a fifo
in write only mode then write the result.
—————————-
revision 1.7
date: 2016/02/21 09:18:11;  author: root;  state: Exp;  lines: +3 -3
In file remvoe the sleep in 3 second
—————————-
revision 1.6
date: 2016/02/21 08:41:18;  author: root;  state: Exp;  lines: +2 -2
In file pass a argument in a void * variable
—————————-
revision 1.5
date: 2016/02/21 08:29:01;  author: root;  state: Exp;  lines: +3 -0
*** empty log message ***
—————————-
revision 1.4
date: 2016/02/21 08:15:14;  author: root;  state: Exp;  lines: +1 -1
In file frecth a agrument is void * c
—————————-
revision 1.3
date: 2016/02/21 08:14:13;  author: root;  state: Exp;  lines: +2 -1
*** empty log message ***
—————————-
revision 1.2
date: 2016/02/21 08:08:58;  author: root;  state: Exp;  lines: +1 -1
In file fretch the argument thread_id varable void *
—————————-
revision 1.1
date: 2016/02/21 07:40:25;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: request_client.c,v
Working file: request_client.c
head: 1.13
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 13;    selected revisions: 13
description:
In file assgin a data in structure then open a fifo in write only mode then write the data .
—————————-
revision 1.13
date: 2016/02/23 11:42:19;  author: root;  state: Exp;  lines: +1 -1
In file signal handler change a return type only void not a void *.
—————————-
revision 1.12
date: 2016/02/23 11:39:07;  author: root;  state: Exp;  lines: +2 -2
*** empty log message ***
—————————-
revision 1.11
date: 2016/02/23 10:23:23;  author: root;  state: Exp;  lines: +16 -4
In file make a signal handler names functions in file top and in which file calling to that functions and then add a
pause() and when SIGINT signal is genrate then calling to signal handler functions and sleep is removes in file .
—————————-
revision 1.10
date: 2016/02/21 11:34:30;  author: root;  state: Exp;  lines: +1 -0
In file check how working.
—————————-
revision 1.9
date: 2016/02/21 11:24:56;  author: root;  state: Exp;  lines: +2 -1
In file calling to sleep.
—————————-
revision 1.8
date: 2016/02/21 11:23:55;  author: root;  state: Exp;  lines: +2 -2
In file some removes a bugs .
—————————-
revision 1.7
date: 2016/02/21 11:23:10;  author: root;  state: Exp;  lines: +2 -2
In file decarle a result variable .
—————————-
revision 1.6
date: 2016/02/21 11:09:51;  author: root;  state: Exp;  lines: +17 -0
In file open a fifo in read only mode if fd is negative then call to open then read a result if read is failed then
report to read then display the result.
—————————-
revision 1.5
date: 2016/02/20 17:45:12;  author: root;  state: Exp;  lines: +1 -1
In file add a count varable how many bytes write a request_client in fifo then return a count any case count falied then then report it.
—————————-
revision 1.4
date: 2016/02/20 13:17:05;  author: root;  state: Exp;  lines: +1 -0
In file decalre a fd,count variables.
—————————-
revision 1.3
date: 2016/02/20 13:16:15;  author: root;  state: Exp;  lines: +3 -3
In file some removes a bugs
—————————-
revision 1.2
date: 2016/02/20 13:14:12;  author: root;  state: Exp;  lines: +1 -1
In file included request.h file corrections the speling mistake .
—————————-
revision 1.1
date: 2016/02/20 05:34:55;  author: root;  state: Exp;
Initial revision
=============================================================================

RCS file: server.c,v
Working file: server.c
head: 1.43
branch:
locks: strict
access list:
symbolic names:
keyword substitution: kv
total revisions: 43;    selected revisions: 43
description:
In file decalre a structure variable then check if user allow a permissions then create a fifo then read  a structure
then display a structure .
—————————-
revision 1.43
date: 2016/02/25 08:28:56;  author: root;  state: Exp;  lines: +1 -1
In file create a thread semaphore in semaphore a some eshu then resolve this .
—————————-
revision 1.42
date: 2016/02/25 06:25:03;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.41
date: 2016/02/25 06:22:47;  author: root;  state: Exp;  lines: +3 -3
*** empty log message ***
—————————-
revision 1.40
date: 2016/02/25 06:15:14;  author: root;  state: Exp;  lines: +0 -1
*** empty log message ***
—————————-
revision 1.39
date: 2016/02/25 06:13:16;  author: root;  state: Exp;  lines: +2 -5
*** empty log message ***
—————————-
revision 1.38
date: 2016/02/25 05:58:10;  author: root;  state: Exp;  lines: +0 -1
*** empty log message ***
revision 1.37
date: 2016/02/25 05:52:27;  author: root;  state: Exp;  lines: +25 -30
*** empty log message ***
—————————-
revision 1.36
date: 2016/02/24 12:36:19;  author: root;  state: Exp;  lines: +3 -4
*** empty log message ***
—————————-
revision 1.35
date: 2016/02/24 12:30:26;  author: root;  state: Exp;  lines: +44 -39
In file add a some if conditions.
—————————-
revision 1.34
date: 2016/02/24 11:36:48;  author: root;  state: Exp;  lines: +6 -1
*** empty log message ***
—————————-
revision 1.33
date: 2016/02/24 11:04:45;  author: root;  state: Exp;  lines: +10 -4
In file calling a sem_wait and sem_post in 6 times and display the 6 times.
.\
—————————-
revision 1.32
date: 2016/02/24 10:30:02;  author: root;  state: Exp;  lines: +3 -1
*** empty log message ***
—————————-
revision 1.31
date: 2016/02/24 10:08:40;  author: root;  state: Exp;  lines: +2 -5
*** empty log message ***
—————————-
revision 1.30
date: 2016/02/24 10:04:01;  author: root;  state: Exp;  lines: +9 -7
*** empty log message ***
—————————-
revision 1.29
date: 2016/02/24 09:59:50;  author: root;  state: Exp;  lines: +6 -3
*** empty log message ***
—————————-
revision 1.28
date: 2016/02/24 09:31:47;  author: root;  state: Exp;  lines: +3 -2
In file create thread before call to the sem_wait thread beacuse this thread is working of ready any other thread din’t interupted then write a data and then call to sem_post beasue this work is complted this main_thread out of critical
sections.
—————————-
revision 1.27
date: 2016/02/24 09:14:06;  author: root;  state: Exp;  lines: +1 -1
In file remove a some errors.
—————————-
revision 1.26
date: 2016/02/24 08:52:01;  author: root;  state: Exp;  lines: +15 -15
In file create a thread semhaphore a and then add a condtions if any cases falied a so return -1 or any negative value
and report the sem_init then add a sem_wait beause In critial section in thread then thread sem_post call then move
and critical section  in main thread
—————————-
revision 1.25
date: 2016/02/23 16:41:47;  author: root;  state: Exp;  lines: +9 -13
In file sleep(3) is system call removes and this replace a in pause and make a signal handler SIGINT signal and this
handler function calling the in server means main thread .
—————————-
revision 1.24
date: 2016/02/23 11:29:29;  author: root;  state: Exp;  lines: +2 -2
In file just checking
—————————-
revision 1.23
date: 2016/02/23 10:26:22;  author: root;  state: Exp;  lines: +29 -2
Im file send a signal send a SIGINT siganl in request client process .
—————————-
revision 1.22
date: 2016/02/21 11:34:48;  author: root;  state: Exp;  lines: +0 -1
In file check how working..
—————————-
revision 1.21
date: 2016/02/21 11:19:41;  author: root;  state: Exp;  lines: +21 -0
In file get a result then open a fifo in write only mode then if fd is no is negative then report the open and out
then write a result if any condition write is failed then report to write .
—————————-
revision 1.20
date: 2016/02/21 10:52:08;  author: root;  state: Exp;  lines: +2 -3
In file add twos sleep in 2-2 sec .
—————————-
revision 1.19
date: 2016/02/21 09:44:06;  author: root;  state: Exp;  lines: +8 -0
In file open a fifo then read only mode then read a result then display the result in server.
—————————-
revision 1.18
date: 2016/02/21 09:26:33;  author: root;  state: Exp;  lines: +1 -0
In file add a sleep in 2 second .
—————————-
revision 1.17
date: 2016/02/21 09:25:17;  author: root;  state: Exp;  lines: +0 -1
In file sleep is removed
—————————-
revision 1.16
date: 2016/02/21 09:18:30;  author: root;  state: Exp;  lines: +2 -2
In file add a sleep in 3 second .
—————————-
revision 1.15
date: 2016/02/21 08:41:43;  author: root;  state: Exp;  lines: +0 -1
/.
—————————-
revision 1.14
date: 2016/02/21 08:16:40;  author: root;  state: Exp;  lines: +1 -0
In file c is decalre variable.
—————————-
revision 1.13
date: 2016/02/21 08:15:39;  author: root;  state: Exp;  lines: +1 -1
In file pass a agrument in thread c
—————————-
revision 1.12
date: 2016/02/21 08:14:14;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.11
date: 2016/02/21 08:12:39;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.10
date: 2016/02/21 08:09:56;  author: root;  state: Exp;  lines: +1 -1
In file pass the argument in thread calling tym in server and before types to chnge a void * varbale .
—————————-
revision 1.9
date: 2016/02/21 08:04:33;  author: root;  state: Exp;  lines: +1 -1
*** empty log message ***
—————————-
revision 1.8
date: 2016/02/21 08:02:35;  author: root;  state: Exp;  lines: +1 -1
In file put the NULL is some error then type cast is void *
—————————-
revision 1.7
date: 2016/02/21 08:01:09;  author: root;  state: Exp;  lines: +1 -1
In file thread calling in agrument is NULL.
—————————-
revision 1.6
date: 2016/02/21 07:54:08;  author: root;  state: Exp;  lines: +1 -1
In file correction the thread_create to chnge pthread_create and give the thread id is reffrence
—————————-
revision 1.5
date: 2016/02/21 07:49:55;  author: root;  state: Exp;  lines: +2 -2
In file declare a thread_id variable this data type of pthread_t
—————————-
revision 1.4
date: 2016/02/21 07:43:08;  author: root;  state: Exp;  lines: +14 -0
In file firstly create a thread then thread created then open a fifo in write only mode then write a the data in fifo.
—————————-
revision 1.3
date: 2016/02/20 17:58:58;  author: root;  state: Exp;  lines: +2 -2
date: 2016/02/20 17:58:58;  author: root;  state: Exp;  lines: +2 -2
In file server how many read a bytes sucessfully then return a no. of bytes store in count if read is failed then reporreport the read call .
—————————-
revision 1.2
date: 2016/02/20 05:54:11;  author: root;  state: Exp;  lines: +3 -1
In file declare a variables .
—————————-
revision 1.1
date: 2016/02/20 05:35:20;  author: root;  state: Exp;
Initial revision
=============================================================================
(-SHELL SCRIPT-
#! /bin/bash

delete()
{
rm -rf request_client
rm -rf *.o
rm -rf server
}

edit()
{
read -p “do you want a edit further (y or n)” answer

if [ 'y' = $answer ]
then

for file in $(ls *.h,v)
do
co -l $file
done

for file in $(ls *.c,v)
do
co -l $file
done
delete
exit 0
fi

}

execute()
{
read -p “do you want a compile a project” answer

if [ 'y' = $answer ]
then
if ( gcc -c  server.c -lpthread)
then
echo “compile is successfull”
else
echo “compile is failed”
edit
fi

if ( gcc -o request_client request_client.c )
then
echo “compile is sucessfull”
else
echo “compile is failed”
edit
fi

if ( gcc -c processing_client.c -lpthread )
then
echo “compile is sucessfull”
else
echo “compile is failed”
edit
fi
else
edit
fi

read -p “do you want a execute this project” answer

if [ 'y' = $answer ]
then
if (gcc -o server server.o processing_client.o -lpthread)
then
./server & ./request_client -lpthread
else
echo “executeable is failed”
edit
fi
else
edit
fi

}

logfile()
{
read -p “do you want a run a logfile” answer
if [ 'y' = $answer ]
then
chmod +x rlog.sh
./rlog.sh
fi
}

for file in $(ls *.h)
do
ci $file
done

for file in $(ls *.c)
do
ci $file
done

for file in $(ls *.h,v)
do
co $file
done

for file in $(ls *.c,v)
do
co $file
done
execute
logfile
edit

Posted in Project 03: Client Server Communication using Linux and IPC, Shell Scripts | Leave a comment

Installing office in fedora

For 32 bit systems

#wget http://download.documentfoundation.org/libreoffice/stable/5.0.4/rpm/x86/LibreOffice_5.0.4_Linux_x86_rpm.tar.gz

For 64-bit systems

#wget http://download.documentfoundation.org/libreoffice/stable/5.0.4/rpm/x86_64/LibreOffice_5.0.4_Linux_x86-64_rpm.tar.gz

After this  all steps are common

#tar -xvf LibreOffice_5.0.4_Linux_x86_rpm.tar.gz
#cd LibreOffice_5.0.4.2_Linux_x86_rpm/

#yum localinstall RPMS/*.rpm

You can use these steps in any other RPM based distribution but keeping in mind the last step (that command will vary according to the distribution)

Posted in Project 00: Linux System / Network Administration, Uncategorized | Leave a comment

What is Character Driver?

A character device driver is one that transfers data directly to and from a user process.

This is the most common type of device driver and there are plenty of simple examples in the source tree.

Character device drivers may transfer data between a user-level process and the device using any scheme other than the system buffer cache.

Character drivers control devices such as :-

 

——————————————

* network cards

* terminal devices

* printers

* specialized devices such as robots

* medical devices

* retail sales devices.

Posted in Character Driver | Tagged , , , , | Leave a comment

Tool Chain for O-LinuXno A13

Hello ,

Today also i tired download the TOOLCHAIN  HOST – i386 TARGET : arm

STEP 1 : gcc-4.7-arm-linux-gnueabi_4.7.3-12ubuntu1cross1.85_i386.deb on Intel x86 machines

STEP 2 : Once download and get it install in /usr/bin

STEP3 :copy it from  arm-linux-gnueabi-gcc-4.7 to arm-linux-gnueabi-gcc

STEP 4: check the version for support . i found it is for i686 .

arm-linux-gnueabi-gcc  -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/arm-linux-gnueabi/4.7/lto-wrapper
Target: arm-linux-gnueabi
Configured with: ../src/configure -v –with-pkgversion=’Ubuntu/Linaro 4.7.3-12ubuntu1′ –with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs –enable-languages=c,c++,go,fortran,objc,obj-c++ –prefix=/usr –program-suffix=-4.7 –enable-shared –enable-linker-build-id –libexecdir=/usr/lib –without-included-gettext –enable-threads=posix –with-gxx-include-dir=/usr/arm-linux-gnueabi/include/c++/4.7.3 –libdir=/usr/lib –enable-nls –with-sysroot=/ –enable-clocale=gnu –enable-libstdcxx-debug –enable-gnu-unique-object –disable-libmudflap –disable-libitm –enable-plugin –with-system-zlib –enable-objc-gc –with-cloog –enable-cloog-backend=ppl –disable-cloog-version-check –disable-ppl-version-check –enable-multiarch –enable-multilib –disable-sjlj-exceptions –with-arch=armv5t –with-float=soft –disable-werror –enable-checking=release –build=i686-linux-gnu –host=i686-linux-gnu –target=arm-linux-gnueabi –program-prefix=arm-linux-gnueabi- –includedir=/usr/arm-linux-gnueabi/include
Thread model: posix
gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-12ubuntu1)

STEP 7 : Cross compile the U-boot-sunxi  using the above tool chain the *.bin , *.img,*.lds , *.map and spl/*spl.bin created .

But donot know whether it will run for O-LinuXno Board as i have systme with i686 , i tires 7-8 times for getting the tool chain from different location but still having issue . No boot ?  can you please suggest

Posted in ARM Embedded Processors | Leave a comment

TOOL CHAIN

one more thing : while using the toolchain , architecture for the board for which toolchain will be used .

ARM V7-A (Architecture) is for ( CORE DESIGNED BY ARM HOLDING)

ARM Cortex-A5, ARM Cortex-A7, ARM Cortex-A8, ARM Cortex-A9, ARM Cortex-A12, ARM Cortex-A15, ARM Cortex-A17

OLinuxno is having Cortex -A8 .

 

Posted in ARM Embedded Processors | Leave a comment