RE: how does kernel know?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You are taking it a wrong way, the driver module is not loaded at the
time when the device file is opened by the application (I think you are
taking it this way).

Well actually driver is loaded when insmod is done on module object code
file. Once the driver has been loaded with insmod utility, any
application opening the related device file will activate the driver's
open function.
If a driver is not loaded using insmod utility and any application is
opening a device file, kernel will return appropriate error for it, I
don't know what the error will be.

THE DRIVER IS ALREADY LOADED BEFORE OPENING A DEVICE FILE. You are just
calling a driver function at open, read, write time to device file.

As many of the members of this list have mentioned, the trick in kernel
which is actually mapping the open system call to the exact open
function of driver, I am not going to repeat the same.

Cheers !!
Gaurav



-----Original Message-----
From: kernelnewbies-bounce@xxxxxxxxxxxx
[mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of Zeeshan Ali
Sent: Thursday, September 30, 2004 5:55 PM
To: kernelnewbies@xxxxxxxxxxxx
Subject: Re: how does kernel know?

Hello,
   But the registeration of the char device is done at the module
loading time (module_init), and in the example i told you, the driver
lp was'nt already loaded and was loaded AFTER the app. opened a device
file of the same major number used by the "lp" driver.

   I dont know what to say. At one hand, I am quite happy with the
fact that so many people are so willing to help me out but on the
other hand I am getting quite pissed-off by the fact that they dont
care to read my questions carefully and tell me trivial stuff I
already know. Please take this comment positively.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux