views:

176

answers:

4

I wanted to get into systems programming for linux and wanted to know how to approach that and where to begin. I come from a web development background (Python, PHP) but I also know some C and C++.

Essentially, I would like to know:

  1. Which language(s) to learn and pursue (I think mainly C and C++)?
  2. How/Where to learn those languages specific to Systems Programming? Books, websites, blogs, tutorials etc.
  3. Any other good places where I can start this from basics?
  4. Any good libraries to begin with?
  5. What environment setup (or approx.) do I need? Assuming linux has to be there but I have a linux box which I rarely log into using GUI (always use SSH). Is GUI a lot more helpful or VI editor is enough? (Please let me know if this part of the question should go to serverfault.com)

PS: Just to clarify, by systems programming I mean things like writing device drivers, System tools, write native applications which are not present on Linux platform but are on others, play with linux kernel etc.

+5  A: 

If you are playing with the kernel, you must use C. There are several books, like Essential Linux Device Drivers, which give you the basics of structures, where to run your code, etc.

In general, many servers are written in C, and sometimes C++. Popular libraries include Glib, libevent, boost (for C++).

You can do everything from the command line in your editor of choice - there isn't a clear win here, pick what you like.

Yann Ramin
So, basically there is no need for an IDE like Eclipse?
AJ
Absolutely not, most kernel developers wouldn't go near Eclipse.
Yann Ramin
+1 from one kernel hacker who has yet to find an IDE that I did not find myself fighting.
Tim Post
@Tim Would you mind elaborating what your environment looks like or how you go about kernel hacking? I want to start but have no clue where to begin with.
AJ
I'm guessing he uses a tiling window manager + vim. Useful tools include grep, gcc, gdb, and cscope.
TomMD
+2  A: 

To really get into linux system programming, I say C and x86 assembly.

For applications, Linux supports a myriad of languages, python, C++, fortran, perl, etc, so pick which one you want to use.

Alan
I'd go for Python.
AJ
+1  A: 

Nano is my favourite editor by far. Vi is also nice. I haven't taken the time to learn it, but they both can aid in your programming experiences. Onces it comes down to the tricky errors in code, mount the SSH drive, and then open up the files remotely with you're favourite GUI program.

Kyle
I like that idea of mounting the SSH drive.
AJ
That presents 'interesting' problems when connections hiccup. I assume you mean SSHFS?
Tim Post
Yes sir. I use it all the time. It's fine until you lose wifi or whatever. I have used expandrive and sshfs on Ubuntu, and I live edit almost everything. Have yet to lose anything. The error handling for a broken connection isn't really there in Gedit, but it's only happened once to me!
Kyle
+2  A: 

Your question is pretty broad. "Native applications which are not present on Linux" covers things like office suites, which I don't consider system programming. I would focus on one thing (say device drivers) at a a time. There are a lot of existing questions about this, including Linux Programming Book, What IDE would be good for linux kernel driver development, Are there recommended tutorials for writing drivers for Gnu/Linux?, and Ubuntu Linux, what programming languages should I learn?.

To learn C89, I would definitely delve into The C Programming Language (2nd Edition).

Matthew Flaschen
Thanks. Already starred those threads and I do have the Kernighan and Ritchie book. Its sweet, my first love. :)
AJ