source codes

Asked by Niraj

where an i get source codes for ubuntu 7.10
if i want to get kernel sources using apt-get what is package name?
are device driver sources also included in kernel ? which programming language they are written in assemly or C ?
are different control codes used for device driver & port no.s well documented or listed ?
also where i should start analysing source codes being a beginner ?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Tony Mugan
Solved:
Last query:
Last reply:
Revision history for this message
Best Tony Mugan (tmugan) said :
#1

Open Synaptic Package Manager from the System, Administration menu and search for the "linux-source".
This is described as "Linux kernel source with Ubuntu patches"

Presumably the source code will answer some of the further questions you have but obtaining the source is the first step.

Revision history for this message
Bhavani Shankar (bhavi) said :
#2

Hello Niraj:

Here it goes one by one

Ubuntu uses the Debian Linux source code. But, you have to know that linux is a kernel (http://www.kernel.org/), and a distribution is the software (http://www.gnu.org/) bundled with it..

If you need to get source codes of single package in ubuntu you can use the command
'apt-get source packagename'

In this case its

apt-get source linux-generic

which downloads the codes for generic linux kernel

(If you want codes for kernel headers then

apt-get source linux-headers -`uname -r`)

Yes device driver files are also included in the kernel and its entirely coded in C

Device driver automatic recognition system is there in the kernel irrespective of IRQ DMA Codes and port numbers

and since you are interested in kernel and source codes I suggest you to pick a copy of Linux kernel programming by beck bohme and others (An excellent indepth book with nice documentation)

Regards

Bhavani Shankar.

Revision history for this message
Jad Madi (jad) said :
#3

1-) where an i get source codes for ubuntu 7.10

type uname -r

then
sudo apt-get source linux-image-"The result of uname -r without the quotes"

2-) are device driver sources also included in kernel ?
Some are included and some are not, all depends on the license.

3-) which programming language they are written in assembly or C?
Both http://en.wikipedia.org/wiki/Linux_kernel#Programming_languages

4-) are different control codes used for device driver & port no.s well documented or listed ?
different compared to? in general, yes, device codes are different.

5-) also where i should start analysing source codes being a beginner ?

http://lwn.net/Kernel/LDD3/

Revision history for this message
Lukas Zronek (lukas-z) said :
#4

Install the package "linux-source-2.6.22" to get the linux kernel source code (which include device driver sources) for ubuntu 7.10. The source code will be placed at /usr/src/
The linux kernel is written in C programming language, but small parts are written in the assembly language.
http://kernelnewbies.org is a good start for kernel hacking.

Revision history for this message
Niraj (kulkarniniraj) said :
#5

Thanks Tony Mugan, that solved my question.