Not much different from doing it under Linux.  Your module initialization 
function where you do all the PCI init will look pretty much identical to a 
Linux driver, except that you'll call rtl_request_irq instead of 
request_irq, if you install an interrupt handler.  And the RTLinux 
interrupt handler has a different function prototype, and requires that you 
call rtl_hard_enable_irq at the end of the irq.  Also, in the case of a 
shared PCI interrupt, Linux figures out which device interrupted prior to 
calling the IRQ.  In the case of RTLinux, they just give you the IRQ and 
leave it up to you whether you want to poll or whatever else you need to do 
to determine which device interrupted.

Since this is your first device driver work, if you don't already have a 
copy, run, don't walk, to the bookstore and buy "Linux Device Drivers", by 
Rubini.  I believe it's now in the second edition.

The other difference is how the driver gets called.  With RTLinux, you can 
provide a simple function call interface, since your users will be other 
kernel modules that will link to you dynamically, or you can use the 
RTLinux Posix I/O features and the rtl_file_operations struct, which are a 
variant on the Linux character device driver functions and the Linux 
file_operations struct.  See Rubini and the RTLinux posix i/o sources for 
more details.  The rt_com driver provided with RTLinux implements both 
types of interfaces.

And be aware that you'll have to spend a lot of time grepping through the 
Linux kernel sources to figure out what's really going on, in many 
cases.  And be aware that what's really going on changes with every major 
kernel release (e.g., from 2.2 to 2.4). ;)


At 01:34 PM 6/4/2002 -0500, [EMAIL PROTECTED] wrote:
>Does anyone have any advice or (more preferably) examples
>of a PCI device driver written for RTLinux? I'm writing a device
>driver for a PCI framegrabber and I'm not sure I'm heading in
>the right direction. Not only is this my first experience with
>RTLinux, but it's also my first experience writing a device
>driver. Thanks for any help!
>
>Brian Rivers
>
>-- [rtl] ---
>To unsubscribe:
>echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
>echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
>--
>For more information on Real-Time Linux see:
>http://www.rtlinux.org/



= = = = = = = = = = = = = = = =

Brad Hines
Practical Instruments, Inc.
10321 Quill Ave.
Sunland, CA  91040-3023
818-352-7099
Fax: 818-293-0141


-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/

Reply via email to