i have used the functions->getenv,putenv,openlog,closelog,syslog,setlogmaskenviron,… working on ./dev/tty.
sir, i have completed the parallel port driver in NIBBLE mode……But not by handshaking….(by using delay). in handshaking our status is ->control have reached from peripheral to host but we are not able to receive the control from host to … Continue reading
in Nibble mode… -> can we use a single bit in hand_shaking in the parallel port driver..? -> which bit of the control register should i use to handshake->1.strobe bit, 2.autofeed bit. Please tell me the procedure of handshaking in … Continue reading
In my lkm,when i printed the value of “HZ”. It comes out 1000. But the actual value defined in the header #include<asm/param.h> is 100. why..?
In the ioctl function at driver level…….., the switch(cmd) statement have ‘cmd’ as the argument but we can see cmd is of ‘unsigned int’ type… i want to ask how the switch function perform case matching…. switch(cmd) { case IOSQSET: … Continue reading
sir, i have completed read & write in single as well as multi quantum.
i have successfully completed scull trim, scull follow, and write complete using single quantum and now working on multiple quantum
local_scull_dev_ptr=container_of(pointer,container type,cdev); anyone plz tell me the internal functioning of the this macro… 1.what i mean to say is- how the control moves… 2.we directly take the third argument as ‘cdev’… but we know cdev resides in struct scull_dev so … Continue reading
i have completed my registration &unregistration of multiple devices with the use of a fun scull_setup_cdev…….
The code during registration:- scull_dev_ptr=kmalloc(NO_OF_DEVICES*sizeof(struct scull_dev),GFP_KERNEL); memset(scull_dev_ptr,”,sizeof(struct scull_dev)); for(loopv=0;loopv<NO_OF_DEVICES;loopv++) { ldev=MKDEV(scull_major,scull_minor); scull_minor=MINOR(ldev); scull_dev_ptr[loopv].cdev_var.dev=ldev; scull_dev_ptr[loopv].cdev_var.owner=THIS_MODULE; cdev_init(&scull_dev_ptr[loopv].cdev_var,&fops); ret_val_2=cdev_add(&scull_dev_ptr[loopv].cdev_var,ldev,1); if(ret_val_2<0) { #ifdef DEBUG printk(KERN_ERR “cdev_add failed”); #endif goto out; } scull_minor++; #ifdef DEBUG printk(KERN_INFO “minor=%d”,scull_minor); #endif } The code during unregisteration:- … Continue reading
will anyone suggest me the difference b/w- int flag; const int flag; static int flag;
#include<stdio.h> #include<unistd.h> #include<sys/types.h> #include<signal.h> void outch(int sig) { printf(“outch:i got a signal no.=%d\n”,sig); sleep(5); printf(“handler for signal no.=%d has ended\n”,sig); } int main() { struct sigaction act,act1; act.sa_handler=outch; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask,SIGQUIT); sigaction(SIGINT,&act,0); sigaction(SIGQUIT,&act,0); act1.sa_handler=outch; sigemptyset(&act1.sa_mask); sigaddset(&act1.sa_mask,SIGTSTP); sigprocmask(SIG_BLOCK,&act1.sa_mask,&act.sa_mask); while(1) { printf(“hello\n”); sleep(1); … Continue reading