Re: Newbie questions on setup for writing device drivers in/for Linux.



Harry schrieb:

I'm an experienced C/C++ applications developer but an absolute newbie
in the field of Linux internals, device drivers, etc... so would
greatly appreciate your kind getting-started help.

Basically, I need to write the equivalent of an Ethernet/NIC driver
for a proprietary hardware (non-ethernet).

Please be more specific. If you don't need excessive speed, a driver in
userspace plus the tun/tap network device driver will work, too. It's
working similar to ppp, where a userspace application (pppd) does all the
complicated work.


1. Now, what kind of system setup would you guys recommend for this?
I'm currently inclined to use Fedora 9, but is there anything else...
that has better tools / support for this line of work?

Kernel driver development is basically done with a good editor and "git" as
the RCS. And a compiler of course. Every multi-purpose distruibution is
equipped as good as the other.


2. Any up-to-date books / online resources that I could refer to? That
would get me on the fast track?
2.1 I'm planning to refer to O'Reilly's Linux Device Drivers 3e,
unless you have alternate or additional recommendations.

Good, as it covers networking drivers. Some other books/online sources do
not.


2.2 Unix Internals (Vahalia) appears to be a very good book, but it is
probably talking about generic Unices, and not necessarily the latest
Linux kernel 2.6.*.

Don't know about this one.


2.3 Similarly, AUP by Richard Stevens appears to be an excellent book
for low-level Unix Programming, but I'm not so sure if it would help
me for my immediate work, which is Linux + NIC-like device driver.

This book is a must have for anyone who wants to learn about writing
networking applications in Unix. It's a good choice for you, too. Before
tweaking on kernel side, you should know the userspace.


3. Can I have a Virtual Box kind of setup... where I can freely play
with the guest Linux box (for which I will be writing my various
kernel drivers), with the host remaining unscathed in case I screw up
things?

If you have to work on the actual hardware, it's often impossible to
virtualize everything. Most crucial are interrupts and DMA, which are both
neccessary for most kinds of networking hardware.

I myself prefer a having a second computer just for testing purposes.


Am I, by any chance, signing up for extra-ordinarily difficult work
here?

Yes. To fight the evil villian "Colonel Panic", use the source, Luke!

Kind regards

Jan

.



Relevant Pages