This is a discussion on Device entry Not found within the AIX Operating System forums, part of the Unix Operating Systems category; --> hi all, I am a newbee to AIX and am trying to write a simple device driver. when i ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| hi all, I am a newbee to AIX and am trying to write a simple device driver. when i add the device to the device switch entry through devswadd() it gets added without a problem. But i cant find it when i use kdb. I am attatching the code Am i missing some thing :: hello_init(int cmd, struct uio *uiop) { struct file *fp; int err; dev_t devno=makedev(32,0); bsdlog(LOG_DEBUG | LOG_KERN,"Getting to register device\n"); switch (cmd) { case CFG_INIT: dev.d_open =ddopen; dev.d_close=ddclose; dev.d_read=nodev;/*nodev is a kernel service which auto matically returns error if user asks for it*/ dev.d_write=nodev; dev.d_ioctl=ddioctl; dev.d_strategy=nodev; dev.d_select=nodev; dev.d_config=nodev; dev.d_print=nodev; dev.d_dump=nodev; dev.d_mpx=nodev; dev.d_revoke=nodev; dev.d_opts=0; dev.d_opts=DEV_MPSAFE;/*check for other flags*/ dev.d_dsdptr=NULL; dev.d_selptr=0; dev.d_ttys=NULL;/*I dont know what this is for*/ if ((err=devswadd(devno,&dev))!=0) { bsdlog(LOG_DEBUG | LOG_KERN,"error in registering %d",err); } else bsdlog(LOG_DEBUG | LOG_KERN,"Devices registeredmajor=%d, Minor =%d ",major(devno),minor(devno)); break; } return 0; } how do i make a /dev entry for the device. thanks kanishk |