<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4948109321544571569</id><updated>2025-05-24T01:28:06.306+05:30</updated><category term="PROGRAMMING"/><category term="MISC"/><category term="PICTURES"/><category term="DIARY"/><category term="Automation"/><category term="FUN"/><title type='text'>Nabendu&#39;s Blog</title><subtitle type='html'>Diary,Technology,Programming,Short story, pictures,</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>75</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-1735513917348029219</id><published>2014-09-20T14:35:00.000+05:30</published><updated>2014-09-20T14:35:06.033+05:30</updated><title type='text'>Linux process Id&#39;s</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot;&gt;Linux process Id&#39;s&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot;&gt;Scheduler is is the first process to initialize the paging etc..&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot;&gt;Process ID Description:&lt;/span&gt;&lt;br style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot;&gt;0 The Scheduler&lt;/span&gt;&lt;br style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot;&gt;1 The init process&lt;/span&gt;&lt;br style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot;&gt;2 kflushd&lt;/span&gt;&lt;br style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot;&gt;3 kupdate&lt;/span&gt;&lt;br style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot;&gt;4 kpiod&lt;/span&gt;&lt;br style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot;&gt;5 kswapd&lt;/span&gt;&lt;br style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: #f0f0f0; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px;&quot;&gt;6 mdrecoveryd&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/1735513917348029219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/1735513917348029219' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/1735513917348029219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/1735513917348029219'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2014/09/linux-process-ids.html' title='Linux process Id&#39;s'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-7057219005036576758</id><published>2014-09-04T19:29:00.000+05:30</published><updated>2014-09-04T19:32:54.981+05:30</updated><title type='text'>SMD component Cheatsheet by NXP</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;iframe src=&quot;http://docs.google.com/viewer?url=http%3A%2F%2Fwww.nxp.com%2Fdocuments%2Fother%2FDiscretes_package_poster.pdf&amp;embedded=true&quot; width=&quot;590&quot; height=&quot;440&quot; style=&quot;border: none;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/7057219005036576758/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/7057219005036576758' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/7057219005036576758'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/7057219005036576758'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2014/09/smd-component-cheatsheet-by-nxp.html' title='SMD component Cheatsheet by NXP'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-5556612285569047622</id><published>2013-10-31T23:10:00.003+05:30</published><updated>2014-05-10T16:02:17.551+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>How malloc works in userspace</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I was checking how malloc work as compared to kernel kmalloc in term of physical memory allocation.What I found as below..&lt;br /&gt;
Glibc/C libary implement the malloc implementation,&lt;br /&gt;
For memory less than 128kb use brk()/sbrk&lt;br /&gt;
more than that use mmap with&amp;nbsp;&amp;nbsp;MAP_PRIVATE|MAP_ANONYMOUS&lt;br /&gt;
&lt;br /&gt;
for test ran a small program on userspace I wrote&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;void main()&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; int *a;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp; a =(int*)malloc(150*1024);&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;/* mmap invocation */&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp; &amp;nbsp;//a =(int*)malloc(10); /* brk invocation */&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
and ran strace on the o/p, there I can see brk and mmap invocation.What I understood from brk call.It increases the data section (Thr Brk limit) and add the memory to malloc.In mmap anonymous private pages are allocated by kernel and added as one vma section of process address space,From there glibc allocate memory and give it to malloc.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
more details :&lt;br /&gt;
&lt;a href=&quot;http://www.gnu.org/software/libc/manual/html_node/Resizing-the-Data-Segment.html&quot;&gt;Link1&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www2.cs.uregina.ca/~hamilton/courses/330/notes/unix/memory/brk-notes.txt&quot;&gt;Link2&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;https://sourceware.org/ml/libc-alpha/2006-03/msg00033.html&quot;&gt;Link3&lt;/a&gt;&lt;br /&gt;
bestone__&amp;nbsp;&lt;a href=&quot;http://stackoverflow.com/questions/3479330/how-is-malloc-implemented-internally&quot;&gt;Best_link&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/5556612285569047622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/5556612285569047622' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/5556612285569047622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/5556612285569047622'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2013/10/how-malloc-works.html' title='How malloc works in userspace'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-5381057528002264860</id><published>2013-10-31T22:47:00.003+05:30</published><updated>2013-10-31T23:03:30.009+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>Process Virtual to Physical Translation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDktjA8lE7JKXlJdltJ2tFmH6ZcMxfJuiqGbLakIx6FOCAubibvGLWgRZI_x5KT2f038eB3AmvfzJS4_Efv78bELJeTuPiNFmRFlwpzo7dwYwevzHTGdzgsb7ykq0SIIkLkscCkZCwqyo/s1600/page_TLB_PTE.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;308&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDktjA8lE7JKXlJdltJ2tFmH6ZcMxfJuiqGbLakIx6FOCAubibvGLWgRZI_x5KT2f038eB3AmvfzJS4_Efv78bELJeTuPiNFmRFlwpzo7dwYwevzHTGdzgsb7ykq0SIIkLkscCkZCwqyo/s400/page_TLB_PTE.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/5381057528002264860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/5381057528002264860' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/5381057528002264860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/5381057528002264860'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2013/10/process-virtual-to-physical-translation.html' title='Process Virtual to Physical Translation'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDktjA8lE7JKXlJdltJ2tFmH6ZcMxfJuiqGbLakIx6FOCAubibvGLWgRZI_x5KT2f038eB3AmvfzJS4_Efv78bELJeTuPiNFmRFlwpzo7dwYwevzHTGdzgsb7ykq0SIIkLkscCkZCwqyo/s72-c/page_TLB_PTE.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-5738060028627738120</id><published>2013-10-31T16:07:00.003+05:30</published><updated>2013-11-02T02:10:03.743+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>Allocating aligned address and freeing them</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;lang-c prettyprint prettyprinted&quot; style=&quot;border: 0px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;span style=&quot;line-height: 17.99715805053711px;&quot;&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt; uintptr_t mask = ~(uintptr_t)(align - 1);
 void *mem = malloc(1024+align-1);
 void *ptr = (void *)(((uintptr_t)mem+align-1) &amp;amp; ~mask);
&lt;/span&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;ptr is the aligned address.&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;

&lt;/span&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;Some time back I faced an interview ,There I was asked to write a custom malloc using malloc
and free program for a predefined aligned address.Here is the solution.The byte before the 
aligned byte is always empty.We will keep the offset of actual memory allocated by malloc.
But there we have to allocate total memory =(desired+alignment)  instead of  
(desired+alignment-1) downside is that it can store upto 2pow8 offsets.&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;
 mallocX(size_t X,alignment Y)
{
 p= malloc(X+Y);
    ret = (p+Y) &amp;amp; ~(Y-1);
 *(ret-1) = ret - p;
    return ret;
}
similarly for free
freeX(memptr mem)
{
 free (mem - *(mem-1));
}&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/5738060028627738120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/5738060028627738120' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/5738060028627738120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/5738060028627738120'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2013/10/allocating-aligned-address-and-freeing.html' title='Allocating aligned address and freeing them'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-1790365340448685387</id><published>2013-10-27T01:14:00.002+05:30</published><updated>2013-10-27T01:14:50.917+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>Tracking Linux kworker threads</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;border: 0px; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;b&gt;How to find out which part of kernel/module has created this workqueue.&lt;/b&gt;&lt;b&gt;How to track a kworker-thread named for example &#39;&#39;kworker/0:3 to its origin in kernel-space?&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
I found&amp;nbsp;&lt;a href=&quot;https://lkml.org/lkml/2011/3/31/68&quot; style=&quot;border: 0px; color: #2b6d97; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;this thread on lkml&lt;/a&gt;&amp;nbsp;that answers your question a little. (It seems even Linus himself was puzzled as to how to find out the origin of those threads.)&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
Basically, there are two ways of doing this:&lt;/div&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 0px; color: #333333; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 13px; line-height: 20px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; color: #222222; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$ echo workqueue:workqueue_queue_work &amp;gt; /sys/kernel/debug/tracing/set_event
$ cat /sys/kernel/debug/tracing/trace_pipe &amp;gt; out.txt
(wait a few secs)
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
For this you will need&amp;nbsp;&lt;a href=&quot;http://www.elinux.org/Ftrace&quot; style=&quot;border: 0px; color: #2b6d97; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;ftrace&lt;/a&gt;&amp;nbsp;to be compiled in your kernel, and to enable it with:&lt;/div&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 0px; color: #333333; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 13px; line-height: 20px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; color: #222222; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;mount -t debugfs nodev /sys/kernel/debug
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
More information on the function tracer facilities of Linux is available in the&amp;nbsp;&lt;a href=&quot;https://www.kernel.org/doc/Documentation/trace/ftrace.txt&quot; style=&quot;border: 0px; color: #2b6d97; cursor: pointer; margin: 0px; padding: 0px; text-decoration: none; vertical-align: baseline;&quot;&gt;ftrace.txt documentation&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;border: 0px; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
This will output what threads are all doing, and is useful for tracing multiple small jobs.&lt;/div&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 0px; color: #333333; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 13px; line-height: 20px; margin-bottom: 10px; max-height: 600px; overflow: auto; padding: 5px; vertical-align: baseline; width: auto; word-wrap: normal;&quot;&gt;&lt;code style=&quot;border: 0px; color: #222222; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;cat /proc/THE_OFFENDING_KWORKER/stack
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; clear: both; color: #333333; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 15px; line-height: 20px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
This will output the stack of a single thread doing a lot of work. It may allow you to find out what caused this specific thread to hog the CPU (for example).&amp;nbsp;&lt;code style=&quot;background-color: #eeeeee; border: 0px; color: #222222; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; font-size: 13px; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;THE_OFFENDING_KWORKER&lt;/code&gt;&amp;nbsp;is the pid of the kworker in the process list. _____ by &lt;a href=&quot;http://stackoverflow.com/users/1174784/anarcat&quot; target=&quot;_blank&quot;&gt;anarcat&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/1790365340448685387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/1790365340448685387' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/1790365340448685387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/1790365340448685387'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2013/10/tracking-linux-kworker-threads.html' title='Tracking Linux kworker threads'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-1499291214010128535</id><published>2013-10-26T20:19:00.002+05:30</published><updated>2013-11-18T04:04:02.596+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>Bit reversing tips</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;western&quot; style=&quot;border: none; line-height: 0.37cm; padding: 0cm;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background-color: white; color: blue;&quot;&gt;&lt;b&gt;Reversing bit pairs&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;western&quot; style=&quot;border: none; line-height: 0.37cm; padding: 0cm;&quot;&gt;&lt;code class=&quot;western&quot; style=&quot;line-height: 0.37cm;&quot;&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;unsigned&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot; style=&quot;line-height: 0.37cm;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot; style=&quot;line-height: 0.37cm;&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot; style=&quot;line-height: 0.37cm;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt; i, j; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot; style=&quot;line-height: 0.37cm;&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;// positions of bit sequences to swap&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;western&quot; style=&quot;border: none; line-height: 0.37cm; padding: 0cm;&quot;&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;unsigned&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt; n;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;// number of consecutive bits in each sequence&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;unsigned&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt; b;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;// bits to swap reside in b&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: darkblue;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;unsigned&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: #2b91af;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;int&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt; r;    &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;// bit-swapped result goes here&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;

&lt;span style=&quot;color: darkblue;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;unsigned int x = ((b &amp;gt;&amp;gt; i) ^ (b &amp;gt;&amp;gt; j)) &amp;amp; ((1U &amp;lt;&amp;lt; n) - 1); // XOR temporary&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: darkblue;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;r = b ^ ((x &amp;lt;&amp;lt; i) | (x &amp;lt;&amp;lt; j));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;western&quot; style=&quot;border: none; line-height: 0.37cm; padding: 0cm;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;-----------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;color: blue; font-size: 10pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Another standard simple method:&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;unsigned &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;int&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt; reverseBits(unsigned &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;int&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt; num)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;unsigned &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;int&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt; count = &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: #006699;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;sizeof&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;(num) * 8 - 1;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;unsigned &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;int&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt; reverse_num = num;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;num &amp;gt;&amp;gt;= 1; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;

&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: #006699;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;while&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;(num)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;reverse_num &amp;lt;&amp;lt;= 1;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;reverse_num |= num &amp;amp; 1;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;num &amp;gt;&amp;gt;= 1;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;count--;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;reverse_num &amp;lt;&amp;lt;= count;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: #006699;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;return&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt; reverse_num;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;

&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;int&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt; main()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;unsigned &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: grey;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;int&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt; x = 1;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: deeppink;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;printf&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;(&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&quot;%u&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;, reverseBits(x));&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: deeppink;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;getchar&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #eeeeee;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;----------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, serif;&quot;&gt;&lt;span style=&quot;color: blue; font-size: x-small;&quot;&gt;&lt;b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;Another with n/2 complexity.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt; &lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;int bitreverse(int x)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt; &lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;unsigned int lmask = 0x80000000;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt; &lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;int rmask = 0x01;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt; &lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;while(mask1&amp;gt;mask2)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt; &lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;  &lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;if(!(((lmask &amp;amp;x) != 0 &amp;amp;&amp;amp; (rmask&amp;amp;x) != 0) || ((lmask &amp;amp;x)==0 &amp;amp;&amp;amp; (rmask&amp;amp;x)==0)))&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;  &lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;   &lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;x=x^lmask;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;   &lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;x=x^rmask;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;  &lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;  &lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;lmask &amp;gt;&amp;gt;=1;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;  &lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;rmask &amp;lt;&amp;lt;=1;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt; &lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt; &lt;/span&gt;&lt;/code&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;return x;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;
&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;western&quot; style=&quot;border: none; line-height: 0.37cm; padding: 0cm;&quot;&gt;&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-size: 9pt;&quot;&gt;&lt;span style=&quot;background: #ffffff;&quot;&gt;----------------------------------------------------------------&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&quot;western&quot; style=&quot;border: none; line-height: 0.37cm; padding: 0cm;&quot;&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span style=&quot;color: blue; font-size: medium;&quot;&gt;Reverse an N-bit quantity in parallel in 5 * lg(N) operations:&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;pre class=&quot;western&quot; style=&quot;margin-bottom: 0.4cm;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;unsigned int v; // 32-bit word to reverse bit order&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;western&quot; style=&quot;margin-bottom: 0.4cm;&quot;&gt;&lt;span style=&quot;font-family: Verdana, sans-serif; font-size: x-small;&quot;&gt;// swap odd and even bits
v = ((v &amp;gt;&amp;gt; 1) &amp;amp; 0x55555555) | ((v &amp;amp; 0x55555555) &amp;lt;&amp;lt; 1);
// swap consecutive pairs
v = ((v &amp;gt;&amp;gt; 2) &amp;amp; 0x33333333) | ((v &amp;amp; 0x33333333) &amp;lt;&amp;lt; 2);
// swap nibbles ... 
v = ((v &amp;gt;&amp;gt; 4) &amp;amp; 0x0F0F0F0F) | ((v &amp;amp; 0x0F0F0F0F) &amp;lt;&amp;lt; 4);
// swap bytes
v = ((v &amp;gt;&amp;gt; 8) &amp;amp; 0x00FF00FF) | ((v &amp;amp; 0x00FF00FF) &amp;lt;&amp;lt; 8);
// swap 2-byte long pairs
v = ( v &amp;gt;&amp;gt; 16             ) | ( v               &amp;lt;&amp;lt; 16);
The following variation is also O(lg(N)), however it requires more operations to reverse v. Its virtue is in taking less slightly memory by computing the constants on the fly.
unsigned int s = sizeof(v) * CHAR_BIT; // bit size; must be power of 2 
unsigned int mask = ~0;         
while ((s &amp;gt;&amp;gt;= 1) &amp;gt; 0) 
{
  mask ^= (mask &amp;lt;&amp;lt; s);
  v = ((v &amp;gt;&amp;gt; s) &amp;amp; mask) | ((v &amp;lt;&amp;lt; s) &amp;amp; ~mask);
}&lt;/span&gt;

