Social Icons

Thursday, December 19, 2013

video tutorials on youtube

Linux programming and Kernel development video tutorials will be uploaded into youtube on 10/feb/2014.......
Channel name " kernelarmy ".

          " KNOWLEDGE INCREASES WHEN SHARED "

UNDERSTANDING LINKER...............ARTICLE 16

UNDERSTANDING LINKER

Linker is a tool which will link the libraries to the executable file. This is the definition I have learned as a child. I used to believe that linking of the libraries is the sole purpose of using the linker.
               Later is when I realized linker is the most important tool in the entire tool chain. It has a number of functionalities. We will discuss most of them in this article.
(note:  I wont be discussing anything about the linker script as I am not very familiar with it.)


WHAT IS THE FUNCTIONALITY OF THE LINKER...?

The Linker is the most important tool in the gcc tool chain. We already know that we use many library functions in C and C++. Some of the examples are printf(), scanf(), pow() etc.. These functions are defined in the standard C library and we use the linker to link these libraries into the source code. Well, let me give you more clarity about this. At the time of GNU project one of their most remarkable works is GNU compiler and the standard C library which is called as GLIBC. We can download this from the Linux.org website. 
                                                    We know the functionality of the functions. We write functions for the purpose of reusability. In the same way libraries are also written for the reusability. The library functions like printf(), scanf() etc .. we do not write the code for its functionality. Its already present in the standard C library called glibc. What we do is we just embed that code into our executable file and run it. Now who will embed the library functions code into our soucecode?.. Its the Linker. The Linker will detect what are the libraries required and will automatically link them into our source code. The Linker can also be used to create user defined libraries. 

WHICH TOOL THE LINKER USES...?

Well I have shown you the step by step compilation of a program add.c. We have performed the first three stages of the compilation i.e the pre-processing phase, compiler and the assembler. (refer previous posts on understanding pre-processor, compiler, assembler). The assembler's output is an object file. The object file will be taken as input by the Linker and a binary executable object file will be the output. After the assembly phase we got a file called add.o which is an object file. This will be taken by the Linker for further processing. Please refer previous articles in case you did not understand.
 In the above screen shot you can see that there are  four files in my directory. add.c is my source code file. The order is in the following manner.           

                                                                            add.c(source code)
                                                                               ||
                                                                            CC1(pre-processor)
                                                                               ||
                                                                            add.i  
                                                                               ||
                                                                            CC1(compiler)
                                                                               ||
                                                                            add.s
                                                                               || 
                                                                              AS(assembler)
                                                                               ||
                                                                           add.o  
                                                                               ||
                                                                           LD(linker)
                                                                               || 
                                                                           add.exe
  
The add.exe is the executable file generated by the linker. Its not important to have the ' .exe ' extension. Lets now perform the fourth phase of the compilation. We have used different flags to tell the compiler to invoke a specific tool inorder to perform the step by step compilation. In case of the linker we need not give any flags. Look at the below screen shot.
I am passing the assembler's output to the gcc compiler and generating an executable file. The executable files are displayed in green colour.
Here when I executed the command ' ls ' it displays all the contents in the directory and we can see that there is add.exe which is the executable file. Lets now execute this file and see what's the output generated.
We can execute the file by doing ./ add.exe. The output is saying that " THE VALUE OF C IS 30 ". If you remember we wrote a C program which adds the values of A and B and stores the output in C. 
  

THE VERBOSE OUTPUT OF THE LINKER..

command:-- gcc -v add.o   -o  add.exe

 The Linker will first read a file called specs and it will load all the required libraries, check the flags.. well very similar to that of those previous tools. It uses a tool called ld. linux.so.2 is the linker which the gcc is using. The most important thing to notice here is how it is linked. We will discuss about all that in the next article.

Tuesday, December 17, 2013

UNDERSTADING ASSEMBLER.............ARTICLE 15

ASSEMBLER

 WHAT IS AN ASSEMBLER??????

Basically assembler is a tool which will take part in the compilation process. It will take the output generated by the compiler and convert it into machine instructions which the computer will understand. When I am referring the terms compiler and compilation, please be aware that both are different. 
Compiler is a tool and compilation is a process of converting the high level language written source code into machine understandable instructions.
                              So, we have already seen how the stages of compilation. The assembler will be invoke in the third stage of the compilation process. The output generated by the compiler which will have an extension ' .s ' i.e filename.s will be taken as input by the assembler and will be converted into machine readable instructions. The file generated is called  as the object file.

 HOW THE ASSEMBLER WORKS

