Beginning Linux Development

gary201147

Distinguished
Jul 25, 2006
41
0
18,530
This is a question from a real novice...but I was wondering what it takes to be developer or contributor to GNU, open source programs such as Linux, Mozilla, etc?

There seems to be a wealth of information out there but all sorted in a seemingly esoteric manner, such that beginners like me are often caught in circles.

I have used Linux before, I have beginner/intermediate level C++ knowledge, and Im an engineer. I have been really interested in open source software development. Where do I start? Are there books I should read?

I guess the question comes down to: if you wanna know how to be knowledgeable enough to contribute to the open source community, where do you start?
 

bmouring

Distinguished
May 6, 2006
1,215
0
19,360
My suggestion:

Pick a project that seems interesting to you, especially one that is written in C++ (unless you don't mind spending a little time learning a new language).

See how they keep their source, usually either via CVS or Subversion. If you don't already have it installed, install it.

(Optional) Pick a nice IDE to work in, install. I like eclipse and the CDT plugin, but there are many others that are better in certain areas.

Make sure you have all of the tools and libraries to build the project, get the latest version of the project from source control, make sure you can build it. Read any build notes on the dev site/in the source control itself for hints.

Read the dev site/mailing list for bug listings and/or feature requests.

Attempt to fill those requests.

Run any unit tests/regression tests the project has

If all's well, check the dev site/mailing list for submission procedures. Some only require checking things back into your branch which, upon notifying senior devs, will be checked and possibly merged back into the main dev effort, usually called "trunk" or "base". Sometimes you must submit the fixes as a patchfile, there are many resources on how to use the diff utility to create a patchfile.

Again, just find out how the project you choose runs things and conform to that and you have the best chance of seeing your code show up in a future release.

Probably most importantly, don't get too easily discouraged and be able to accept criticism. It is not uncommon that some senior devs are a bit cranky and a little harsh in their criticisms, but there's a reason they're where they are, namely they do kow what they are talking about. Listen to what they say and learn from it. Make the fixes and try again. Also remember that the larger the project, the less likely they are to accept code (just a numbers game)

That being said, it is immensly rewarding having a fix you submit make it to the main branch and, if you are really good, you can actually make a living out of doing this stuff.
 

linux_0

Splendid
Excellent suggestions as always! :-D


I would add:

download a few different GNU/Linux distributions such as Ubuntu, FC5, SuSE, CentOS, Debian and others and play with them, their IDEs, libraries and gcc/g++ for a few months. Once you are familiar with how things work you can pick a project you're interested in and contribute to it.

Usually it is better to start small and build up from there. For example pick a project, learn it, play with it and write some documentation for it or a howto. Join the mailing list ( s ), news group ( s ) make suggestions for improvements get input from the core developers find out what they need help with and if it matches your skills and interests start contributing code.

GL :-D
 

gary201147

Distinguished
Jul 25, 2006
41
0
18,530
Will downloading the documentation alone help me understand how to code for such a large scale project?

I have never had experience coding something as intricate as an OS. Maybe I am making it to be more complex than it is, but I have not had experiencing coding for hardware, kernals and so forth (yes i know programming is essentially talking to hardware.)

I guess I just feel like i need a lot more information about computer hardware and architecture before being able to contribute. Is this accurate?
 

linux_0

Splendid
Will downloading the documentation alone help me understand how to code for such a large scale project?

I have never had experience coding something as intricate as an OS. Maybe I am making it to be more complex than it is, but I have not had experiencing coding for hardware, kernals and so forth (yes i know programming is essentially talking to hardware.)

I guess I just feel like i need a lot more information about computer hardware and architecture before being able to contribute. Is this accurate?



Not necessarily.

The kernel handles the low level stuff and the hardware interface for the most part.

Most of the rest of the software talks to the kernel so to speak via system calls.

Which project or projects are you planing to contribute to?

The kernel is the toughest one to contribute to. Smaller projects for applications or user level stuff are much easier.

GL :-D
 

gary201147

Distinguished
Jul 25, 2006
41
0
18,530
Well thats good news. But I still dont quite grasp what knowledge is needed even for applciation/user level programming. Could you give me an example?

Thanks a lot for your help by the way. I love TForumz; it feels like the most helpful forum out there.
 

linux_0

Splendid
Well thats good news. But I still dont quite grasp what knowledge is needed even for applciation/user level programming. Could you give me an example?

Thanks a lot for your help by the way. I love TForumz; it feels like the most helpful forum out there.



I would suggest playing with several distros first so that you pickup Linux more in-depth.

Start playing with the developer tools. Get to know how it works. Look at the source code for some projects / applications that interest you.

Be sure to check out Perl, PHP and mysql.

Here's some code for ya:

[code:1:a18c6e2aff]
package Main::AWESOME;open(I,"<$ARGV[0]");sub AWESOME{while(1){while(<I>){@a=$_;}print @a;}}$Linux=$Linus_Torvalds=AWESOME();
[/code:1:a18c6e2aff]


:-D
 

bmouring

Distinguished
May 6, 2006
1,215
0
19,360
Experience either interfacing with and/or creating an API is a major part of being able to contribute. Almost every app depends on some other library and/or provides interfaces for other apps to use, and every app uses system calls (calls to the kernel) either directly or via a library.

Good debugging skills are also a skill that's needed. Being very mindful of what's actually going on in the hardware is a must for C/C++ coding to create clean code that doesn't leak and doesn't segfault. Also, assume anything is possible, e.g. to expect that, even though a function is only supposed to return a specific subset of returns, anything could be returned and as such code for the "cosmic rays reflect from swamp gas and flip a bit in-transit" case. This makes your code incredibly robust as it is guarenteed as the code grows larger, you will miss something and the "catchalls" will save you (hopefully you put some useful output on the catch!)

Any coding in C/C++ at this level should only be done after you have a really solid understanding of pointers, pointer arithmetic, and data structures. This is related to knowing what goes on in the hardware and the OS.

Another area where it's good to have experience, especially in a more mature project, is potimization and solid complexity theory background. This will help you to make more efficient code which, in my opinion, is only third to robust and well-documented code, in that order.

Document your work, preferably in code. Explain what's going on but don't put a comment on every line.

Kernel dev is incredibly difficult to get into, as it is arguably the most visable opensource project and has very rigorous standards. You must have a very good idea of what's going on in hardware and the OS as well before treading here. You need to understand what's going on in the OS and how it talks to the hardware itself. You must have a firm grasp of the distinction between user space and kernel space and how the two interact. I do not mean to deter you from the subject, just informing you what knowledge is needed before you start.
 

linux_0

Splendid
Indeed :-D

I agree!


@OP

Start on user-level code. The kernel is the kernel...

Broaden your focus a bit by picking up Perl, PHP, mysql as I suggested before.

I would also throw in Python, shell and Tk/Tcl.

That will allow you to contribute to a lot of projects.

GL :-D
 

bmouring

Distinguished
May 6, 2006
1,215
0
19,360
As always, sage advice.

Another good skill to have in Linux dev is automake/Makefile experience to not only help in your own development and testing, but also to allow easy incorporation into the overall project's automake framework, especially important for new features.