<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>EmbLogic &#187; deepanshusharma</title>
	<atom:link href="https://www.emblogic.com/blog/author/deepanshusharma/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog</link>
	<description>Embedded System and ARM Training</description>
	<lastBuildDate>Tue, 03 Mar 2020 13:00:06 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>HOW TO USE atoi() function for conversion of strings into integers&#8230;&#8230;..</title>
		<link>https://www.emblogic.com/blog/03/how-to-use-atoi-function-for-conversion-of-strings-into-integers/</link>
		<comments>https://www.emblogic.com/blog/03/how-to-use-atoi-function-for-conversion-of-strings-into-integers/#comments</comments>
		<pubDate>Thu, 13 Mar 2014 06:15:14 +0000</pubDate>
		<dc:creator><![CDATA[deepanshusharma]]></dc:creator>
				<category><![CDATA[Data Structures with C]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=9041</guid>
		<description><![CDATA[RCS file: atoi.c,v 3 Working file: atoi.c 4 head: 1.3 5 branch: 6 locks: strict 7 access list: 8 symbolic names: 9 keyword substitution: kv 10 total revisions: 3; selected revisions: 3 11 description: 12 this program tells the use &#8230; <a href="https://www.emblogic.com/blog/03/how-to-use-atoi-function-for-conversion-of-strings-into-integers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>RCS file: atoi.c,v</p>
<p>3 Working file: atoi.c</p>
<p>4 head: 1.3</p>
<p>5 branch:</p>
<p>6 locks: strict</p>
<p>7 access list:</p>
<p>8 symbolic names:</p>
<p>9 keyword substitution: kv</p>
<p>10 total revisions: 3; selected revisions: 3</p>
<p>11 description:</p>
<p>12 this program tells the use of atoi() function</p>
<p>13 the atoi function is declared in the header file stdlib.h</p>
<p>14 in this program the string to be converted into integer contains numeric characters in the starting</p>
<p>15 the atoi converts the numeric characters encountered in string before encountering any alphabet or any special symbol into an inte ger</p>
<p>16 the atoi function returns the integer converted from string</p>
<p>17 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>18 revision 1.3</p>
<p>19 date: 2014/03/13 06:00:49; author: root; state: Exp; lines: +1 -1</p>
<p>20 this revision of program uses atoi() functon to convert a string starting with special symbols or characters</p>
<p>21 he function returns 0</p>
<p>22 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>23 revision 1.2</p>
<p>24 date: 2014/03/13 05:58:47; author: root; state: Exp; lines: +1 -1</p>
<p>25 this revision of the program has converted a string which is starting with alphaets</p>
<p>26 in this the atoi function returns 0</p>
<p>27 &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>28 revision 1.1</p>
<p>29 date: 2014/03/13 05:54:27; author: root; state: Exp;</p>
<p>30 Initial revision</p>
<p>31 =============================================================================</p>
<p>~
<a href='https://www.emblogic.com/blog/03/how-to-use-atoi-function-for-conversion-of-strings-into-integers/atoi1/'><img width="150" height="150" src="http://www.emblogic.com/blog/wp-content/uploads/2014/03/atoi1-150x150.png" class="attachment-thumbnail" alt="atoi1" /></a>
<a href='https://www.emblogic.com/blog/03/how-to-use-atoi-function-for-conversion-of-strings-into-integers/atoi2/'><img width="150" height="150" src="http://www.emblogic.com/blog/wp-content/uploads/2014/03/atoi2-150x150.png" class="attachment-thumbnail" alt="atoi2" /></a>
<a href='https://www.emblogic.com/blog/03/how-to-use-atoi-function-for-conversion-of-strings-into-integers/atoi3/'><img width="150" height="150" src="http://www.emblogic.com/blog/wp-content/uploads/2014/03/atoi3-150x150.png" class="attachment-thumbnail" alt="atoi3" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/how-to-use-atoi-function-for-conversion-of-strings-into-integers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A typical memory representation of C program</title>
		<link>https://www.emblogic.com/blog/03/a-typical-memory-representation-of-c-program/</link>
		<comments>https://www.emblogic.com/blog/03/a-typical-memory-representation-of-c-program/#comments</comments>
		<pubDate>Thu, 13 Mar 2014 05:42:29 +0000</pubDate>
		<dc:creator><![CDATA[deepanshusharma]]></dc:creator>
				<category><![CDATA[Data Structures with C]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=9039</guid>
		<description><![CDATA[A typical memory representation of C program consists of following sections. 1. Text segment 2. Initialized data segment 3. Uninitialized data segment 4. Stack 5. Heap A typical memory layout of a running process 1. Text Segment: A text segment &#8230; <a href="https://www.emblogic.com/blog/03/a-typical-memory-representation-of-c-program/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><strong>A typical memory representation of C program</strong> consists of following sections.</p>
<p>1. Text segment<br />
2. Initialized data segment<br />
3. Uninitialized data segment<br />
4. Stack<br />
5. Heap</p>
<p><a href="http://d2o58evtke57tz.cloudfront.net/wp-content/uploads/Memory-Layout.gif"><img src="http://d2o58evtke57tz.cloudfront.net/wp-content/uploads/Memory-Layout-300x255.gif" alt="" width="400" height="335" /></a><br />
A typical memory layout of a running process</p>
<p><strong>1. Text Segment:</strong><br />
A text segment , also known as a code segment or simply as text, is one of the sections of a program in an object file or in memory, which contains executable instructions.</p>
<p>As a memory region, a text segment may be placed below the heap or stack in order to prevent heaps and stack overflows from overwriting it.</p>
<p>Usually, the text segment is sharable so that only a single copy needs to be in memory for frequently executed programs, such as text editors, the C compiler, the shells, and so on. Also, the text segment is often read-only, to prevent a program from accidentally modifying its instructions.</p>
<p><strong>2. Initialized Data Segment:</strong><br />
Initialized data segment, usually called simply the Data Segment. A data segment is a portion of virtual address space of a program, which contains the global variables and static variables that are initialized by the programmer.</p>
<p>Note that, data segment is not read-only, since the values of the variables can be altered at run time.</p>
<p>This segment can be further classified into initialized read-only area and initialized read-write area.</p>
<p>For instance the global string defined by char s[] = “hello world” in C and a C statement like int debug=1 outside the main (i.e. global) would be stored in initialized read-write area. And a global C statement like const char* string = “hello world” makes the string literal “hello world” to be stored in initialized read-only area and the character pointer variable string in initialized read-write area.</p>
<p>Ex: static int i = 10 will be stored in data segment and global int i = 10 will also be stored in data segment</p>
<p><strong>3. Uninitialized Data Segment:</strong><br />
Uninitialized data segment, often called the “bss” segment, named after an ancient assembler operator that stood for “block started by symbol.” Data in this segment is initialized by the kernel to arithmetic 0 before the program starts executing</p>
<p>uninitialized data starts at the end of the data segment and contains all global variables and static variables that are initialized to zero or do not have explicit initialization in source code.</p>
<p>For instance a variable declared static int i; would be contained in the BSS segment.<br />
For instance a global variable declared int j; would be contained in the BSS segment.</p>
<p><strong>4. Stack:</strong><br />
The stack area traditionally adjoined the heap area and grew the opposite direction; when the stack pointer met the heap pointer, free memory was exhausted. (With modern large address spaces and virtual memory techniques they may be placed almost anywhere, but they still typically grow opposite directions.)</p>
<p>The stack area contains the program stack, a LIFO structure, typically located in the higher parts of memory. On the standard PC x86 computer architecture it grows toward address zero; on some other architectures it grows the opposite direction. A “stack pointer” register tracks the top of the stack; it is adjusted each time a value is “pushed” onto the stack. The set of values pushed for one function call is termed a “stack frame”; A stack frame consists at minimum of a return address.</p>
<p>Stack, where automatic variables are stored, along with information that is saved each time a function is called. Each time a function is called, the address of where to return to and certain information about the caller’s environment, such as some of the machine registers, are saved on the stack. The newly called function then allocates room on the stack for its automatic and temporary variables. This is how recursive functions in C can work. Each time a recursive function calls itself, a new stack frame is used, so one set of variables doesn’t interfere with the variables from another instance of the function.</p>
<p><strong>5. Heap:</strong><br />
Heap is the segment where dynamic memory allocation usually takes place.</p>
<p>The heap area begins at the end of the BSS segment and grows to larger addresses from there.The Heap area is managed by malloc, realloc, and free, which may use the brk and sbrk system calls to adjust its size (note that the use of brk/sbrk and a single “heap area” is not required to fulfill the contract of malloc/realloc/free; they may also be implemented using mmap to reserve potentially non-contiguous regions of virtual memory into the process’ virtual address space). The Heap area is shared by all shared libraries and dynamically loaded modules in a process.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/a-typical-memory-representation-of-c-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to give command line arguments to a self defined command created using shell scripting?</title>
		<link>https://www.emblogic.com/blog/03/how-to-give-command-line-arguments-to-a-self-defined-command-created-using-shell-scripting/</link>
		<comments>https://www.emblogic.com/blog/03/how-to-give-command-line-arguments-to-a-self-defined-command-created-using-shell-scripting/#comments</comments>
		<pubDate>Sat, 08 Mar 2014 06:24:19 +0000</pubDate>
		<dc:creator><![CDATA[deepanshusharma]]></dc:creator>
				<category><![CDATA[Shell Scripts]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8950</guid>
		<description><![CDATA[&#160; this script uses two arguments given while using the command (script name) which it uses to replace $1 (first argument) $2 (second argument).]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.emblogic.com/blog/03/how-to-give-command-line-arguments-to-a-self-defined-command-created-using-shell-scripting/screenshot-from-2014-03-08-114356/" rel="attachment wp-att-8951"><img class="alignnone size-medium wp-image-8951" src="http://www.emblogic.com/blog/wp-content/uploads/2014/03/Screenshot-from-2014-03-08-114356-300x168.png" alt="" width="300" height="168" /></a></p>
<p>&nbsp;</p>
<p>this script uses two arguments given while using the command (script name) which it uses to replace $1 (first argument) $2 (second argument).</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/how-to-give-command-line-arguments-to-a-self-defined-command-created-using-shell-scripting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where Are the Linux Kernel Files?</title>
		<link>https://www.emblogic.com/blog/03/where-are-the-linux-kernel-files/</link>
		<comments>https://www.emblogic.com/blog/03/where-are-the-linux-kernel-files/#comments</comments>
		<pubDate>Sat, 08 Mar 2014 05:00:09 +0000</pubDate>
		<dc:creator><![CDATA[deepanshusharma]]></dc:creator>
				<category><![CDATA[Project 1: A Linux Administration based Project]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8948</guid>
		<description><![CDATA[The kernel file, in Ubuntu, is stored in your /boot folder and is called vmlinuz-version. The name vmlinuz comes from the unix world where they used to call their kernels simply “unix” back in the 60?s so Linux started calling &#8230; <a href="https://www.emblogic.com/blog/03/where-are-the-linux-kernel-files/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><img src="http://cdn.howtogeek.com/wp-content/uploads/2010/10/image325.png" alt="" width="614" height="231" border="" /></p>
<p>The kernel file, in Ubuntu, is stored in your /boot folder and is called vmlinuz-<em>version</em>. The name vmlinuz comes from the unix world where they used to call their kernels simply “unix” back in the 60?s so Linux started calling their kernel “linux” when it was first developed in the 90?s.</p>
<p>When virtual memory was developed for easier multitasking abilities, “vm” was put at the front of the file to show that the kernel supports virtual memory. For a while the Linux kernel was called vmlinux, but the kernel grew too large to fit in the available boot memory so the kernel image was compressed and the ending x was changed to a z to show it was compressed with zlib compression. This same compression isn’t always used, often replaced with LZMA or BZIP2, and some kernels are simply called zImage.</p>
<p>The version numbering will be in the format A.B.C.D where A.B will probably be 2.6, C will be your version, and D indicates your patches or fixes.</p>
<p><img src="http://cdn.howtogeek.com/wp-content/uploads/2010/10/kernel-files.png" alt="" width="433" height="215" /></p>
<p>In the /boot folder there will also be other very important files called initrd.img-version, system.map-version, and config-version. The initrd file is used as a small RAM disk that extracts and executes the actual kernel file. The system.map file is used for memory management before the kernel fully loads, and the config file tells the kernel what options and modules to load into the kernel image when the it is being compiled.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/where-are-the-linux-kernel-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how to interpret complex declarations in C</title>
		<link>https://www.emblogic.com/blog/03/how-to-interpret-complex-declarations-in-c/</link>
		<comments>https://www.emblogic.com/blog/03/how-to-interpret-complex-declarations-in-c/#comments</comments>
		<pubDate>Mon, 03 Mar 2014 05:58:08 +0000</pubDate>
		<dc:creator><![CDATA[deepanshusharma]]></dc:creator>
				<category><![CDATA[Data Structures with C]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8764</guid>
		<description><![CDATA[Complicated declarations in C Most of the times declarations are simple to read, but it is hard to read some declarations which involve pointer to functions. For example, consider the following declaration from “signal.h”. void (*bsd_signal(int, void (*)(int)))(int); Let us &#8230; <a href="https://www.emblogic.com/blog/03/how-to-interpret-complex-declarations-in-c/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<div>
<div>
<div>
<div>
<h2>Complicated declarations in C</h2>
</div>
<div>
<p>Most of the times declarations are simple to read, but it is hard to read some declarations which involve pointer to functions. For example, consider the following declaration from “signal.h”.</p>
<div>
<div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code>void</code> <code>(*bsd_signal(</code><code>int</code><code>, </code><code>void</code> <code>(*)(</code><code>int</code><code>)))(</code><code>int</code><code>);</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Let us see the steps to read complicated declarations.</p>
<p><strong>1)</strong> Convert C declaration to postfix format and read from left to right.<br />
<strong>2)</strong> To convert experssion to postfix, start from innermost parenthesis, If innermost parenthesis is not present then start from declarations name and go right first. When first ending parenthesis encounters then go left. Once whole parenthesis is parsed then come out from parenthesis.<br />
<strong>3) </strong> Continue until complete declaration has been parsed.</p>
<p>Let us start with simple example. Below examples are from “K &amp; R” book.</p>
<div>
<div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code>1)  </code><code>int</code> <code>(*fp) ();</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Let us convert above expression to postfix format. For the above example, there is no innermost parenthesis, that’s why, we will print declaration name i.e. “fp”. Next step is, go to right side of expression, but there is nothing on right side of “fp” to parse, that’s why go to left side. On left side we found “*”, now print “*” and come out of parenthesis. We will get postfix expression as below.</p>
<pre>  fp  *  ()  int</pre>
<p>Now read postfix expression from left to right. e.g. fp is pointer to function returning int</p>
<p>Let us see some more examples.</p>
<div>
<div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code>2) </code><code>int</code> <code>(*daytab)[13]</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Postfix : daytab * [13] int<br />
Meaning : daytab is pointer to array of 13 integers.</p>
<div>
<div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code>3) </code><code>void</code> <code>(*f[10]) (</code><code>int</code><code>, </code><code>int</code><code>)</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Postfix : f[10] * (int, int) void<br />
Meaning : f is an array of 10 of pointer to function(which takes 2 arguments of type int) returning void</p>
<div>
<div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code>4) </code><code>char</code> <code>(*(*x())[]) ()</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Postfix : x () * [] * () char<br />
Meaning : x is a function returning pointer to array of pointers to function returnging char</p>
<div>
<div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code>5) </code><code>char</code> <code>(*(*x[3])())[5]</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Postfix : x[3] * () * [5] char<br />
Meaning : x is an array of 3 pointers to function returning pointer to array of 5 char’s</p>
<div>
<div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code>6) </code><code>int</code> <code>*(*(*arr[5])()) ()</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Postfix : arr[5] * () * () * int<br />
Meaning : arr is an array of 5 pointers to functions returning pointer to function returning pointer to integer</p>
<div>
<div>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<div>
<div><code>7) </code><code>void</code> <code>(*bsd_signal(</code><code>int</code> <code>sig, </code><code>void</code> <code>(*func)(</code><code>int</code><code>)))(</code><code>int</code><code>);</code></div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Postfix : bsd_signal(int sig, void(*func)(int)) * (int) void<br />
Meaning : bsd_signal is a function that takes integer &amp; a pointer to a function(that takes integer as argument and returns void) and returns pointer to a function(that take integer as argument and returns void)</p>
</div>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/03/how-to-interpret-complex-declarations-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>the process of booting in linux</title>
		<link>https://www.emblogic.com/blog/02/the-process-of-booting-in-linux/</link>
		<comments>https://www.emblogic.com/blog/02/the-process-of-booting-in-linux/#comments</comments>
		<pubDate>Tue, 25 Feb 2014 07:20:47 +0000</pubDate>
		<dc:creator><![CDATA[deepanshusharma]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8527</guid>
		<description><![CDATA[The following are the 6 high level stages of a typical Linux boot process. 1. BIOS BIOS stands for Basic Input/Output System Performs some system integrity checks Searches, loads, and executes the boot loader program. It looks for boot loader &#8230; <a href="https://www.emblogic.com/blog/02/the-process-of-booting-in-linux/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>The following are the 6 high level stages of a typical Linux boot process.</p>
<p>1. BIOS</p>
<p>    BIOS stands for Basic Input/Output System<br />
    Performs some system integrity checks<br />
    Searches, loads, and executes the boot loader program.<br />
    It looks for boot loader in floppy, cd-rom, or hard drive. You can press a key (typically F12 of F2, but it depends on your system) during the BIOS startup to change the boot sequence.<br />
    Once the boot loader program is detected and loaded into the memory, BIOS gives the control to it.<br />
    So, in simple terms BIOS loads and executes the MBR boot loader.</p>
<p>2. MBR</p>
<p>    MBR stands for Master Boot Record.<br />
    It is located in the 1st sector of the bootable disk. Typically /dev/hda, or /dev/sda<br />
    MBR is less than 512 bytes in size. This has three components 1) primary boot loader info in 1st 446 bytes 2) partition table info in next 64 bytes 3) mbr validation check in last 2 bytes.<br />
    It contains information about GRUB (or LILO in old systems).<br />
    So, in simple terms MBR loads and executes the GRUB boot loader.</p>
<p>3. GRUB</p>
<p>    GRUB stands for Grand Unified Bootloader.<br />
    If you have multiple kernel images installed on your system, you can choose which one to be executed.<br />
    GRUB displays a splash screen, waits for few seconds, if you don’t enter anything, it loads the default kernel image as specified in the grub configuration file.<br />
    GRUB has the knowledge of the filesystem (the older Linux loader LILO didn’t understand filesystem).<br />
    Grub configuration file is /boot/grub/grub.conf (/etc/grub.conf is a link to this). The following is sample grub.conf of CentOS.</p>
<p>    #boot=/dev/sda<br />
    default=0<br />
    timeout=5<br />
    splashimage=(hd0,0)/boot/grub/splash.xpm.gz<br />
    hiddenmenu<br />
    title CentOS (2.6.18-194.el5PAE)<br />
              root (hd0,0)<br />
              kernel /boot/vmlinuz-2.6.18-194.el5PAE ro root=LABEL=/<br />
              initrd /boot/initrd-2.6.18-194.el5PAE.img</p>
<p>    As you notice from the above info, it contains kernel and initrd image.<br />
    So, in simple terms GRUB just loads and executes Kernel and initrd images.</p>
<p>4. Kernel</p>
<p>    Mounts the root file system as specified in the “root=” in grub.conf<br />
    Kernel executes the /sbin/init program<br />
    Since init was the 1st program to be executed by Linux Kernel, it has the process id (PID) of 1. Do a ‘ps -ef | grep init’ and check the pid.<br />
    initrd stands for Initial RAM Disk.<br />
    initrd is used by kernel as temporary root file system until kernel is booted and the real root file system is mounted. It also contains necessary drivers compiled inside, which helps it to access the hard drive partitions, and other hardware.</p>
<p>5. Init</p>
<p>    Looks at the /etc/inittab file to decide the Linux run level.<br />
    Following are the available run levels<br />
        0 – halt<br />
        1 – Single user mode<br />
        2 – Multiuser, without NFS<br />
        3 – Full multiuser mode<br />
        4 – unused<br />
        5 – X11<br />
        6 – reboot<br />
    Init identifies the default initlevel from /etc/inittab and uses that to load all appropriate program.<br />
    Execute ‘grep initdefault /etc/inittab’ on your system to identify the default run level<br />
    If you want to get into trouble, you can set the default run level to 0 or 6. Since you know what 0 and 6 means, probably you might not do that.<br />
    Typically you would set the default run level to either 3 or 5.</p>
<p>6. Runlevel programs</p>
<p>    When the Linux system is booting up, you might see various services getting started. For example, it might say “starting sendmail …. OK”. Those are the runlevel programs, executed from the run level directory as defined by your run level.<br />
    Depending on your default init level setting, the system will execute the programs from one of the following directories.<br />
        Run level 0 – /etc/rc.d/rc0.d/<br />
        Run level 1 – /etc/rc.d/rc1.d/<br />
        Run level 2 – /etc/rc.d/rc2.d/<br />
        Run level 3 – /etc/rc.d/rc3.d/<br />
        Run level 4 – /etc/rc.d/rc4.d/<br />
        Run level 5 – /etc/rc.d/rc5.d/<br />
        Run level 6 – /etc/rc.d/rc6.d/<br />
    Please note that there are also symbolic links available for these directory under /etc directly. So, /etc/rc0.d is linked to /etc/rc.d/rc0.d.<br />
    Under the /etc/rc.d/rc*.d/ directories, you would see programs that start with S and K.<br />
    Programs starts with S are used during startup. S for startup.<br />
    Programs starts with K are used during shutdown. K for kill.<br />
    There are numbers right next to S and K in the program names. Those are the sequence number in which the programs should be started or killed.<br />
    For example, S12syslog is to start the syslog deamon, which has the sequence number of 12. S80sendmail is to start the sendmail daemon, which has the sequence number of 80. So, syslog program will be started before sendmail.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/the-process-of-booting-in-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>creating linked list using structures and function</title>
		<link>https://www.emblogic.com/blog/02/creating-linked-list-using-structures-and-function/</link>
		<comments>https://www.emblogic.com/blog/02/creating-linked-list-using-structures-and-function/#comments</comments>
		<pubDate>Sat, 22 Feb 2014 11:51:42 +0000</pubDate>
		<dc:creator><![CDATA[deepanshusharma]]></dc:creator>
				<category><![CDATA[Data Structures with C]]></category>

		<guid isPermaLink="false">http://www.emblogic.com/blog/?p=8480</guid>
		<description><![CDATA[RCS file: header.h,v Working file: header.h head: 1.10 branch: locks: strict access list: symbolic names: keyword substitution: kv total revisions: 10; selected revisions: 10 description: created a header file including all predefined header files. learnt that header file &#8220;string.h&#8221; is &#8230; <a href="https://www.emblogic.com/blog/02/creating-linked-list-using-structures-and-function/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[
<a href='https://www.emblogic.com/blog/02/creating-linked-list-using-structures-and-function/screenshot/'><img width="150" height="150" src="http://www.emblogic.com/blog/wp-content/uploads/2014/02/Screenshot-150x150.png" class="attachment-thumbnail" alt="Screenshot" /></a>
<a href='https://www.emblogic.com/blog/02/creating-linked-list-using-structures-and-function/screenshot-1/'><img width="150" height="150" src="http://www.emblogic.com/blog/wp-content/uploads/2014/02/Screenshot-1-150x150.png" class="attachment-thumbnail" alt="Screenshot-1" /></a>
<a href='https://www.emblogic.com/blog/02/creating-linked-list-using-structures-and-function/screenshot-2/'><img width="150" height="150" src="http://www.emblogic.com/blog/wp-content/uploads/2014/02/Screenshot-2-150x150.png" class="attachment-thumbnail" alt="Screenshot-2" /></a>

<p>RCS file: header.h,v<br />
Working file: header.h<br />
head: 1.10<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 10; selected revisions: 10<br />
description:<br />
created a header file including all predefined header files.<br />
learnt that header file &#8220;string.h&#8221; is required for using memset function<br />
learnt that memset retutrns a void pointer to the memory block which we hav set with a constant character.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.10<br />
date: 2014/02/22 10:38:23; author: root; state: Exp; lines: +8 -10<br />
made changes in the body of function createnode.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.9<br />
date: 2014/02/22 10:27:31; author: root; state: Exp; lines: +2 -2<br />
*** empty log message ***<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.8<br />
date: 2014/02/22 10:18:52; author: root; state: Exp; lines: +9 -3<br />
created oother node than the starting node<br />
declared a new pointer in the body of function createnode which will always point to new node.<br />
this new pointer is given the address stored in &#8220;next&#8221; pointer of the start node.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.7<br />
date: 2014/02/22 09:54:32; author: root; state: Exp; lines: +1 -1<br />
syntax error removed<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.6<br />
date: 2014/02/22 09:52:30; author: root; state: Exp; lines: +2 -2<br />
made changes in prototype and definition of the function createnode<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.5<br />
date: 2014/02/22 09:43:32; author: root; state: Exp; lines: +3 -3<br />
again changed the parameters passed in the body of the function createnode<br />
learnt we can find out the address of a pointer simply by using &amp;pointer<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.4<br />
date: 2014/02/22 09:17:47; author: root; state: Exp; lines: +6 -6<br />
mentioned the type of arguments in the prototype of createnode<br />
passed the arguments using pass by refference<br />
changed the function body<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.3<br />
date: 2014/02/22 08:49:00; author: root; state: Exp; lines: +9 -0<br />
created a function for creating start node<br />
declared the prototype of createnode<br />
defined the body of createnode<br />
returned a value flag = 1 if the node is created succesfully<br />
catching of the returned vallue in the main function is necessary<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/02/22 08:09:18; author: root; state: Exp; lines: +11 -0<br />
declared a structured data type linked.<br />
members of struct link are<br />
int info<br />
a pointer next of structured type linked<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/02/22 08:04:00; author: root; state: Exp;<br />
Initial revision<br />
=============================================================================<br />
#include</p>
<header>main()<br />
{<br />
struct linked *start;int flag=0,p;<br />
p=createnode(&amp;start,&amp;flag);</p>
<p>if(p)<br />
{ printf(&#8220;starting node created successfully\n&#8221;);</p>
<p>printf(&#8220;%p\n&#8221;,start);<br />
printf(&#8220;%d&#8221;,sizeof(struct linked));</p>
<p>}</p>
<p>}</p>
<p>RCS file: linkedlist.c,v<br />
Working file: linkedlist.c<br />
head: 1.2<br />
branch:<br />
locks: strict<br />
access list:<br />
symbolic names:<br />
keyword substitution: kv<br />
total revisions: 2; selected revisions: 2<br />
description:<br />
created a pointer of struct linked type<br />
allocated memory to the pointer using malloc<br />
checked if the start pointer is not null<br />
the size of the struct linked printed on the console<br />
the address of the starting node printed on the console<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.2<br />
date: 2014/02/22 09:56:31; author: root; state: Exp; lines: +7 -3<br />
first node of linkedlist created using function createnode successfully<br />
pass by referrence method use to pass the addresses of the arguments to the createnode function by main function<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
revision 1.1<br />
date: 2014/02/22 08:21:38; author: root; state: Exp;<br />
Initial revision<br />
=============================================================================</p>
</header>
]]></content:encoded>
			<wfw:commentRss>https://www.emblogic.com/blog/02/creating-linked-list-using-structures-and-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