Now we will see how the assembler will work. I am assuming that anyone who is reading this article has read the previous articles. If any confusion arises please follow my old articles. I am covering each and every topic very systematically.
                                          So coming to the assembler we have already seen what the compiler will generate as an output. The output generated by the compiler is used as the input by the assembler tool.

We are going to do a step by step compilation of a C program. In my last two posts on understanding the preprocessor and the compiler I used a C program "add.c". If you have not read those two previous posts of mine I am afraid some of you might feel it difficult to understand this article. Well I am assuming you have already read those two previous posts. So after the compilation we get the output file add.s which will be used as the input file for the assembler.

  Here I did an ls command to display the files I have currently in my directory. We got the output generated by the compiler i.e the tool called cc1 which generated the add.s which will be input to the assembler.


HOW TO INVOKE THE ASSEMBLER???


We have previously invoked the pre-processor and the compiler independently. To invoke the assembler the command is  gcc  -c  add.s  -o  add.o
 The output generated will be an object file called add.o . This file will contain the machine instructions which will be used by the linker.


The path followed by the assembler is similar to that of the pre-processor and the compiler. I am going to execute the above command with a " -v " flag which will give the verbose output. The path followed will be similar to that of the pre-processor and the compiler except for the tool i.e assembler uses a tool called " as " where as the compiler and pre-processor will use a tool called the cc1.

gcc  -c -v  add.s  -o add.o


The above screen shot will help you locate the tool " as ". Rest of the process followed by the assembler is similar to that of the pre-processor and the compiler. Please refer the previous articles for more clarity.

Monday, December 2, 2013

UNDERSTAND COMPILER.............ARTICLE 14

COMPILER

In my last post I have discussed about the pre-processor and how it works. Lets have a look on how the compiler is playing the major part in the process of compilation. Here when I am referring to the terms compilation and compiler, they are not the same. Compilation is the process of converting the source code of the program and converting it into a binary executable file. 
                                                       
                                                             Compiler is the tool we use to convert the pre-processed code into assembly instructions. If you have not referred my last post on preprocessor I recommend you to read that article first. This article is a continuation of the previous article.

WHAT IS THE COMPILER???

A compiler is a tool. In the compilation process we will come across 4 major phases. The compiler is the tool that is used in the second phase of compilation. It will convert the pre-processed output generated by the pre-processor into assembly instruction set.

HOW THE COMPILER WORKS???

By now I am assuming whoever is reading this is already familiar with the first phase of compilation i.e the pre-processor and how the pre-processor works. The compiler comes into action in the second phase of compilation. The output generated by the pre-processor will have a " .i " extension to it. A file with a  ' .i ' extension states that its a pre-processed code. 

For example:  anyfilename.i  means that its a pre-processed output.

                                           The compiler will take the pre-processed output of the pre-processor and convert it into assembly instructions which is an intermediate code. (not purely machine level code) 
 In the last article I have written a program to add two numbers and  pre-processed the sourcecode which generated an output add1.i. As I mentioned earlier its a pre-processed output which will be the input to the compiler.

INVOKING THE COMPILER:

Here I will first write the command to perform the second phase of compilation such that it will stop after the  second step.

                                            gcc  -S  app1.i   -o   app2.s

Here I am instructing the gcc that invoke the compiler tool. The " -S " flag  instructs the gcc to invoke the compiler tool and take the add1.i as the input for the compiler. The compiler will now process the add1.i  pre-processed file and convert it into an assembly instructions . The assembly code will be pushed into a file called " add2.s ". This file is the container of the assembly code and has an extension " .s " which indicates that the file contains the assembly code inside the file.

check out the below screenshots:
  This means that in my temp directory I have the source code file add.c and the pre-processed output add1.c. Now lets invoke the compiler and convert the add1.i into an assembly instruction set add2.s

 Now I want you to clearly observe the above screen shot. I have executed the command to perform the second phase of the compilation and then executed a command to display the list of files in my directory. Now I have three file, add2.s is now added to the directory temp.

The add2.s is the assembly output given by the gcc. Lets use the " -v " flag to get the verbose output and know exactly the approach of the compiler tool.

command:    gcc  -S  -v  app1.i  -o  app2.s

When I execute the above command it will display the approach taken by the compiler tool to generate the assembly instructions.


 After executing the above command we will get an output like this.


What the Gcc does is initially it will read a file called " specs " which we can refer as the specifications. This file is automatically installed when the Ubuntu is installed. It tells the compiler where to look and what to look for. The next step is the target. Gcc will check  for which platform it is generating the code. Here in my machine its showing  " Target: i686-linux-gnu "

After this step there will be some verifications and validation performed by the gcc and the gcc will look for the options or flags or switches we have provided to it. 

COLLECT_GCC_OPTIONS='-S' '-v' '-o' 'add2.s' '-mtune=generic' '-march=i686'

The additional flags which are required will be provided by the gcc itself.

Observe carefully the below screen shot.
 
 
gcc will now call the tool called " cc1". cc1 is the tool which will compile the pre-processed code into an assembly code. The tool cc1 will perform both the pre-processing as well as the compiler operations. The operation it needs to perform will depend on the flag we provide to it. If we give the  
" -E " flag, cc1 will perform the pre-processing and if we give the " -S " flag, cc1 will act as a compiler. One more important thing we need to observe is that its showing that the file is already pre-processed. I have clearly highlighted it. 
                                                     
                                                            The next step it does is it will load all the dependent components and will convert the per-processed code into an assembly code.

LETS OPEN THE ASSEMBLY FILE add2.s

file is a command we can use to determine the type of file. The syntax is very simple file <<filename>>

Its showing that the add2.s is an ASCII PROGRAM TEXT, which means that it can be opened using normal text editors. We will use the Vim editor to open the file.. (SYNTAX   VIM  <<FILENAME>>)

 The assembly instruction the gcc generates is specific to the architecture. My machine is using the x86 architecture hence gcc will generate the assembly output for my specific architecture. If we use any other architecture then the gcc will generate the assembly for that specific architecture. 

                                                The reason why the assembly output is architecture specific is because all the architectures may or may not have the same set of registers and same number of registers. The processor will only understand its specific instruction set. The registers in arm architecture and the x86 will be different. Hence the compiler will generate the assembly code specific to the architecture. 

Observe the assembly output carefully. You can find the main function as 
" main: ".
At this point it will be difficult for you to follow and understand the assembly code if you are new to this. I will write an article in future on how to understand the assembly code.

Thursday, November 28, 2013

UNDERSTAND PRE-PROCESSOR.............ARTICLE 13

  PRE PROCESSOR

We have already seen how to compile a program using a gcc compiler and each step involved in the process of compilation. The gcc is a compiler tool chain, i.e its a set of tools or a collection of tools. Gcc acts as a wrapper for all these tools. In the process of compilation we came across 4 steps on how gcc compiles a program into an executable binary output file. (refer my old article stages of compilation)

                                                       The first phase of the compilation process is the pre-processing phase where the given input program will pre-processed to generate a specific output which will be taken as input by the other tools involved in the compilation process. Lets now study about the pre-processor and learn how it processes the .c file.

WHAT IS MEANT BY PRE-PROCESSING???

Pre-processing can be generally as a process where we prepare any entity for some specific application so that it produces a better outcome. In relevance to computer science, pre-processing can be explained as a process where we take an input data or program make certain optimizations and  modifications
and produce an output which will be used by an other application.

PRE-PROCESSING IN GCC

The pre-processing phase is the first and foremost step in the stages of compilation. The pre-processor will process all the " # " derivatives in the program like #include, #define, #ifdef, #endif etc and substitute them with the necessary code. This is the general functionality of the pre-processor. 

 TOOL USED FOR PRE-PROCESSING

The tool used by the gcc to perform the pre-processing operation is called as pre-processor. When we give a program as input to the gcc it will straight away convert the program into an binary executable but, if we can also instruct the gcc to stop after performing the first phase of compilation. 

                                                      Consider the below C program add.c. Its a very simple program for addition of two number.
The above program is a very simple program which will take two numbers a and b,  add the values and store the output in the variable c. The program has only a single print statement. If we are to compile this program normally we use the command gcc <<filename.c>>  and an executable binary file a.out will be a created.

                                           Let us perform only the first stage of compilation by instructing the gcc to perform only the pre-processing. Now the gcc invokes the pre-processor and then it stops. Now what we are going to do is simply type the following command below

command:   gcc <<filename.c>>   -E  -o  <<outputfilename.i>>.

Here the gcc is provided with a special flag " -E "  after the filename. This flag will instruct the gcc to invoke the pre-processor and create an outputfile with a " .i " extension. This extension specifies that its a pre-processed file.

Lets pre-process the code for adding the two numbers.

Here what I have done above is I pre-processed the file add.c and pushed the output into a file add1.i.
If you observe carefully the above screen-shot its clear that when I did an ls command its displaying a file called add.i in green font which is the pre-processed file.
                                                             The is a command called " file " which will take the file name as input and display the file type as the output.
Lets check the filetype of add1.i

 Here its showing that add1.i is  an ASCII text file, which means it can be opened using a regular text editor. 
lets open the  add1.i  pre-processes file using the vim text editor. The command to open add1.i is 
vim add1.i
cd temp



The above screen-shot displays only a small part of the entire file. I have scrolled down about 19% of the entire file which is shown at the below right end of the screen-shot. Check out the below video.

In this video I am showing you the entire pre-processed output of the add.c program. The pre-processor processed all the " # " derivatives i.e in this context the # include <stdio.h> line was processed by the pre-processor. At the end of the below clip I will clearly show you that only the # derivatives were only processed by the pre-processor and the rest of the code is completely untouched by the pre-processor.




 Hence we can conclude that pre-processor will only understand the # derivatives and it will process all the lines which starts with " # ". The contents of the header file stdio.h was replaced into the program as the compilers cant understand the header files. So, the pre-processor processes the macros for the compiler for compilation.
  

HOW PRE-PROCESSORS LOOKS FOR THE FILE AND PROCESSES

Well by now you might have understood what is the functionality of the pre-processor. Let us now learn how the pre-processor looks for the file and what are conditions are evaluated by the pre-processor.
There is a flag called " -v " called verbose. Most of the commands  can work with this flag. This will give us the verbose output along with the output of the command. The verbose output means the compiler will give comments regarding what all operations it performed while generating the output.
                                                            By using this -v flag we can check what the pre-processor is actually doing while generating the pre-processed file.

command:     gcc add.c -E -v -o add1.i


 The output generated by the above command will look like this.

  This is what the pre-processor does while building the pre-processed output of a c program. Now I know its looking very messy and difficult to follow. The first operation the pre-processor does is, it reads a file called  " SPECS ". 
  It is the specifications file which will tell the pre-processor what tasks to perform. The next step gcc does it will look for the target platform i.e for which platform and processor it should start building the iouput. Here in my system its showing i686-linux-gnu, which is my architecture. I hope I don't have to place a screen-shot of that line. Its specified in the fourth line. The next few lines indicate that the machine is verifying all the system dependent components and libraries required. Now when all the verifications and validations are over it will invoke the pre-processor tool called " CC1 ". 
                                                                 CC1 is the pre-processor tool which will convert all the macros and replace the content of the header files into the add1.i file. In the below screen shot I have highlighted the CC1 tool.

The gcc will take the flags specified by us manually and the rest of the flags will be passed by the gcc implicitly. If you carefully look, you can find the compiler path which indicated where the compiler will search for the libraries. I will highlight some of the predefined library paths which is displayed in the output.

I hope I completed all the major topics related to the pre-processor. If I happen to learn anything new about the pre-processor then, I will surely add that to this article and will notify everyone about it.

Saturday, November 23, 2013

STAGES OF COMPILATION.............ARTICLE 12

GENERAL COMPILER