&lt;code class=&quot;western&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;font-family: &#39;Times New Roman&#39;;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;These methods above are best suited to situations where N is large. If you use the above with 64-bit ints (or larger), then you need to add more lines (following the pattern); otherwise only the lower 32 bits will be reversed and the result will be in the lower 32 bits.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/1499291214010128535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/1499291214010128535' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/1499291214010128535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/1499291214010128535'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2013/10/bit-reversing-tips.html' title='Bit reversing tips'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-2627936069382086092</id><published>2013-10-26T17:33:00.000+05:30</published><updated>2013-10-26T17:33:47.518+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>Nice value and priority and relations</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
The&amp;nbsp;&lt;em style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;priority&lt;/em&gt;&amp;nbsp;of a process in linux is dynamic: The longer it runs, the lower its priority will be. A process&amp;nbsp;&lt;em style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;runs&lt;/em&gt;&amp;nbsp;when its actually using the CPU - most processes on a typical Linux box just wait for I/O and thus do not count as&amp;nbsp;&lt;em style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;running&lt;/em&gt;.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
The priority is taken into account when there are more processes running than CPU cores available: Highest priority wins. But as the winning process looses its proirity over time, other processes will take over the CPU at some point.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;code style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;nice&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;renice&lt;/code&gt;&amp;nbsp;will add/remove some &quot;points&quot; from priority. A process which has a higher&amp;nbsp;&lt;code style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;nice&lt;/code&gt;value will get lesser CPU time. Root can also set a negative&amp;nbsp;&lt;code style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;nice&lt;/code&gt;&amp;nbsp;value - the process gets more CPU time.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
Example: There are two processes (1 and 2) calculating the halting problem and one CPU core in the system. Default is&amp;nbsp;&lt;code style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;nice 0&lt;/code&gt;, so both processes get about half of the CPU time each. Now lets renice process 1 to value 10. Result: Process 2 gets a significant higher amount of cpu time as process 1.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
Note: In modern desktops there is plenty CPU time available - they are fast these days. Unfortunately HDDs are still relativeley slow on random I/O, so even a&amp;nbsp;&lt;em style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;nice&lt;/em&gt;&amp;nbsp;process can generate enough I/O traffic to significantly slow down a system.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #222222; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;Processes have an initial priority specified as the nice value. This value is stored in the&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;color: #222222; font-size: 13px; line-height: 19px; margin: 0px; padding: 0px;&quot;&gt;static_prio&lt;/code&gt;&lt;span style=&quot;color: #222222; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;&amp;nbsp;member of the process’s&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;color: #222222; font-size: 13px; line-height: 19px; margin: 0px; padding: 0px;&quot;&gt;task_struct&lt;/code&gt;&lt;span style=&quot;color: #222222; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;. The value is called the static priority because it does not change from what the user specifies. The scheduler, in turn, bases its decisions on the dynamic priority that is stored in&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;color: #222222; font-size: 13px; line-height: 19px; margin: 0px; padding: 0px;&quot;&gt;prio&lt;/code&gt;&lt;span style=&quot;color: #222222; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;.&amp;nbsp;&lt;/span&gt;&lt;em style=&quot;color: #222222; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19px; margin: 0px; padding: 0px;&quot;&gt;The dynamic priority is calculated as a function of the static priority and the task’s interactivity.&lt;/em&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;span style=&quot;color: #222222; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;HIGH PRIORITY – - – - – &amp;gt; – - – - – &amp;gt; – - – - – &amp;gt; – - – - – &amp;gt; – - – – LEAST PRIORITY&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;……..real time priority (static priority)…….| …. nice value (dynamic priority) …..&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: &#39;Lucida Grande&#39;, &#39;Lucida Sans Unicode&#39;, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19px;&quot;&gt;99 ……………………….. 50 ……………………… 1 | -20 …….. -10 …….. 0 …….. 10 ……. 19&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/2627936069382086092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/2627936069382086092' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/2627936069382086092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/2627936069382086092'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2013/10/nice-value-and-priority-and-relations.html' title='Nice value and priority and relations'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-1273542501777843381</id><published>2013-10-23T02:21:00.001+05:30</published><updated>2014-05-10T16:05:26.586+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>Forked process, thread and address spaces little deeper</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;span style=&quot;color: purple;&quot;&gt;In Fork()&lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The child process has a unique process ID.&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The child process has a different parent process ID (i.e., the process ID of the parent process).&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The child process has its own copy of the parent&#39;s descriptors. These descriptors reference the same underlying objects, so that, for instance, file pointers in file objects are shared between the child and the parent, so that an lseek(2) on a descriptor in the child process can affect a subsequent read(2) or write(2) by the parent. This descriptor copying is also used by the shell to establish standard input and output for newly created processes as well as to set up pipes.semaphores if opened it also inherit.&amp;nbsp;&lt;span style=&quot;background-color: white;&quot;&gt;Memory mappings created in the parent are retained in the child process,(If&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;MAP_PRIVATE was used in parent,it will be&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;MAP_PRIVATE in child to,after forking if any change in memory mapped area that will be visible to corresponding process only)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The child process&#39; resource utilizations are set to 0; see setrlimit(2).&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;All interval timers are cleared; see setitimer(2).&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;process is created with a single thread. If a multi-threaded process calls&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;background-color: white;&quot;&gt;fork()&lt;/i&gt;&lt;span style=&quot;background-color: white;&quot;&gt;, the new process contains a replica of the calling thread and its entire address space, possibly including the states of mutexes and other resources. Consequently, to avoid errors, the child process may only execute async-signal safe operations until such time as one of the&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;background-color: white;&quot;&gt;exec&lt;/i&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;functions is called. Fork handlers may be established by means of the&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;background-color: white;&quot;&gt;&lt;a href=&quot;http://pubs.opengroup.org/onlinepubs/007908775/xsh/pthread_atfork.html&quot;&gt;pthread_atfork()&lt;/a&gt;&lt;/i&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;function in order to maintain application invariants across&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;background-color: white;&quot;&gt;fork()&lt;/i&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;calls.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;b&gt;In&amp;nbsp;summery&amp;nbsp;&lt;/b&gt; The child gets an exact copy of the parents address space, which in many cases is likely to be laid out in the same format as the parent address space. I have to point out that each one will have it&#39;s own virtual address space for it&#39;s memory, such that each could have the same data at the same address, yet in different address spaces. Also, linux uses copy on write when creating child processes. This means that the parent and child will share the parent address space until one of them does a write, at which point the memory will be physically copied to the child. This eliminates unneeded copies when execing a new process. Since you&#39;re just going to overwrite the memory with a new executable, why bother copying it?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Descriptor copied first, later some elements are&amp;nbsp;intialized. Most&amp;nbsp;of them are intact.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 14px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Shared Resources:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: 14px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: 14px; line-height: 18px;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: purple; font-family: inherit;&quot;&gt;&lt;span style=&quot;font-size: 14px; line-height: 18px;&quot;&gt;&lt;b&gt;&lt;i&gt;In Thread()&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;Often it is sufficient to run a partial copy of a process with the other parts shared with other processes. Such copies can be realized by a&amp;nbsp;&lt;i&gt;thread&lt;/i&gt;&amp;nbsp;(an example of a&amp;nbsp;&lt;i&gt;lightweight&lt;/i&gt;&amp;nbsp;process) which has the following properties:&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Resources and data can be shared between threads&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Each thread has its own stack&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Context switching is fast&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;A&amp;nbsp;&lt;tt&gt;fork()&lt;/tt&gt;&amp;nbsp;induces a parent-child relationship between two processes.&amp;nbsp;&lt;tt&gt;Thread&lt;/tt&gt;&amp;nbsp;creation induces a peer relationship between all the threads of a process.&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The&amp;nbsp;&lt;tt&gt;main()&lt;/tt&gt;&amp;nbsp;thread runs first, but has no other priority&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;The&amp;nbsp;&lt;tt&gt;main&lt;/tt&gt;&amp;nbsp;thread may have some special properties&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;background-color: #ffffdf;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Processes and threads can&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Terminate&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Start a new process or thread&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Wait for each other to terminate&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Terminate each other&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Share data and communicate&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Run independently&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/1273542501777843381/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/1273542501777843381' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/1273542501777843381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/1273542501777843381'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2013/10/forked-process-thread-and-address-spaces.html' title='Forked process, thread and address spaces little deeper'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-4046104994049136227</id><published>2013-10-10T15:26:00.005+05:30</published><updated>2013-10-10T15:26:22.627+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>Global variable ,static always initialized but auto is not initialized</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;ol style=&quot;background-color: white; border: 0px; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1em 30px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;background-color: transparent; border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;em style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Security&lt;/strong&gt;&lt;/em&gt;: leaving memory alone would leak information from other processes or the kernel.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;background-color: transparent; border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;em style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Efficiency&lt;/strong&gt;&lt;/em&gt;: the values are useless until initialized to something, and it&#39;s more efficient to zero them in a block with unrolled loops.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;background-color: transparent; border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;em style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Reproducibility&lt;/strong&gt;&lt;/em&gt;: leaving the values alone would make program behavior non-repeatable, making bugs really hard to find.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;background-color: transparent; border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;em style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;strong style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Elegance&lt;/strong&gt;&lt;/em&gt;: it&#39;s cleaner if programs can start from 0 without having to clutter the code with default initializers.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
One might wonder why the&amp;nbsp;&lt;code style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;auto&lt;/code&gt;&amp;nbsp;storage class does start as garbage. The answer is two-fold:&lt;/div&gt;
&lt;ol style=&quot;background-color: white; border: 0px; font-family: Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif; font-size: 14px; line-height: 18px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 1em 30px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;background-color: transparent; border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
It doesn&#39;t, in a sense. The very first stack frame does receive zero values. The &quot;garbage&quot;, or &quot;uninitialized&quot; values that subsequent instances at the same stack level see are really the previous values left by the same program.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;div style=&quot;background-color: transparent; border: 0px; clear: both; margin-bottom: 1em; padding: 0px; vertical-align: baseline;&quot;&gt;
There might be a runtime performance penalty associated with initializing&amp;nbsp;&lt;code style=&quot;background-color: #eeeeee; border: 0px; font-family: Consolas, Menlo, Monaco, &#39;Lucida Console&#39;, &#39;Liberation Mono&#39;, &#39;DejaVu Sans Mono&#39;, &#39;Bitstream Vera Sans Mono&#39;, &#39;Courier New&#39;, monospace, serif; margin: 0px; padding: 1px 5px; vertical-align: baseline;&quot;&gt;auto&lt;/code&gt;&amp;nbsp;(function locals) to anything. A function might not use any or all of a large array, say, and it could be invoked thousands or millions of times. The initialization of statics and globals, OTOH, only needs to happen once.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/4046104994049136227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/4046104994049136227' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/4046104994049136227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/4046104994049136227'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2013/10/global-variable-static-always_382.html' title='Global variable ,static always initialized but auto is not initialized'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-3771659972763633193</id><published>2013-10-10T11:53:00.000+05:30</published><updated>2013-10-26T17:35:29.454+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>Speed of execution in term of code in some cases</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;span style=&quot;cursor: pointer;&quot;&gt;Is “else if” faster than “switch() case”&lt;/span&gt;?&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
For small loops not required,For very big loop hash table is used for &amp;nbsp;switch case so faster execution.&lt;/div&gt;
&lt;div&gt;
But with good compiler with optimization enabled, it&#39;s same.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;h3 class=&quot;post-title entry-title&quot; style=&quot;background-color: white; color: blue; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-weight: normal; margin: 0.75em 0px 0px; position: relative;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Why i++ is faster than i=i+1 in c&lt;/span&gt;&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
older compilers used&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Courier New&#39;; font-size: 19px;&quot;&gt;(1)ADD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \\i+1&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Courier New&#39;; font-size: 19px;&quot;&gt;(2)Assignment operation&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; \i=x&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Courier New&#39;; font-size: 19px;&quot;&gt;for i=i+1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Courier New&#39;; font-size: 19px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Courier New&#39;; font-size: 19px;&quot;&gt;for i++&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Courier New&#39;; font-size: 19px; text-align: justify;&quot;&gt;(1)INR&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Courier New&#39;; font-size: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Courier New&#39;; font-size: 19px; text-align: justify;&quot;&gt;but currently good compilers with optimizations enabled creates same assembly code.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Courier New&#39;; font-size: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #222222; font-family: &#39;Courier New&#39;; font-size: 19px; text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/3771659972763633193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/3771659972763633193' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/3771659972763633193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/3771659972763633193'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2013/10/speed-of-execution-in-term-of-code-in.html' title='Speed of execution in term of code in some cases'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-6488988154357132305</id><published>2013-10-06T23:11:00.002+05:30</published><updated>2013-10-07T01:25:24.775+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>ARM Nesting of Interrupts</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1 style=&quot;background-color: white; clear: both; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: 1.6em; margin-bottom: 0px !important; margin-top: 0.25em !important;&quot;&gt;
NESTING INTERRUPTS&lt;/h1&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 0.2em; margin-top: 0.8em;&quot;&gt;
&lt;b&gt;Applies to:&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;http://infocenter.arm.com/help/topic/com.arm.doc.faqs/kiyMhic7973nTP.html&quot; style=&quot;color: #4f0f8e; text-decoration: none;&quot;&gt;RealView C Compiler&lt;/a&gt;&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; clear: both; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: 1.4em; margin-bottom: 0px; margin-top: 1.2em;&quot;&gt;
Answer&lt;/h2&gt;
&lt;hr style=&quot;background-color: white; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 0.2em !important; margin-top: 0.4em !important;&quot; /&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 0.2em; margin-top: 0.8em;&quot;&gt;
Information in this article applies to:&lt;/div&gt;
&lt;ul style=&quot;background-color: white; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 0.2em; margin-top: 0.8em;&quot;&gt;
&lt;li style=&quot;margin-bottom: 0.2em; margin-top: 0.6em;&quot;&gt;RealView Compiler Version 3.0 or higher&lt;/li&gt;
&lt;/ul&gt;
&lt;hr style=&quot;background-color: white; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; clear: both; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: 1.2em; margin-bottom: 0px; margin-top: 1.2em;&quot;&gt;
QUESTION&lt;/h3&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 0.2em; margin-top: 0.8em;&quot;&gt;
The classic ARM architecture only provides two interrupts (IRQ and FIQ). The Vectored Interrupt Controller or Advanced Interrupt Controller provides interrupt priorities and interrupt nesting for the standard interrupt, but it requires that you set the&amp;nbsp;&lt;b&gt;I&lt;/b&gt;&amp;nbsp;bit in the CPSR.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 0.2em; margin-top: 0.8em;&quot;&gt;
What is the best method to allow interrupt nesting with the RealView compiler?&lt;/div&gt;
&lt;h3 style=&quot;background-color: white; clear: both; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: 1.2em; margin-bottom: 0px; margin-top: 1.2em;&quot;&gt;
ANSWER&lt;/h3&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 0.2em; margin-top: 0.8em;&quot;&gt;
It should be noted that good programming technique implies that you keep interrupt functions very short. When you are using short interrupt functions, interrupt nesting becomes unimportant. When you are using an Real-Time Operating System (such as the RTX Kernel), the stack usage of user tasks becomes unpredictable when you allow interrupt nesting.&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 0.2em; margin-top: 0.8em;&quot;&gt;
However, if you still need interrupt nesting in your application, you may implement it using an assembly language wrapper function as described below:&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 0.2em; margin-top: 0.8em;&quot;&gt;
&lt;b&gt;Example:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 0.2em; margin-top: 0.8em;&quot;&gt;
Within the following&amp;nbsp;&lt;b&gt;__irq&lt;/b&gt;&amp;nbsp;function you want to allow interrupt nesting:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; color: #333399; font-family: &#39;Lucida Sans Typewriter&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 0.9em; margin-bottom: 0.2em; margin-left: 0.5em; margin-top: 0.8em;&quot;&gt;void eint1_irq (void)  __irq  {   // C interrupt function
  EXTINT      = 2;                // Clear EINT1 interrupt flag
  delay ();                       // wait a long time
  ++intrp_count;                  // increment interrupt count
  VICVectAddr = 0;                // Acknowledge Interrupt
}
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 0.2em; margin-top: 0.8em;&quot;&gt;
Change the interrupt function as shown below:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; color: #333399; font-family: &#39;Lucida Sans Typewriter&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 0.9em; margin-bottom: 0.2em; margin-left: 0.5em; margin-top: 0.8em;&quot;&gt;extern void eint1_irq (void);     // wrapper ASM interrupt function

