Hi,
 
Hopefully some simple answers ;-)
 
1/ Normally your application would simply include the headers, the .c files 
would build seperately to produce the 'driver' (or kernel module in 'Linux 
speak'). You can build the kernel module outside of the kernel source tree but 
the code it builds cannot be linked to your user application due to the 'kernel 
space'/'user space' segmentation. The interface between user code and the 
kernel module is typically done by a device file which appears under /dev. You 
can use other methods such as virtual files under /proc which can be made 
read/write although it is normal for /proc files to be read only (for driver 
status for example). The header files would define 'ioctl' values that the 
driver and user code need as well as any other 'magic' numbers required for the 
driver to work.
 
2/ During development it helps a great deal to be able to build the driver as a 
module rather than 'built in'. You can rebuild just your module and remove and 
install the new module without a reboot. This will only be possible when the 
module reaches a certain level of stability so you can expect a few 'oopses' 
until you get there.
 
I recommend you read the Linux Device Driver book, available here 
http://lwn.net/Kernel/LDD3. There are some simple examples of various types of 
driver to look at.
 
Regards
 
Phil Q
 
Phil Quiney, Senior Software Engineer
Trinity Convergence
Cambridge Business Park
Cowley Road
Cambridge CB4 0WZ, UK
T: +44(0)1223-435536
F: +44(0)1223-435560
www.trinityconvergence.com <http://www.trinityconvergence.com/> 

 

________________________________

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of zhijin wang
Sent: 05 June 2008 09:05
To: [email protected]
Subject: i2c driver


Hi,
with  my lack of linux driver development, I have some simple questions.
 
1.) assuming we get the i2c source code for the drive. i want to add the  
driver for linux.
 
we just include the header file in the application or we must build the .c file 
with the application together?
 
2.) if we must build the source code, build it with linux kernel (rebuild the 
kernel for the driver) or build it with application code?
 
THanks.
 
Forest.

________________________________

雅虎邮箱,您的终生邮箱! <http://cn.mail.yahoo.com/> 
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
  • i2c driver zhijin wang
    • RE: i2c driver Phil Quiney

Reply via email to