views:

309

answers:

7

I'm going to graduate soon in electronics and tlc engineering and I have some decent OO programming experience with PHP and Java.
Now I would like to try starting a career as a C programmer.

I'm interested in C since this is, I think, the most suited language, without considering Assembly, to develop device drivers, firmwares and other low-level softwares in. In particular I hope to be able to work on network related topics. I want to work quite close to the hardware since I suppose this is the only way I'll be able to fruitfully spend my degree while at the same time finding gratification in being a programmer.

So I'd like to ask what you think I should read considering that I can already write something in C, nothing fancy though, and that I've read a couple of times the K&R.

If you know of any tools or libraries (like libevent and libev) that are de facto standards in the field of low-level, network related, C programming that would be nice to know as well.

A: 

How about the libcurl source? Take a look here.

dirkgently
+2  A: 

Must read books:

  • TCP/IP Illustrated, Stevens
  • UNIX Network Programming, Stevens, et al

For system-level networking code (you expressed an interest in drivers, etc) see OpenBSD sources since it's tight, clean, and the standard networking APIs are based almost completely on BSD.

dwc
A: 

I've used this "Linux I/O port programming mini-HOWTO" a number of times. This is C code.

There are also a number of C code samples for serial I/O.

nzpcmad
+3  A: 

In no particular order:

Bill the Lizard
The Stevens books have been the bible for network programming for a long time.
sean riley
The Stevens book volume 1 is even 1024 pages long for that extra geek cred!
z8000
+1  A: 

Depending on how low level you want to go. There is a small stack called uIP which is a good read, its well documented and has a few papers written about it. Its a lot closer to the hardware then any of linux socket/io programming since there is no kernel to get in the way.

You may want to also take a look at tcpdump, its a nice cli based sniffer, (written in c) so you can use it as well as take it apart!

Infamy
A: 

Not exactly C specific but packet sniffers like Wireshark can be really useful for testing & debugging network related programs.

Dave Turvey
+1  A: 

Beej's guide to Network Programming is a good place to get started. If you want to go down the rabbit hole then as many others have recommended take a look at Unix Network Programming, volumes 1-2 by W. Richard Stevens.

vinc456