Interview Question
Country: India
Hey mayurnandurkar,
Are you talking about endianness (big-endian/little-endian)?
-Rachit
there are two ways to assign a major and minor number to device.
1)statically
2)dynamically
statically:register_chrdev_region(dev_t first, unsigned int count,
char *name); it is a kernel call it is responsible for allocating device number statically.
-> it accept three arguments 1.device number.
->integer value it is your driver supported to number of devices.
->driver name.
2)dynamically:alloc_chrdev_region(); it is responsible for allocatting
device numder dynamically,means this call says to kernel to allocate freelly avilable major number.
statically and dynamically(Run time)
- Kamal January 06, 2015statically means :
first=MKDEV(int major, int minor);
then
u can use the return type of MKDEV that is first in this function
int register_chrdev_region(dev_t first, unsigned int count,
char *name);
dynamic means :in run time u need to create device file there u need to enter
eg mknod /dev/filename typeofdevice majornumber minornumber