LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to view source code in LINUX? (https://www.linuxquestions.org/questions/linux-general-1/how-to-view-source-code-in-linux-608654/)

karthikg356 12-22-2007 11:36 PM

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....

Nylex 12-23-2007 12:45 AM

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).

syg00 12-23-2007 12:56 AM

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.

ehawk 12-23-2007 01:05 AM

From http://en.wikipedia.org/wiki/Linux_kernel

"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

From http://en.wikipedia.org/wiki/GNOME

"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, http://developer.kde.org/language-bindings/

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

http://cdimage.debian.org/debian-cd/...source/iso-cd/

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

I tried using the search feature for packages at

http://cdimage.debian.org/debian-cd/...source/iso-cd/

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:

http://linux.die.net/man/t.html

as far as text editors and debian:

http://debian-guide.os-finder.com/node70.html

acid_kewpie 12-23-2007 08:37 AM

i love the idea of a kernel being written in bash... awesome!

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


All times are GMT -5. The time now is 10:23 AM.