[pso] [Probleme inregistrare device]

Andrei Cibotaru andreicibotaru at gmail.com
Wed Mar 17 15:50:50 EET 2010


Salut,

    Am si eu o mica problema cu prima cerinta din laboratorul 4. Incerc sa
inregistrez
un character device creat cu comanda:
      mknod /dev/so2_cdev c 42 0
creat cu root.

Am scris urmatorul cod:

int err =  register_chrdev_region(MKDEV(MY_MAJOR, MY_MINOR), NUM_MINORS,
MODULE_NAME);

if (err != 0)
{
        printk(KERN_INFO "[so2_cdev]: Inregistrare failed");
        return err;
}

unde macrourile au urmatoarele valori :
#define MY_MAJOR                42
#define MY_MINOR                0
#define NUM_MINORS              1
#define MODULE_NAME             "so2_cdev"


in so2_cdev.c sursa din cadrul laboratorului 4.
Am compilat cu make si am dat insmod so2_cdev.ko.
Comanda la care primesc:
                insmod: error inserting 'so2_cdev.ko': -1 Device or resource
busy

iar dmesg afiseaza :
                 [so2_cdev]: Inregistrare failed

Aveti careva idee ce as putea sa fac?


Merci,
-- 
Andrei Cibotaru
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/pipermail/pso/attachments/20100317/bb942a1c/attachment.htm>


More information about the pso mailing list