views:

42

answers:

1

I made a kernel module and used the code below to try to make a /dev/mytimer entry.

#define DEVICE_NAME "mytimer"
#define MAJOR_NUM 61
static struct class *fc;


fc = class_create(THIS_MODULE, DEVICE_NAME);
device_create(fc, NULL, MAJOR_NUM, "%s", DEVICE_NAME);

I don't see my module in /dev as /dev/mytimer... But when I lsmod, I see it in the list as entry mytimer.

Where and how do I find my module? Is there anyway to put it in /dev?

Thanks!

+2  A: 

Automatic creation of device nodes was something the devfs was responsible for. However it was eventually removed due to concerns about implementing device naming policy in the kernel. The modern way to create device nodes is using udev which can respond to sys device events and create the device nodes on demand.

Otherwise manually creating device nodes with mknod on a static filesystem is your other option.

stsquad