LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


Search this Thread
Old 12-22-2007, 11:36 PM   #1
LQ Newbie
Registered: Dec 2007
Posts: 8

Rep: Reputation: 0
How to view source code in LINUX?

i have installed debian linux in my machine and also i have installed all packages related to TCP/IP. now will i be able to view the source code related to TCP/IP Stack?

Also, what is the programming language used in building LINUX, is it C? or shell programming language? or assembly level language?

If you can tell me how to view source codes in LINUX system....
Old 12-23-2007, 12:45 AM   #2
LQ Addict
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You can read source code with any text editor, or terminal utilities like cat or pagers (e.g. more and less). The TCP/IP stuff is implemented in the kernel, so you'll want to look at the relevant files in the kernel source.

The kernel itself is written in C mainly, but there's some assembly in there too I think (I'm not certain).
Old 12-23-2007, 12:56 AM   #3
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,738

Rep: Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142
Easiest is probably to use lxr to view the source online.
Of course this will be the source without any Debian specific patches - not likely to be an issue for the TCP stack.
Old 12-23-2007, 01:05 AM   #4
Senior Member
Registered: Jul 2003
Posts: 1,257

Rep: Reputation: 48

"Linux is written in the version of the C programming language supported by GCC (which has introduced a number of extensions and changes to standard C), together with a number of short sections of code written in the assembly language (in GCC's "AT&T-style" syntax) of the target architecture. Because of the extensions to C it supports, GCC was for a long time the only compiler capable of correctly building Linux. Recently, Intel claims to have modified its C compiler so that it is also capable of correctly compiling it.[25]

Many other languages are used in some way, primarily in connection with the kernel build process (the methods whereby the bootable image is created from the sources). These include Perl, Python, and various shell scripting languages. Some drivers may also be written in C++, Fortran, or other languages, but this is strongly discouraged. Linux's build system only officially supports GCC as a kernel and driver compiler."

The two most commonly used desktop environments are GNOME and KDE


"A number of language bindings are available allowing applications to be written in a variety of programming languages, such as C++ (gtkmm), Java (java-gnome), Ruby (ruby-gnome2), C# (Gtk#), Python (PyGTK), Perl (gtk2-perl) and many others. The only languages currently used in applications that are part of an official GNOME desktop release are C, C# and Python."

For KDE,

Here are links to all of the source code for the most recent stable version:

Note that it is now 22 CDs worth of source code.

I tried using the search feature for packages at

but it didn't seem to work

You can type "apropos tcp/ip" at the command line, and it will tell you a list of applications and commands related to it. Then you can type use either the "info (whatever)" or "man (whatever)" commands to find out more about that and the files it uses and the related files/apps. You could then consult the source CDs referenced above to examine the appropriate source code.

See also all the tcp related stuff on this page:

as far as text editors and debian:

Last edited by ehawk; 12-23-2007 at 01:09 AM.
Old 12-23-2007, 08:37 AM   #5
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

Rep: Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968Reputation: 1968
i love the idea of a kernel being written in bash... awesome!

anyway, not about networking at all. moved to Linux - General.


networking, wifi

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to view source code nick021 Linux - Newbie 4 02-13-2006 12:51 AM
Linux source-code tejprakash_kolla Linux - General 2 10-29-2005 04:54 PM
Get Source Code for Linux seventhsense Linux - Software 6 07-12-2005 04:44 AM
where i will get the source code of Linux?? and ... nazib Linux - General 1 02-16-2005 02:28 AM
source code for tree view ambitionless Programming 0 09-13-2004 09:39 AM

All times are GMT -5. The time now is 07:45 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration