Is there any function to reallocate memory at the kernel level in spite of kmalloc……????
Is there any function to reallocate memory at the kernel level in spite of kmalloc……????
i have complete read write operation for multiple item and llseek also done
int main() //without header file
{int *i;
char k;
float s;
char j[5];
struct hi
{
};
return 0;
}
//where these all keywords and main function is declared and defined…?????
example : char a[]=”a”; this is possible but not efficient because we have other method to assign character const as shown below:
char c=’a’;
If container of function returns scull_dev pointer, then where the major and minor numbers are located into the different structures??????
Completed: open, close, read (single quantum, multiple quantum),write(single quantum, multiple quantum),semaphore(syn tech),LSEEK.
Working: Completion, IOCTL.
earlier
ioctl (struct inode * inode, struct file * filp, unsigned int cmd, unsigned long arg)
In 2.6.x the ioctl is divided in to 2
compact_ioctl (struct file * filp, unsigned int cmd, unsigned long arg )
it is used when a 32 bit application is called in 64 bit, so it will provide the required mapping born due to the different architecture of 32 and 64 bit.
unlocked_ioctl (struct file * filp, unsigned int cmd, unsigned long arg )
In earlier version the (struct inode * ) parameter was used to fetch the device info from filp->private_data. but now it has been removed.
It is provided as filp->f_dentry->d_inode
plus in
struct file_operations
{
ioctl:my_ioctl,
use
compact_ioctl: my_ioctl,
unlocked_ioctl: my_ioctl,
}
problem is while traversing it gives the segmentation fault.
#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
struct linklist{
char **data;
struct linklist *next;
}*start,*temp,*last;
int main()
{
int i,j,m,l;
int quantams;
char y;
start=(struct linklist*)malloc(sizeof(struct linklist));
temp=(struct linklist*)malloc(sizeof(struct linklist));
//last->data=malloc(sizeof(char*)*);
//printf(“enter the dat in the first node\n”);
start->next=NULL;
//scanf(” %d”,&start->data);
temp=start;
j=0;
printf(“do u wana linklist press y\n”);
scanf(” %c”,&y);
while(y==’y’||y==’Y’)
{
printf(“this is %d node\n”,j+1);
last=(struct linklist*)malloc(sizeof(struct linklist));
last->data=(char **)malloc(sizeof(char *));
for(m=0;m<=1;m++)
{
last->data[m]=(char*)malloc(sizeof(char));
for(l=0;l<=1;l++)
{
printf(“row no %d: column no %d”,m,l);
printf(” enter the information\n”);
scanf(“%d”,&quantams);
//last->data[m][l]=quantams;
*(*(last->data+m)+l)=quantams;
}
}
last->next=NULL;
printf(“last->next=NULL\n”);
temp->next=last;
printf(“temp->next=last\n”);
temp=last;
printf(“temp=last\n”);
j++;
printf(“do you wana continue press y or Y\n”);
scanf(” %c”,&y);
}
j=0;
temp=start;
while(temp->next!=NULL)
{
printf(“this is %d node\n”,j);
for(m=0;m<=1;m++)
{
for(l=0;l<=1;l++)
{
printf(“row no %d :: column no %d”,m,l);
printf(” %d\n”,*(*(temp->data+m)+l));
}
}
temp=temp->next;
j++;
}
return 0;
}
Completed: open, close, read (single quantum, multiple quantum),write(single quantum, multiple quantum),semaphore(syn tech).
Working: Completion, IOCTL,LSEEK
i have done sucessfully READ and WRITE operation in multiple quantum.
i have also done synchonization technique Semaphore,Completion.
now i m working on llsekk operation.
I have completed the read and write operation in driver for multiple quantum.now i m working on semphore operation.
what is the difference between NULL and NUL ………………..??????
I have used printk statement in char device driver code.
“make” have no warning or error
on doing insmod no error is given .
but on dmesg the printk statement are not showing.
i have checked in /var/log/message but printk statement are not present.
Ihave changed the priority in printk.h file bur no avail .
If any one has any info do let it pass to me.