EmbLogic's Blog

Author Archives: shyam.singh

linux_environment..

i have used the functions->getenv,putenv,openlog,closelog,syslog,setlogmaskenviron,… working on ./dev/tty.

Posted in Uncategorized | Leave a comment

parallel_port driver status..

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

Posted in Parallel Port Driver | 1 Comment

handshaking problem..

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

Posted in Parallel Port Driver | Leave a comment

KERNEL_TIMER…….

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..?

Posted in Character Driver, Device Drivers | 2 Comments

ioctl..

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

Posted in Character Driver, Uncategorized | Tagged | 1 Comment

char_driver status…

sir, i have completed read & write in single as well as multi quantum.

Posted in Uncategorized | Leave a comment

status of char driver

i have successfully completed scull trim, scull follow, and write complete using single quantum and now working on multiple quantum

Posted in Uncategorized | Leave a comment

character_driver

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

Posted in Character Driver | 1 Comment

blog_update..

i have completed my registration &unregistration of multiple devices with the use of a fun scull_setup_cdev…….

Posted in Character Driver | Leave a comment

char driver problem…

    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

Posted in Uncategorized | 1 Comment

datatype….

will anyone suggest me the difference b/w- int flag; const int flag; static int flag;

Posted in Uncategorized | 3 Comments

signal problems:

#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

Posted in Uncategorized | 5 Comments