You are right, there is no relation between major numbers and syscall numbers.--- Om <omanakuttan@xxxxxxx> wrote:
Gaurav Dhiman wrote:
two device numbers, Major and Minor Numbers for
each
device file. These numbers are associated with
each
device file and they have a place in device file's inode. Major number is only important to the
kernel. Based on the major numbers, system calls are dispatched by kernel.
This is surpurising to me ..... are you sure system calls are dispatched using major number. I think system calls have nothing to do with major numbers ..... whenever a system call is made, user process (actually library function) passes the system call number thru processor's registers and those system call numbers are totally different from major numbers of devices. You can find the system call number defined in architecture specific "unistd.h" file in kernel sources. System call numbers are defined as __NR_<syscall number> in "unistd.h"
By dispatch, what I meant is invokation of the implementation of the system call (in the device driver), and not int 0x80. Using the registered major number, kernel finds out the corresponding fops and invokes the registered implementation for that major number.
Sorry for the confusion.
Regards, Om.
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/