void eint1_srv (void)  {          // C interrupt code
  EXTINT      = 2;                // Clear EINT1 interrupt flag
  delay ();                       // wait a long time
  ++intrp_count;                  // increment interrupt count
&lt;strong&gt;//VICVectAddr = 0;                // Acknowledge Interrupt&lt;/strong&gt;
}
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 0.2em; margin-top: 0.8em;&quot;&gt;
Add the following assembler wrapper (in a separate assembly module) to the interrupt function:&lt;/div&gt;
&lt;pre style=&quot;background-color: white; color: #333399; font-family: &#39;Lucida Sans Typewriter&#39;, &#39;Courier New&#39;, Courier, monospace; font-size: 0.9em; margin-bottom: 0.2em; margin-left: 0.5em; margin-top: 0.8em;&quot;&gt;       PRESERVE8
       AREA    NEST_IRQ, CODE, READONLY
       ARM
       IMPORT  eint1_srv
       EXPORT  eint1_irq

eint1_irq

       PUSH    {R0-R3,R12,LR}          ; save register context
       MRS     LR, SPSR                ; Copy SPSR_irq to LR
       PUSH    {LR}                    ; Save SPSR_irq
       MSR     CPSR_c, #0x1F           ; Enable IRQ (Sys Mode)
       PUSH    {LR}                    ; Save LR

       BL      eint1_srv

       POP     {LR}                    ; Restore LR
       MSR     CPSR_c, #0x92           ; Disable IRQ (IRQ Mode)
       POP     {LR}                    ; Restore SPSR_irq to LR
       MSR     SPSR_cxsf, LR           ; Copy LR to SPSR_irq

