What does `cdev_add()` actually do? I'm asking terms of registering a device with the kernel.

Does it add the pointer to cdev structure in some map which is indexed by major and minor number? How exactly does this happen when you say the device is added/registered with the kernel. I want to know what steps the cdev\_add takes to register the device in the running kernel. We create a node for user-space using `mknod` command. Even this command is mapped using major and minor number. Does registration also do something similar?