(You are free to skip this paragraph if you know general compilation process
The above picture shows how the steps involved in the compilation. These are the steps followed by every compiler. The first step is taking the file which contains the valid C-syntax and performing an operation  called pre-processing. After this step the output will be taken by a tool called the compiler and it will generate an assembly code. The assembly code is read by the assembler and it converts it into an object-code. The linker steps in and makes necessary modifications and converts the object code into an executable binary file or .exe file. I just went through the stages of compilation very briefly. This is the steps involved with every compiler which converts the high level language written by the user into machine instructions or the target code depending on the compiler. 

GCC COMPILER:

Lets see how the Gcc compiler works and stages involved in the compilation.

 As you observed the picture you might have got a pretty good idea that all the compilers are pretty much  similar, all of them work in a similar fashion. Our objective is to understand in detail how the Gcc works, what goes into that and what components it uses. As Linux is an OpenSource we can see each and every detail as its all open unlike the proprietary software like Turbo-C and others which hides all these steps.
                          
                                                       Whenever you present a  '.C ' file to compile and build an executable it carries out the following process of compilation in various steps. When I am mentioning the term compiler its not a single tool that I are referring, its a collection of tools. The compiler distribution called Gcc is a set of tools.

Lets take a simple C-program as an example: program which adds two numbers
 

Step 1: 

             
   The first stage of compilation in Gcc (even in any other compiler) is, when we give the .C file to the Gcc, what Gcc does is it first invokes a tool called the pre-processor. The pre-processor tool looks into the code and identifies all those line which start with   
" # "
                         
                              The syntax which are  ' # ' derivatives like  #include,  #define,  #ifdef,  #ifndef  etc, are resolved by the pre-processor. The pre-processor tries to make sense out of these lines, it tries to process and compile those ' # ' lines . Only these preprocessor directives which start with the ' # ' are resolved, rest of the source-code will remain untouched. Generally these pre-processing directives contains function prototypes which will be replaced by the compiler at the time of pre-processing phase of the compilation process.  The significance of this step will become more clear as you progress towards my future posts.

Step 2:

In the second stage of compilation Gcc uses a tool called as compiler. The input for the compiler is the output generated by the pre-processor in the first stage of compilation. The compiler takes in the pre-processed code and converts it into an assembly instruction set. It does not generate the machine code straight away. It generates the assembly instructions for the architecture we are compiling the code. This is because the assembly instructions are architecture specific. It means that that different architecture's like X86, ARM uses and understands only specific assembly code. Below is a screen shot of an assembly code in case you are not familiar with assembly.
  
                        
  Here this is an assembly instructions which my Gcc compiler generated for my X86 architecture.


Don't get confused looking at all those code. It will be pretty confusing for a beginner to understand it. As you progress through the process of learning you will slowly understand. The %eax, %edx, %ecx,... etc you are seeing are all in-fact registers we use to store the values.

                        All these instructions will be executed in a stack.


Note:-
The term compilation and compiler are totally different terms. Compiler is a tool and compilation is the whole process which is required to convert a C-program to an executable output.








Step 3:

In the third stage of compilation we will use a tool called assembler. This tool takes the output generated by the compiler as the input. The assembler takes in the assembly code and converts it into machine instructions. These machine instructions are for the C.P.U. The processor will understand only machine instructions and its the job of the assembler to generate the machine instructions. The output generated by the assembler is the object code.
                                         
                                                 Generally the machine instructions are kinda difficult to understand, but if you want to have a look on how these machine instructions look like, I have placed a screen shot below.


What you are seeing above is not the exactly the way it will be stored. What I mean to say is there wont be any push, pop, add, inc ,..... etc instructions that you are seeing at the extreme left in the original object code. The tool called " objdump " which I used to open this object file which is in ELF format will convert add these extra code for the users understanding only. The actual machine instructions are on the extreme right of the screen shot above. Well in case you did not understand just look the below screen shots.
This is the machine instructions which I mentioned above. Now you must be thinking that why are the machine instructions are not in 1's and 0's.

We have learned that the processor does not understand any  format except 0's and 1's. Well thats true but the tool called objdump which I used to open the object file will convert the machine instructions to Hex format for us to understand.
 The numbers you are seeing is actually the opcode or operational code which the processor will understand. the processor cannot understand human language so opcode is used.... for example for some processors 58 number means add or subtract or multiply or some other operation. It all varies between processors. Check out your processor manual for your processor specific opcode instruction set.



These instructions you are seeing in the screen shot  are also added by the objdump tool for the user to get a better understanding of the machine instructions. 
Lets get back to the stages of compilation.









 Step 4:

In this step a tool called linker steps in takes the object code and converts in into binary executable file. It has much more functions than just creating an executable file but all that we will see soon in the future.

The above steps are same for all the compilers in the market. The proprietary compilers  like Turbo-c and other compilers which is not free unlike Gcc do not show all these steps. That's the beauty of Linux.
 

Sunday, October 6, 2013

HOW TO COMPILE USING GCC.............ARTICLE 11

HOW TO COMPILE

We have already discussed about what is GNU/C compiler. Lets see how to actually compile a program using the Gcc compiler. So, what we are looking at is to understand how to use this compiler tool chain called as Gcc. Here I am using the phrase "compiler tool -chain", because Gcc is a compiler distribution and its not just a single tool, its a combination of tools, its a collection of different tools all under a single name called Gcc. 

TYPES OF COMPILERS:

There are two different types of compilers. 
1. Host compiler.
2. Cross compiler.

  Host compiler: 

Host compiler is the compiler which will compile the source-code and build an executable for the present architecture i.e the architecture of the system on which the Gcc is presently installed.
  

Cross compiler: 

Cross compiler is used to compile the source-code and build an executable for any specific architecture.

Architecture:

When I am using the word  architecture, I am actually referring to the arrangement of the registers, accumulator, number of registers, the data buses used in the architecture and the different components present and how they interact with the processor and each other  etc.. 

Speaking about the computer architecture,  I am using  Intel'sX86 architecture. There are many different architectures like X86, ARM etc.. The compiler we use to compile and build differ for different architectures. 
(You will understand why do we require different compilers for different architecture in my future posts).
  

How to compile:

Lets now see how to compile and build a binary-executable file for a simple C- program. Here our objective is to understand how to compile a program using the Gcc compiler distribution.

Here I am going to write a simple C-program using the Vim-editor. (If you are new to Vim-editor please check out my older posts on HOW TO USE VIM EDITOR)
Here I am inside a directory called temp. I am creating a file called firstprogram.c. This will open a new file called firstprogram.c. If a file already exists with the same name in the present directory it will open that particular file. 
 This is a very simple C-program. I am printing "MY NAME IS AKHIL ASHOKAN". I am saving it as firstprogram.c The " .c " extension is very important for the compiler to recognise it as a file with a valid C-code inside it.


 









Now I have saved this file with the above mentioned syntax displayed, and the directory temp contains a file called as firstprogram.c 

To compile the program the syntax is  gcc <<filename.c>>  -o  <<binary-executable filename>>.
Here my input filename will be firstprogram.c  and the binary-executable filename could be anything of your choice. Look at my screen-shot.

Open the screen-shot and observe carefully the syntax. 
                firstprogram.c is the file we have created just a moment ago and I am passing that file containing the C-code to the Gcc compiler.











Here the executable binary file which contains the binary code which can be executed can be given anyname of our choice. I have given the name as "anyname". 

                  Here in the syntax " -o " means that whatever executable output  the Gcc will generate is to be pushed into the file called  anyname. Now the file anyname contains the compiled output of the program firstprogram.c

                            " -o " is a flag whic I used to instruct the Gcc to push the compiled output into the file anyname. These are also called as switches. Different developer's use different name. Here the executable file called anyname is used as a container to contain the result of the compilation process.
(note: Its the alphabet " o " and not the number " 0 "just in case you get confused).












Here you can clearly observe that now there are two files in the directory temp. One is the firstprogram.c which contains the C-sourcecode and the other file is the binary-executable file called anyname which is in green colour. The colour indicates it contains binary machine instructions.

Now the first step i.e the compilation is completed. The second step is to execute the binary-executable file. To execute the executable file the synatx is as follows
syntax:  ./ <<executable filename>> 

 Here we are executing it by mentioning the path where the executable file exists. Here the dot 
" . " means the present working directory. You can see that I executed the program by giving the command " . / anyname " and the output is displayed on the console or the terminal. Here as I am in the present working directory I mentioned the dot " . " to specify that the file anyname is in the present working directory.

As I have mentioned in my older posts there is a command called pwd to know the present working directory i.e where exactly in the file system we are currently standing. 
 Here my present working directory is /home/akhil/temp.
When I mention dot " . " it simply relates to this path. This means if we know the path where the executable exists we execute the file from anywhere by simply specifying the path and the executable filename. 

Here observe carefully what I am doing is I once executed the executable-file " anyname " standing in the present directory by mentioning " ./ anyname " and we get the output.
Now I leave the directory temp using the command " cd .. " and this time I mention the path of the executable-file where exactly it is located in the file system and execute it, we got the same output. 

                                                                 This demonstration is to clarify the significance of dot " . " and what is the need of mentioning it. 

(Note:  As I have started everything from the scratch please refer older posts in case you get any queries or you can always send me your doubt through " ASKME " in the home page.