Question

I am writing a module for the linux kernel and I want to create some device nodes in the init function

int init_module(void)
{
    Major = register_chrdev(0, DEVICE_NAME, &fops);
 // Now I want to create device nodes with the returned major number
}

I also want the kernel to assign a minor number for my first node, and then I will assign the other nodes' minor numbers by myself.

How can I do this in the code. I dont want to create devices from the shell using mknod

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top