;      VICVectAddr = 0;                ; Acknowledge Interrupt
       MOV     R0,#0
       STR     R0,[R0,#-0xFD0]

       POP     {R0-R3,R12,LR}          ; restore register context
       SUBS    R15,R14,#0x0004         ; return from interrupt


       END
&lt;/pre&gt;
&lt;div style=&quot;background-color: white; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 0.2em; margin-top: 0.8em;&quot;&gt;
Note:&lt;/div&gt;
&lt;ul style=&quot;background-color: white; font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: small; margin-bottom: 0.2em; margin-top: 0.8em;&quot;&gt;
&lt;li style=&quot;margin-bottom: 0.2em; margin-top: 0.6em;&quot;&gt;The example above shows interrupt nesting with the NXP LPC2000 devices. It is important that you move the interrupt acknowledge sequence&amp;nbsp;&lt;strong style=&quot;margin-bottom: 0.2em; margin-top: 0.4em;&quot;&gt;VICVectAddr = 0;&lt;/strong&gt;&amp;nbsp;to the assembly wrapper. Other ARM devices may require a different interrupt acknowledge sequence. Therefore consult the user&#39;s manual of the ARM device that you are using.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;a href=&quot;http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka11425.html&quot; target=&quot;_blank&quot;&gt;Source&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;Another good approach &amp;nbsp;&lt;/b&gt;&lt;/span&gt;from &lt;a href=&quot;http://prasanthsubramani.wordpress.com/2011/11/09/arm-irq-nesting-programatically/&quot; target=&quot;_blank&quot;&gt;source&lt;/a&gt;:&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;Many a times it would be handy if we could let the interrupt handling routine decide whether to nest an interrupt or not. Yes this voilates the concept of interrupt prioritization but there might be times say a data frame sync fault has occurred and you would probably need to restart the transfer and which may take a much longer time. In such situations your device driver might decide to allow other interrupts to occur. This can be accomplished in two ways&lt;/div&gt;
&lt;ol style=&quot;background-color: white; border: 0px; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 15px 32px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;To raise a Software Interrupt to do this switch&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;To call an assembly routine that takes care of the context switching&lt;/li&gt;
&lt;/ol&gt;
&lt;h1 style=&quot;background-color: white; border: 0px; clear: both; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 24px; line-height: 21px; margin: 0px 0px 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
Software Interrupt approach:&lt;/h1&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; This is a very good approach a standardized system routine to take care of this. But is it really necessary to do all this in a simple embedded application. This is a good approach for any high end operating systems. The routine may decide upon whether to allow the driver to nest the interrupt and wait or should it return immediately. I’m not posting more on this here as this not the simplest of approach or easy to give it for free..&lt;img alt=&quot;:P&quot; class=&quot;wp-smiley&quot; src=&quot;http://s2.wp.com/wp-includes/images/smilies/icon_razz.gif?m=1129645325g&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border-bottom-left-radius: 20px; border-bottom-right-radius: 20px; border-top-left-radius: 20px; border-top-right-radius: 20px; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot; /&gt;&lt;/div&gt;
&lt;blockquote style=&quot;background-color: white; border: 0px; color: #666666; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; line-height: 21px; margin: 0px 0px 0px 15px; padding: 0px 0px 0px 10px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;background-color: transparent; border: 0px; margin-bottom: 15px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;A typical Software Interrupt Approach needs to be implemented in the following way or something similar&lt;/strong&gt;&lt;/div&gt;
&lt;blockquote style=&quot;background-color: transparent; border: 0px; line-height: 1.5; margin: 0px 0px 0px 15px; padding: 0px 0px 0px 10px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;ol style=&quot;background-color: transparent; border: 0px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 15px 32px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Create a common IRQ distribution routine&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IRQ distribution routine will call the actual interrupt handler&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Handler can raise a SWI for allowing interrupt nesting&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Handler shall return to the IRQ distribution routine&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;IRQ distribution routine safely resumes the previous process&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;/blockquote&gt;
&lt;h1 style=&quot;background-color: white; border: 0px; clear: both; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 24px; line-height: 21px; margin: 0px 0px 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
Assembly Routine:&lt;/h1&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; By writing an embedded assembler routing supported by ARMGCC compiler the developer has the flexibility to do an interrupt nesting by simple calling this routine(Just like a function call). You would need to create two embedded assembler routines&lt;/div&gt;
&lt;ol style=&quot;background-color: white; border: 0px; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 15px 32px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;To Enable the processor interrupt and switch to system mode.&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;To Disable the processor interrupt and switch back to the original program.&lt;/li&gt;
&lt;/ol&gt;
&lt;blockquote style=&quot;background-color: white; border: 0px; color: #666666; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; font-style: italic; line-height: 21px; margin: 0px 0px 0px 15px; padding: 0px 0px 0px 10px; quotes: none; vertical-align: baseline;&quot;&gt;
&lt;div style=&quot;background-color: transparent; border: 0px; margin-bottom: 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
Before we look at the embedded assemblers used to serve this purpose let us see how parameters are passed to embedded assemblers.&lt;/div&gt;
&lt;div style=&quot;background-color: transparent; border: 0px; margin-bottom: 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;__asm void enableIRQ(int dummy_variable)&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: transparent; border: 0px; margin-bottom: 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
The dummy variable is available at the register R0. As I mentioned earlier the call to this embedded assembler is just like any function call, on return the old value of the register R0 will be restored. This behavior is opposite to that of a normal function call in which the called function takes care of storing and restoring the registers. This is completely a compiler dependent behavior. If you are interested take a look at the disassemble.&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
The complete IRQ Nesting code use in SRMSAT-1&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 15px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;code style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;__asm void enableIRQ(int dummy)&lt;br /&gt;{&lt;br /&gt;MRS r0, SPSR&lt;br /&gt;STMDB SP!,{r0}&lt;br /&gt;MOV r0,LR&lt;br /&gt;MSR CPSR_c, #0x9F&lt;br /&gt;STMDB SP!,{LR}&lt;br /&gt;MOV LR,r0&lt;br /&gt;MSR CPSR_c,#0x1F&lt;br /&gt;MOV PC,LR&lt;br /&gt;}&lt;br /&gt;__asm void disableIRQ(int dummy)&lt;br /&gt;{&lt;br /&gt;MSR CPSR_c, #0x9F&lt;br /&gt;MOV r0,LR&lt;br /&gt;LDMIA SP!, {LR}&lt;br /&gt;MSR CPSR_c, #0x92&lt;br /&gt;LDMIA SP!, {LR}&lt;br /&gt;MSR SPSR_cxsf, LR&lt;br /&gt;MOV PC,r0&lt;br /&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
I have forced the compiler to free the contents of the register R0 by passing an useless parameter to create an useful slot for swapping the register contents. I’am assuming that the reader is familiar with ARM assembly. If you have more doubts read my other posts on ARM instruction set(At this time i’m still editing my blog on instruction set as it is too big or if I should make it just contain references to someone else blog as there are already a lot of available resources on ARM instruction set and execution). It is a must for the developer to call the “disableIRQ” before returning from the interrupt handler. Else you are going to corrupt the stack and bread the code.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
Now before I finish let us see the advantages and drawbacks of both the approaches and which approach you should choose for your application.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: both; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 22px; line-height: 21px; margin: 0px 0px 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
Advantages&lt;br /&gt;System IRQ Approach&lt;/h2&gt;
&lt;ol style=&quot;background-color: white; border: 0px; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 15px 32px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;OS can can decide whether to allow or not.&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Switching can be made to “User” mode instead of “System” mode and leading to a&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;security vulnerability.&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;OS can consider dynamic system conditions to decide.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: both; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 22px; line-height: 21px; margin: 0px 0px 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
Embedded Assembler Approach&lt;/h2&gt;
&lt;ol style=&quot;background-color: white; border: 0px; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 15px 32px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Light weight&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Easy to use with any Embedded C/C++ projects&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: both; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 22px; line-height: 21px; margin: 0px 0px 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
Drawbacks&lt;br /&gt;System IRQ Approach&lt;/h2&gt;
&lt;ol style=&quot;background-color: white; border: 0px; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 15px 32px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Not all embedded applications have a proper OS.&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Adds a lot of procedure to follow in implementing, for instance after the call we need to examine whether the access was granted or not.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: both; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 22px; line-height: 21px; margin: 0px 0px 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
Embedded Assembler Approach&lt;/h2&gt;
&lt;ol style=&quot;background-color: white; border: 0px; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px; list-style-image: initial; list-style-position: initial; margin: 0px 0px 15px 32px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Highly vulnerable to security issues due to the switch to privileged system mode.&lt;/li&gt;
&lt;/ol&gt;
&lt;h1 style=&quot;background-color: white; border: 0px; clear: both; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 24px; line-height: 21px; margin: 0px 0px 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
Choosing the right approach for your application:&lt;/h1&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: &#39;Helvetica Neue&#39;, Helvetica, Arial, sans-serif; font-size: 14px; line-height: 21px; margin-bottom: 15px; padding: 0px; text-align: justify; vertical-align: baseline;&quot;&gt;
Unless you are developing a competing OS for Symbian or Windows do not go for the writing the system IRQ routines(To know about writing System IRQ’s read my post on “Software Interrupts”). If you are assigned a task like designing the On-Board computer system for a satellite like me go for the Embedded Assembler. If you are making an ATM machine then do not go for Embedded Assemblers, in fact for a system like that i prefer to have no nesting.&lt;br /&gt;
In lay mans term, If you have a project which involves multiple developers and 3rd party developers write a System IRQ routine (Software Interrupt) else use this simple embedded assembler.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/6488988154357132305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/6488988154357132305' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/6488988154357132305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/6488988154357132305'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2013/10/arm-nesting-interrupts.html' title='ARM Nesting of Interrupts'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-6849465560277195856</id><published>2013-09-29T16:37:00.000+05:30</published><updated>2013-10-07T01:28:52.592+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="MISC"/><title type='text'>Kashmiri style Tangra Masala</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;font-family: verdana, tahoma, arial, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 12px; line-height: 19.453125px;&quot;&gt;Sometime I like to cook non-everyday food by my&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;self.Kept my wife aside and cooked the Tangra masala.Pros was that I got appreciation from her,but cons was she want me cook the tangra fish always whenever possible. :(&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;u&gt;Recipe is as follows.&lt;/u&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: red; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px; margin: 0px; padding: 0px;&quot;&gt;Ingredients&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;&amp;nbsp;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;Tangra Fish&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;Mustard oil&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;Onions - finely chopped&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;Green chilies - Slit lengthwise from the middle&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;Ginger-Garlic paste&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;Coriander leaves&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;Tomato - Finely chopped&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;Cumin, Coriander, Red-chilly and Garam-Masala powder&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;Posto seed (Poppy Seeds) OR Suji (Semolina) - whole, not paste&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;Groundnut - paste&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;Salt and sugar to taste&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px; margin: 0px; padding: 0px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: red; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px; margin: 0px; padding: 0px;&quot;&gt;Method&lt;/span&gt;&lt;span style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;&amp;nbsp;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;Heat mustard oil in a pan, fry the fishes with turmeric powder and salt. Keep aside the fried fishes and add the finely chopped onions, tomatoes, ginger-garlic paste into the heated oil. Mix sugar (optional). Once golden-brown, add to it the green-chillies, cumin-coriander-red chilly powders also salt (save the garam-masala powder till the end) followed by the groundnut paste, coriander leaves. Fry till you get the aroma coming.Add the fish and mix the gravy.add some water.Next sprinkle the posto/suji. Fry a little more and then mix water(very little). Simmer for another 5 mins and add the garam-masala powder before switching off the burner. You are done.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; color: #333333; font-family: verdana, tahoma, arial, sans-serif; font-size: 12px; line-height: 19.453125px;&quot;&gt;Taken from&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://sunrita-rai.blogspot.in/2008/11/tangra-maachkashmiri-style.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/6849465560277195856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/6849465560277195856' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/6849465560277195856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/6849465560277195856'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2013/09/kashmir-style-tangra-masala.html' title='Kashmiri style Tangra Masala'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-6724439475359458319</id><published>2013-02-03T01:10:00.001+05:30</published><updated>2013-02-03T01:11:47.410+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="MISC"/><title type='text'>Airtel Digital tv remote factory reset and reprogram</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;Following is the way to reset Airtel Digial tv universal remote reset procedure.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 13px; line-height: 18px;&quot;&gt;1. Press red button and ok button together untill red light blinks twice.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;2. Release the buttons and press 980 buttons one by one (not together)&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;3. Red light will blink again two times, now press ok button.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Reprogramming&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; font-family: Verdana, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;There are 5 basic functions which your new Airtel remote needs to learn about your TV&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;1. TV Power code&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;2. TV Mute code&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;3. AV code&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;4. TV VOL + code&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;5. TV VOL – code&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px; text-decoration: underline;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Steps for Universal remote setup:&lt;/span&gt;&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; font-weight: bold; line-height: 18px;&quot;&gt;Step 1:&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;Bring Airtel digital TV remote in learning mode. Press and hold ‘’OK + Numeric 2” key for 3 seconds. The LED blinks twice to indicate that your Airtel remote is ready to learn.&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; font-weight: bold; line-height: 18px;&quot;&gt;Step 2 :&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;Hold the source remote and Airtel remote in front of each other ( 3cm-6m apart).&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; font-weight: bold; line-height: 18px;&quot;&gt;Step 3:&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;Press &amp;amp; release the key (First on Airtel remote and then on Source remote) which needs to be programmed in Airtel remote.&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;Example: Press and release the TV Power key on both remotes and release. The Airtel remote blinks twice to indicate a successful learning of ‘TV power code’.&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; font-weight: bold; line-height: 18px;&quot;&gt;Step 4:&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;Now Press &amp;amp; release other keys ( on both remotes simultaneously) : Mute , AV, Vol +/-.&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; font-weight: bold; line-height: 18px;&quot;&gt;Step 5:&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;&amp;nbsp;Press &quot;OK&quot; on Airtel remote to store the new information about your TV. The LED will blink twice to indicate successful transfer to knowledge from your current TV remote to the new Airtel remote.&lt;/span&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;br style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot; /&gt;&lt;span style=&quot;font-family: Verdana, Arial, sans-serif; font-size: 13px; line-height: 18px;&quot;&gt;If the Airtel remote blinks four times, it means the learning failed. Go to Step 1 again&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/6724439475359458319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/6724439475359458319' title='36 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/6724439475359458319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/6724439475359458319'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2013/02/airtel-digital-tv-remote-factory-reset.html' title='Airtel Digital tv remote factory reset and reprogram'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>36</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-3477104249663212265</id><published>2013-01-23T17:37:00.001+05:30</published><updated>2013-01-23T17:37:30.056+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>Priority Inheritance in Linux Kernel</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
According to LWN.net&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;There are a number of approaches to priority inheritance. In effect, the kernel performs a very simple form of it by not allowing kernel code to be preempted while holding a spinlock. In some systems, each lock has a priority associated with it; whenever a process takes a lock, its priority is raised to the lock&#39;s priority. In others, a high-priority process will have its priority &quot;inherited&quot; by another process which holds a needed lock. Most priority inheritance schemes have shown a tendency to complicate and slow down the locking code, and they can be used to paper over poor application designs. So they are unpopular in many circles. Linus was&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://lwn.net/Articles/178258/&quot; style=&quot;background-color: white; color: darkblue; text-decoration: initial;&quot;&gt;reasonably clear&lt;/a&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&amp;nbsp;about how he felt on the subject last December:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;BigQuote&quot; style=&quot;background-color: white; color: darkred; margin-left: 1cm; margin-right: 1cm;&quot;&gt;
&quot;Friends don&#39;t let friends use priority inheritance&quot;.&lt;br /&gt;
&lt;div style=&quot;margin-top: 1em;&quot;&gt;
Just don&#39;t do it. If you really need it, your system is broken anyway.&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
Faced with this sort of opposition, many developers would quietly shelve their priority inheritance designs and go back to working on accounting code. The kernel development community, however, happens to have a member who has a track record of getting code merged in spite of this sort of objection: Ingo Molnar. History may well repeat itself, as Ingo (working with Thomas Gleixner) has posted&amp;nbsp;&lt;a href=&quot;http://lwn.net/Articles/177111/&quot; style=&quot;color: darkblue; text-decoration: initial;&quot;&gt;a priority-inheriting futex implementation&lt;/a&gt;&amp;nbsp;with a request that it be merged into the mainline. This approach, says Ingo, provides a useful functionality to user space (it is not meant to provide priority-inheriting kernel mutual exclusion primitives) while avoiding the pitfalls which have hit other implementations.&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
Taken from ..&lt;/div&gt;
&lt;div style=&quot;background-color: white;&quot;&gt;
&lt;a href=&quot;http://lwn.net/Articles/178253/&quot;&gt;http://lwn.net/Articles/178253/&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/3477104249663212265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/3477104249663212265' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/3477104249663212265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/3477104249663212265'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2013/01/priority-inheritance-in-linux-kernel.html' title='Priority Inheritance in Linux Kernel'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-2628424979920458578</id><published>2012-10-15T22:41:00.001+05:30</published><updated>2012-10-15T22:41:32.264+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>BFS vs CFS</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;http://forum.cyanogenmod.com/topic/18575-cfs-vs-bfs-kernel-scheduler/&quot;&gt;http://forum.cyanogenmod.com/topic/18575-cfs-vs-bfs-kernel-scheduler/&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/2628424979920458578/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/2628424979920458578' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/2628424979920458578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/2628424979920458578'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2012/10/bfs-vs-cfs.html' title='BFS vs CFS'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-816609784476294151</id><published>2012-09-18T11:38:00.001+05:30</published><updated>2012-09-28T01:11:57.517+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="MISC"/><title type='text'>Why Japan attacked Perl harbour</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
While reading about Sino-japan war.I found Japan was almost winning.Suddenly it attacked Perl Harbor.I could not find the motive.What Google search gave a result with details explanation.&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/goog_1289666394&quot;&gt;&lt;br /&gt;&lt;/a&gt;
&lt;a href=&quot;http://wiki.answers.com/Q/Why_did_the_Japanese_attack_Pearl_Harbor&quot;&gt;http://wiki.answers.com/Q/Why_did_the_Japanese_attack_Pearl_Harbor&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/816609784476294151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/816609784476294151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/816609784476294151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/816609784476294151'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2012/09/why-japan-attacked-perl-harbour.html' title='Why Japan attacked Perl harbour'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-3815706004787670913</id><published>2012-09-15T18:55:00.000+05:30</published><updated>2012-09-15T22:07:09.037+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>Linux boot seqence in short</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;This the following minimum boot sequence&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;1) Bootloader loads the Kernel image to Ram&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;The image may be compressed or uncompressed.Uboot uses a special header in added &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;to the kernel image and make it as uImage. Using&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: #f8f8f8; color: blue; font-weight: bold; line-height: 15px; white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;mkimage&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: monospace; font-weight: bold; line-height: 15px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px; white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;we can make the image zImage/vmLinux&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;

&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px; white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;2) Ramdisk loaded in the memory, bootloader do that.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px; white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px; white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;3) Control is given to kernel ,it also provides kernel arguments/command line options.Also bootlader set ramdisk as rootfs.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px; white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px; white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;Initial Rootfs filesystem may be of ext2 or minix format.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px; white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; line-height: 19px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: sans-serif; font-size: 13px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace; font-size: 13px;&quot;&gt;&lt;b&gt;initramfs&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 13px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt; is the file can be unpacked by kerne l of following formats &lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: sans-serif;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: blue; font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Gzip&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; text-decoration: underline;&quot; title=&quot;Gzip&quot;&gt;gzip&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Bzip2&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; text-decoration: none;&quot; title=&quot;Bzip2&quot;&gt;bzip2&lt;/a&gt;,&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/LZMA&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; text-decoration: none;&quot; title=&quot;LZMA&quot;&gt;LZMA&lt;/a&gt;,&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Xz&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; text-decoration: none;&quot; title=&quot;Xz&quot;&gt;XZ&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/LZO&quot; style=&quot;background-attachment: initial; background-clip: initial; background-color: initial; background-image: none; background-origin: initial; text-decoration: none;&quot; title=&quot;LZO&quot;&gt;LZO&lt;/a&gt;.&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px; white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px; white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;3) Then &quot;linuxrc&quot; ran from initial ramdisk.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px; white-space: pre;&quot;&gt;4) &lt;/span&gt;&lt;/span&gt;The root device is changed to that specified in the kernel parameter.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;5)&amp;nbsp;The init program&amp;nbsp;&lt;code&gt;/etc/init&lt;/code&gt;&amp;nbsp;is run which will perform the user configurable boot sequence.&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; line-height: 15px; white-space: pre;&quot;&gt; if rdinit is used then specified binary is called.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif; line-height: 15px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; line-height: 15px; white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;qemu-system-arm -M versatilepb -m 128M -kernel linux-3.5.3/arch/arm/boot/uImage -initrd rootfs3.img.gz -append &quot;rdinit=/sbin/init&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white; line-height: 15px; white-space: pre;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px; white-space: pre;&quot;&gt;That means roofs is rootfs3.img.gz and run /sbin/init from mounted rootfs.In this command we run the uImage kernel on qemu arm emulator which is emulation versatilepb arm architechture.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, sans-serif;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;line-height: 15px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/3815706004787670913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/3815706004787670913' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/3815706004787670913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/3815706004787670913'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2012/09/linux-boot-seqence-in-short.html' title='Linux boot seqence in short'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-5915217427624817046</id><published>2012-09-11T21:23:00.001+05:30</published><updated>2012-09-11T21:24:12.141+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>Difference of Compilers arm-none-linux-gnueabi and arm-none-eabi</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I was confused between&amp;nbsp;&amp;nbsp;arm-none-linux-gnueabi and arm-none-eabi .I didn&#39;t know where to use what.&lt;br /&gt;
&lt;br /&gt;
The gcc naming convention is like as below&lt;br /&gt;
arch-vendor-(os-)-eabi&lt;br /&gt;
&lt;br /&gt;
so for&amp;nbsp;&amp;nbsp;arm-none-linux-gnueabi is&amp;nbsp;meant&amp;nbsp;for the compilation to elf which uses linux.&lt;br /&gt;
and &amp;nbsp;arm-none-eabi is meant for the compilation of the codes which will run on bare metal arm core.&lt;br /&gt;
&lt;br /&gt;
The difference is that they use library accordingly to compile the source codes.&amp;nbsp;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/5915217427624817046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/5915217427624817046' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/5915217427624817046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/5915217427624817046'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2012/09/difference-of-compilers-arm-none-linux.html' title='Difference of Compilers arm-none-linux-gnueabi and arm-none-eabi'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-515571173450120473</id><published>2012-09-04T18:25:00.001+05:30</published><updated>2012-09-04T18:25:41.973+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>Oracle Virtual box upgradation issue</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I recently tried to run Xubuntu 12.04 on virtualbox 1.2.0.It was working fine.Then due to some bug in my head :) tried to upgrade virtualbox to VirtualBox-4.2.0_RC3 from &lt;a href=&quot;http://download.virtualbox.org/virtualbox/4.2.0_RC3/yLA&amp;amp;sig2=3BGpmhcRHx590ScQlj40Jw&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Now without uninstalling the previous version I installed it.It created problem.While running any Vms after installing extension pack it gave error [&lt;b&gt;&quot; failed to load vmmr0.r0 (verr_ldr_mismatch_native)&quot;&lt;/b&gt;].&lt;br /&gt;
&lt;br /&gt;
This issue is intially I couldn&#39;t solve.Later I solved the issue as following.&lt;br /&gt;
Remove virtualBox ,remove folders from Program Files then removing &quot;C:\Users\USERNAME\AppData\Local\VirtualStore\Program Files\Oracle\VirtualBox&quot; {Need administrative privilege}&lt;br /&gt;
&lt;br /&gt;
Now install VBox freshly and import the virtual image projects/Disks.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/515571173450120473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/515571173450120473' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/515571173450120473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/515571173450120473'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2012/09/oracle-virtual-box-upgradation-issue.html' title='Oracle Virtual box upgradation issue'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-4213152632375748988</id><published>2012-09-01T12:41:00.001+05:30</published><updated>2012-09-01T12:42:04.199+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>Small Makefile tutorial</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
This Makefile tutorial by Alex is small but very useful.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.cprogramming.com/tutorial/makefiles_continued.html&quot;&gt;http://www.cprogramming.com/tutorial/makefiles_continued.html&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/4213152632375748988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/4213152632375748988' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/4213152632375748988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/4213152632375748988'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2012/09/small-makefile-tutorial.html' title='Small Makefile tutorial'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-4871534666527846032</id><published>2012-08-28T22:03:00.001+05:30</published><updated>2013-10-23T02:33:04.196+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="PROGRAMMING"/><title type='text'>Sysfs  or procfs</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I became &amp;nbsp;confused about the&amp;nbsp;utilization&amp;nbsp;of procfs and sysfs.Which one will be used in which place?&lt;br /&gt;
&lt;br /&gt;
What I understand as below.&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: yellow;&quot;&gt;Procfs&lt;/span&gt; is much more generic interface to provide information to user space.All the process related&amp;nbsp;information&amp;nbsp;and some parameters are also passed to user space through profs file system,&lt;br /&gt;
&lt;br /&gt;
Whereas &lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: yellow;&quot;&gt;Sysfs&lt;/span&gt; is much more modern&amp;nbsp;implementation&amp;nbsp;like procfs.But it is implemented by following Linux driver model and&amp;nbsp;hierarchy.Sysfs stores driver,device information alongside of process&amp;nbsp;information&amp;nbsp;too.As Greg KH told &quot;&lt;span class=&quot;Apple-style-span&quot; style=&quot;background-color: white;&quot;&gt;sysfs is &quot;1 value per file&quot;&quot; . so can be used for full user level driver implementation.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Sysfs can do all the work like procfs ,they normally not used as information interface of process.Procfs will be there holding the process&amp;nbsp;in formations.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Update 23/10/2013: &lt;/b&gt;Sysfs is extensively used by udev. Whenever any sysfs file node is created udev get event and creates device files according to major and minor no it revived.I&#39;ll discuss it in detail in some later post.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/4871534666527846032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/4871534666527846032' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/4871534666527846032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/4871534666527846032'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2012/08/sysfs-or-procfs.html' title='Sysfs  or procfs'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-5229987816675633867</id><published>2012-04-13T22:16:00.003+05:30</published><updated>2012-04-13T22:18:32.128+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="MISC"/><title type='text'>My Comparison of Galaxy S2 and HTC Sensetion</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Suddenly feeling to take one android phone after my tab crashed and bored with my 900rupee samsung guru.Though Guru is very good but feeling calender, camera reminder video calls are very necessary for me.&amp;nbsp;Doing little bit of research about the&amp;nbsp;feature&amp;nbsp;and&amp;nbsp;performances between the HTC sensetion and Samsung Galaxy S2 .Seems like S2 is obvious winner.Though I like HTC outer look very much.The UI is also very good.I used HTC touch phone for very long time so I am very fond of HTC.But as campared by different user HTC has almost double battery life,fron cam is 2.0M ,weight is less and Samsung given S2 to hackers for making custom ROMs.Last thing is very necessary I feel .I like my own ROM don&#39;t want to take anything,, though after sometime only I may use it , if and only if I buy S2..&lt;br /&gt;
&lt;br /&gt;
Here are some good&amp;nbsp;comparisons&amp;nbsp;between the&amp;nbsp;smart phones.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.phonearena.com/reviews/HTC-Sensation-vs-Samsung-Galaxy-S-II_id2766&quot; target=&quot;_blank&quot;&gt;HTC Sensation vs Samsung Galaxy S II&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://phonedeals.knowyourmobile.com/pages/htcsensationvssamsunggalaxys2&quot; target=&quot;_blank&quot;&gt;HTC Sensation vs Samsung Galaxy S2&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://i-cdn.phonearena.com/images/review/2766-image/HTC-Sensation-vs-Samsung-Galaxy-S-II.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;http://i-cdn.phonearena.com/images/review/2766-image/HTC-Sensation-vs-Samsung-Galaxy-S-II.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/5229987816675633867/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/5229987816675633867' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/5229987816675633867'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/5229987816675633867'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2012/04/my-comparison-galaxy-s2-and-htc.html' title='My Comparison of Galaxy S2 and HTC Sensetion'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-105408293847687636</id><published>2012-04-13T22:04:00.000+05:30</published><updated>2012-04-13T22:19:21.795+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="MISC"/><title type='text'>My tab is out of service..</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
I had rooted my Spice Mi-720 tab long time back.There is no custom rom .But tried to clean up some systems file with root&amp;nbsp;privileged. As usual I crashed it. :( . System is hanging on the splash screen only..&lt;br /&gt;
Try myself first else have to go to service&amp;nbsp;center.Probably it&#39;s time to hack android in little bit further.&amp;nbsp;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/105408293847687636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/105408293847687636' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/105408293847687636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/105408293847687636'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2012/04/my-tab-is-out-of-service.html' title='My tab is out of service..'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4948109321544571569.post-1813889787917872805</id><published>2012-04-13T22:00:00.001+05:30</published><updated>2012-04-13T22:18:00.307+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="MISC"/><title type='text'>Samsung tab vs IPAD2</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/M1bkovoLXw4?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://engineernabendu.blogspot.com/feeds/1813889787917872805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/4948109321544571569/1813889787917872805' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/1813889787917872805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4948109321544571569/posts/default/1813889787917872805'/><link rel='alternate' type='text/html' href='http://engineernabendu.blogspot.com/2012/04/samsung-tab-vs-ipad2.html' title='Samsung tab vs IPAD2'/><author><name>Nabendu</name><uri>http://www.blogger.com/profile/04126538396984034264</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='30' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjc1WmegKcup1C06i8Z8-cdiNQ5i3CDaR12A9sx4VK6l2sR-YxeiefTtCOXaF9eVWhDL2MRM0paELZA7hlUkHdEwZ_ZaRVoms_-it_sZb9q_JUYRfU47TcrfpwgMvppGjs/s220/untitled.JPG'/></author><thr:total>0</thr:total></entry></feed>