Linux/BSD programming, how do I start?

Blazkowicz

Member
Jun 27, 2006
54
0
0
For a long time I have been thinking of learning some Linux/BSD application development but I don't know where to start. Will sockets be a good place to start with?

My ultimate interest lies in kernal programming for Linux/BSD. Should I jump to it directly? Please advice.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Ya, you'll probably want to learn a efficient text editor. People pretty much use whatever they want. There are literally hundreds of text editors. GUI ones, ones inside of IDE's, terminal-based editors. The majority of people though will use either the gui or the text versions of Emacs or a Vi clone (Vim (although that isn't so much a clone), nvi, and such). But by no means restrict yourself to those if you don't like them. Some people are quite happy with something like nano.

Vi is a old fasioned text editor. It uses a 'dual mode' sort of operation were you have a command mode and then a editing mode. You start off in command mode were you can use keyboard combos to manupalate text. Vim is commonly used in Linux distros and it's "Vi IMproved". It sports advanced features like ctags, regular expressions, numerious language extensions, even some introspection. You can set it up to turn tabs into "4 spaces" or "8 spaces" or "real tabs" and then get into flamewars about which is the one true unix way. That sort of thing.

To some people it is the pinnacle of efficientcy. Fast, effective, and a result of decades of evolutionary software design. Other people feel differently. I've heard it described (I am paraphrasing), "A obsolete throwback from the 70's with a interface designed by spastic alien monkeys"

But the principal advantage of Vi is that it's ubiquious. Everybody has one. Every system you use. Every Linux distro, ever BSD fork, every unix system you come across anywere at any time will more then likely have a vi clone aviable. It's a standard feature.

Then there is Emacs. Emacs is something else.
Emacs is best described as:
A. Writting in Lisp (it's it's own programming environment)
B. Not Vi.

And that's about it. There is a old joke that goes along the lines as:
Person A and Person B....

Person A: Oh god vi sucks.
Person B: You should use Emacs
Person A: No thanks, I already have a operating system.

With extensions you can use it to edit text. You can use it to edit text with vi bindings. You can use it to rip DVDs, or browse the itnernet. I've seen extensions were you can manage your mp3 collections and get little previews of albums from gifs downloaded automaticly from Amazon. And you can also use it to program.


When you mention "kernel" and such you make people think that your most interested in low-level operating system aspects. Drivers, kernels, library files, and stuff like that. Stuff that is fast and classic. It's all dominated by C and GNU utilities.

Otherwise if your interested in just application programming.. Pretty much any language you prefer can be used although what you use will probably be dictated by your environment your targetting. But anything will work.. Perl, Python, C#, Objective C, C, C++, Ruby, etc etc.

There are some IDE's.. Eclipse is beleived by it's uses to be 'Enterprise' while Microsoft Visual Studio is what small timers use (they are a bit delusional, well more then a bit.). There is Kdevelope which is KDE's development IDE. They use C++ mostly. And lots of other stuff beyond that.

Just pick something your interested in and begin looking at the code and playing around with the tools. There are also many many numerious unix/Linux programming books.
 

thesix

Member
Jan 23, 2001
133
0
0
Originally posted by: Blazkowicz
For a long time I have been thinking of learning some Linux/BSD application development but I don't know where to start. Will sockets be a good place to start with?

My ultimate interest lies in kernal programming for Linux/BSD. Should I jump to it directly? Please advice.

It's not clear what your background is.
"Application" and "Kernel" development can be very different.

No matter what, you shall start from here (if you haven't done so):
http://www.kohala.com/start/

especially,
http://www.kohala.com/start/apue.html

Then you can read some Unix internal books, including OS specific ones.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Pick a task and jump in, you'll have a hard time finding motivation if you don't have a specific thing you want to accomplish.

And the kernel is just a really large C application, but you can't expect to dive into something like memory management or drivers without understand C really, really well and the hardware for the code you're looking at.
 

Blazkowicz

Member
Jun 27, 2006
54
0
0
Pretty used to C/C++ and recently learned some assembly. I am more interested in low level programming but have absolutely no idea where and how to start.


 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: Blazkowicz
Pretty used to C/C++ and recently learned some assembly. I am more interested in low level programming but have absolutely no idea where and how to start.

I think I've read that if your interested in that sort of thing that you go and start looking at some bug reports and such. See if you can help out. Like see if you can reproduce it and such. A lot of the time the developers can't realy get to some things because they lack a paticular peice of hardware or can't seem to recreate the bug themselves.

That and documentation is very valuable.

But if your interested in that the most appropriate place to ask about that is with these folks:
http://kernelnewbies.org/

They would know more about it then anybody here. They have the website and FAQs and some guides and such. As well as IRC channels and mailing lists devoted to the subject.