Making Rtems Device Drivers using C?

Angelo Fraietta afraiett at bigpond.net.au
Tue Jan 4 21:21:08 UTC 2005


Joel Sherrill  wrote:

> Alex wrote:
>
>> Hi,
>> I would like to implement a simple device driver to answer printer 
>> port requests, but in the rtems documentation I only see referencies 
>> to develop rtems drivers using ada... I want to implement it using c, 
>> any how-to? any tutorial? any help?
>
>
>
> You must be missing something.  All drivers are implemented in C and you
> should avoid using Ada (or C++ for that matter) for them due to 
> potential run-time actions you might not anticipate.  Both Ada and C++ 
> have complex run-times that can use mutexes, block, or allocate 


Surely the overhead in C++ would only be if calls were being made to C++ 
run time libraries from within the interrupt.
Would calling a native RTEMS set event from code compiled with the C++ 
compiler be different from making the same call from within the C compiler?

Michael Barr, in book cited below,  states that C++ is preferable due to 
its type-safety. Overhead can be controlled by avoiding things such as 
templates.

1.    Barr, M., Programming embedded systems in C and C++. 1999, 
Sebastopol, Calif.: O'Reilly. xvii, 174.

-- 
Angelo Fraietta

PO Box 859
Hamilton NSW 2303

Home Page


http://www.users.bigpond.com/angelo_f/

There are those who seek knowledge for the sake of knowledge - that is CURIOSITY
There are those who seek knowledge to be known by others - that is VANITY
There are those who seek knowledge in order to serve - that is LOVE
    Bernard of Clairvaux (1090 - 1153)






More information about the users mailing list