"Use the Source, Luke!"
If you download the kernel-source for your distribution, in the
/usr/src/linux/drivers directory (and also perhaps in
arch), you will find a cornucopia of existing driver source-code.
You will notice that
most of it is written in ordinary "C," because a compiler produces very good code. Some of that "C" source-code contains
embedded assembler-level statements and so-called "inline" calls, but you'll find that mostly in the older code.
Be very mindful that it is extremely likely that you can find an
existing driver that either does what you want it to do, or that will act as a specific example which you can modify.
Quote:
Dictum Ne Agas: do not do a thing already done.
|