Hi All,
In Oreilly's LDD 3rd edition it is given that struct cdev is the kernel's internal structure that represents char devices.
Also given that before kernel invokes your device's operations, you must allocate and register one or more of these structures.
My doubt is who will create this structure for a char device ( either kernel will create it or the driver author has to explicitly create it using cdev_alloc() )
If kernel creates it then at what situation it will create it or If driver author has to create it , when it has to create?
And once it get created how to link the file_operations structure to it?
Thanks in advance,
LeelaKrishna.