Unix Technical Forum

Device entry Not found

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


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 11:17 AM
xmaverickx
 
Posts: n/a
Default Device entry Not found

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:34 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com