<?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: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-11963565</id><updated>2012-01-25T15:43:05.037-08:00</updated><category term='makefile'/><category term='linuxconfig'/><category term='linux ubuntu DVD'/><category term='windowsxp'/><category term='gvim'/><category term='Ubuntu'/><category term='Perl'/><category term='shell beep'/><category term='ARM toolchain'/><category term='firefox bookmarks restore'/><category term='firefox history restore'/><title type='text'>Linux</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>38</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-11963565.post-6850127512436264114</id><published>2011-06-08T22:34:00.000-07:00</published><updated>2011-06-13T22:36:42.559-07:00</updated><title type='text'>hack for Frozen KDE window</title><content type='html'>When the windows in Unix are frozen (can not be resized), you can use the following command.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;kwin --replace &amp;amp;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-6850127512436264114?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/6850127512436264114/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=6850127512436264114' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/6850127512436264114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/6850127512436264114'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2011/06/hack-for-frozen-kde-window.html' title='hack for Frozen KDE window'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-3847465709227565296</id><published>2011-05-30T22:30:00.000-07:00</published><updated>2011-06-13T22:33:15.845-07:00</updated><title type='text'>Tar and untar</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;strong style="font-family: arial;"&gt;Compress folder Test/ to Test.tar.gz&lt;/strong&gt;&lt;/span&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-style: italic;font-size:78%;" &gt;tar czfv Test.tar.gz Test/&lt;/span&gt;&lt;br /&gt;czfv = ‘Compress Zip File Verbose’&lt;br /&gt;If you want bzip files, use ‘j’ instead of ‘z’.&lt;/p&gt; &lt;h2 style="font-family: arial; font-weight: normal;"&gt;&lt;span style="font-size:100%;"&gt;Uncompress Test.tar.gz to folder Test/&lt;/span&gt;&lt;/h2&gt; &lt;p style="font-family: arial;"&gt;&lt;span style="font-style: italic; font-weight: bold;font-size:78%;" &gt;tar -xzf Test.tar.gz&lt;/span&gt;&lt;br /&gt;x = ‘eXtract’&lt;br /&gt;Again, if you want bzip files, use ‘j’ instead of ‘z’.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-3847465709227565296?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/3847465709227565296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=3847465709227565296' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/3847465709227565296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/3847465709227565296'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2011/05/tar-and-untar.html' title='Tar and untar'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-2947544413108194895</id><published>2011-04-25T22:59:00.000-07:00</published><updated>2011-05-25T23:01:53.481-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ARM toolchain'/><title type='text'>fromelf</title><content type='html'>&lt;p style="font-family: arial;"&gt;fromELF is the ARM image conversion utility.&lt;br /&gt;supports plain binary, Motorola 32-bit S-record format, Intel Hex-32 format,Byte Oriented Hex format.&lt;/p&gt; &lt;p style="font-family: arial;"&gt;To convert an ELF file to a plain binary (.bin) file, enter:&lt;br /&gt;&lt;em&gt;fromelf --bin -o outfile.bin infile.axf&lt;/em&gt;&lt;/p&gt; &lt;p style="font-family: arial;"&gt;To produce a plain-text output file that contains the disassembled version of an ELF file&lt;br /&gt;and the symbol table, enter:&lt;br /&gt;&lt;em&gt;fromelf -c -s -o outfile.lst infile.axf&lt;/em&gt;&lt;/p&gt;&lt;p style="font-family: arial;"&gt;&lt;em&gt;fromelf -c image.axf will list the symbols&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-2947544413108194895?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/2947544413108194895/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=2947544413108194895' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/2947544413108194895'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/2947544413108194895'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2011/04/fromelf.html' title='fromelf'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-8260463904467080449</id><published>2010-05-25T22:56:00.000-07:00</published><updated>2011-05-25T22:58:16.327-07:00</updated><title type='text'>Changing the terminal font size</title><content type='html'>Gnome terminal&lt;br /&gt;--------------&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Edit-&amp;gt;Profiles-&amp;gt;Default-&amp;gt; Edit&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;uncheck use the system terminal font and set the required font size and type&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-8260463904467080449?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/8260463904467080449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=8260463904467080449' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/8260463904467080449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/8260463904467080449'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2010/05/changing-terminal-font-size.html' title='Changing the terminal font size'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-9032966781446079162</id><published>2009-09-07T02:05:00.001-07:00</published><updated>2009-09-07T02:12:10.113-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell beep'/><title type='text'>Disable beep sound in Linux</title><content type='html'>Felt that beep sound (bell) annoying whenever i operate on gvim or shell and if i do something extra. To disable that add this line into .cshrc file&lt;br /&gt;setenv bell-style none&lt;br /&gt;quit the terminal and open again. Say bye to beep sounds! "set vb" command in gvim will also suppress the audible bell in the gvim and rather do visual bell!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-9032966781446079162?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/9032966781446079162/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=9032966781446079162' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/9032966781446079162'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/9032966781446079162'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2009/09/disable-beep-sound-in-linux.html' title='Disable beep sound in Linux'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-7179805188194686388</id><published>2009-08-31T04:50:00.000-07:00</published><updated>2009-08-31T04:56:43.006-07:00</updated><title type='text'>Mail from linux prompt</title><content type='html'>&lt;pre&gt;&lt;span style="font-family:times new roman;"&gt;Simple way to send an attachment over mail&lt;/span&gt; from the linux shell&lt;br /&gt;&lt;br /&gt;uuencode surfing.jpeg surfing.jpeg | mail sylvia@home.com&lt;br /&gt;&lt;br /&gt;mutt -s "Birthday celebration" -a citymap.jpg all@friends.org \&lt; invitation.txt&lt;br /&gt;&lt;br /&gt;To send without message&lt;br /&gt;mutt -s "Birthday celebration" -a citymap.jpg all@friends.org \&lt; /dev/null &lt;br /&gt;&lt;br /&gt;Reference:&lt;br /&gt;&lt;a href="http://www.shelldorado.com/articles/mailattachments.html"&gt;http://www.shelldorado.com/articles/mailattachments.html&lt;/a&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-7179805188194686388?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/7179805188194686388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=7179805188194686388' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/7179805188194686388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/7179805188194686388'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2009/08/mail-from-linux-prompt.html' title='Mail from linux prompt'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-3708105511576524846</id><published>2009-08-04T07:57:00.000-07:00</published><updated>2009-08-04T08:03:55.915-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox history restore'/><title type='text'>History recovery from backup in Firefox3</title><content type='html'>&lt;span style="font-family:times new roman;"&gt;Firefox stores the webpage browsing history in the following folder&lt;/span&gt;&lt;br /&gt;&lt;code&gt;&lt;span style="font-family:arial;"&gt;%APPDATA%\Mozilla\Firefox\Profiles\&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;In my windows xp machine it was&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;C:\Documents and Settings\username&lt;/span&gt;&lt;userid&gt;&lt;span style="font-family:arial;"&gt;\Application Data\Mozilla\Firefox\Profiles\ycexgsuz.default&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;It will be in a file called places.sqlite. For restore I renamed the existing .sqlite with the old one and all the history is available in the new firefox&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/userid&gt;&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-3708105511576524846?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/3708105511576524846/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=3708105511576524846' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/3708105511576524846'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/3708105511576524846'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2009/08/history-recovery-from-backup-in.html' title='History recovery from backup in Firefox3'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-7252794645535587790</id><published>2009-08-04T04:47:00.000-07:00</published><updated>2009-08-04T08:04:14.531-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='firefox bookmarks restore'/><title type='text'>Restoring bookmarks in firefox</title><content type='html'>I had to reinstall the OS on a different drive and had to reinstall firefox as well. Figured out a way to restore the bookmarks from the backup. This worked with firefox 3.5.2&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Browse and navigate to the location in hard disk where windows is installed&lt;/li&gt;&lt;li&gt;Go to the location Then go to the following location C:\Documents and Settings\&lt;strong&gt;&lt;username&gt;&lt;/username&gt;&lt;/strong&gt;username\Application Data\Mozilla\Firefox\Profiles\&lt;/li&gt;&lt;li&gt;Inside the profiles folder there will be &lt;randomstring&gt;.default folder&lt;/randomstring&gt;&lt;/li&gt;&lt;li&gt;Inside this directory there will be a bookmarksbackup folder&lt;/li&gt;&lt;li&gt;There will be a bunch of .JSON files stored as backups with the dates and times&lt;/li&gt;&lt;li&gt;You can replace your current bookmarks with a backup copy by opening the Firefox 3  ("Bookmarks -&gt; Organize Bookmarks -&gt; Import and Backup -&gt; Restore..." ). You can select one of the five dated backups that Firefox automatically creates or you can use the "Choose File..." option to select another bookmark backup file.&lt;/li&gt;&lt;li&gt;Choose the JSON file then restart firefox this will restore your bookmarks&lt;/li&gt;&lt;/ol&gt;References:&lt;br /&gt;[1] &lt;a href="http://www.clazh.com/how-to-restore-and-recover-your-firefox-bookmarks/"&gt;http://www.clazh.com/how-to-restore-and-recover-your-firefox-bookmarks/&lt;/a&gt;&lt;br /&gt;[2] &lt;a href="http://kb.mozillazine.org/Lost_bookmarks"&gt;http://kb.mozillazine.org/Lost_bookmarks&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-7252794645535587790?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/7252794645535587790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=7252794645535587790' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/7252794645535587790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/7252794645535587790'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2009/08/restoring-bookmarks-in-firefox-folder.html' title='Restoring bookmarks in firefox'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-4145621082942020799</id><published>2009-05-10T06:20:00.000-07:00</published><updated>2009-07-10T06:24:27.256-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gvim'/><title type='text'>Gvim tip #1</title><content type='html'>&lt;span style="font-family:arial;"&gt;To delete a line containing a pattern&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;:g/profile/d&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;To see the lines that this command will delete&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;:g/profile&lt;br /&gt;&lt;/pre&gt;Reference:&lt;br /&gt;[1] &lt;a href="http://vim.wikia.com/wiki/Delete_all_lines_containing_a_pattern"&gt;http://vim.wikia.com/wiki/Delete_all_lines_containing_a_pattern&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-4145621082942020799?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/4145621082942020799/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=4145621082942020799' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/4145621082942020799'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/4145621082942020799'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2009/05/gvim-tip-1.html' title='Gvim tip #1'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-6192443406258315208</id><published>2009-04-22T07:03:00.000-07:00</published><updated>2009-04-22T07:08:49.371-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Perl'/><title type='text'>Excel macro from Perl</title><content type='html'>A Macro defined in Excel can be called from Perl. Here is the following code derived on googling that did the magic&lt;br /&gt;&lt;br /&gt;use strict;&lt;br /&gt;use Win32::OLE qw(in with);&lt;br /&gt;use Win32::OLE::Const 'Microsoft Excel';&lt;br /&gt;$Win32::OLE::Warn = 3;&lt;br /&gt;&lt;br /&gt;my $Excel = Win32::OLE-&gt;GetActiveObject('Excel.Application')||Win32::OLE-&gt;new('Excel.Application', 'Quit');  # use the Excel application i&lt;br /&gt;#f it's open, otherwise open new&lt;br /&gt;&lt;br /&gt;my $Book = $Excel-&gt;Workbooks-&gt;Open( "c:\\Test.xls" ); # open the file&lt;br /&gt;&lt;br /&gt;my $Sheet = $Book-&gt;Worksheets(2);&lt;br /&gt;printf ("the value is %s \n",$Sheet-&gt;Cells(1,3)-&gt;{'Value'});&lt;br /&gt;&lt;br /&gt;$Excel-&gt;Run("SetIO");&lt;br /&gt;$Excel-&gt;Run("CommandButton1_Click");&lt;br /&gt;#$Excel-&gt;Run("Temp");&lt;br /&gt;$Book-&gt;Save; #optional - save any changes made by the macro&lt;br /&gt;$Book-&gt;Close;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-6192443406258315208?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/6192443406258315208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=6192443406258315208' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/6192443406258315208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/6192443406258315208'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2009/04/excel-macro-from-perl.html' title='Excel macro from Perl'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-2975093445607145127</id><published>2008-11-22T10:38:00.000-08:00</published><updated>2009-01-22T10:39:58.991-08:00</updated><title type='text'>gvim in ubuntu</title><content type='html'>somehow in my ubuntu machine gvim was not working had to install vim-perl or vim-gtk to get gvim to work.&lt;br /&gt;&lt;br /&gt;sudo apt-get install vim-perl&lt;br /&gt;&lt;br /&gt;installed the necessary packages and after that gvim started working.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-2975093445607145127?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/2975093445607145127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=2975093445607145127' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/2975093445607145127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/2975093445607145127'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2008/11/gvim-in-ubuntu.html' title='gvim in ubuntu'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-7428210012775603684</id><published>2008-09-06T01:27:00.000-07:00</published><updated>2008-10-29T13:33:57.519-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux ubuntu DVD'/><title type='text'>Playing a DVD in ubuntu</title><content type='html'>In order to play DVDs, you must install some additional software. Unfortunately, DVD support is not provided by default in Ubuntu due to legal and technical restrictions.&lt;br /&gt;&lt;br /&gt;To play DVD install the following packages &lt;span style="font-weight: bold;"&gt;libdvdnav4&lt;/span&gt; and &lt;span style="font-weight: bold;"&gt;libdvdread3&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;for playing encrypted DVDs in a terminal type&lt;br /&gt;sudo /usr/share/doc/libdvdread3/install-css.sh&lt;br /&gt;&lt;br /&gt;After this if you insert a DVD it should play using totem player. But somehow i did not get the menus properly in that player so installed &lt;span style="font-weight: bold;"&gt;gxine&lt;/span&gt; that gave the proper DVD menus.&lt;br /&gt;&lt;br /&gt;Somehow i am getting an error printed in console&lt;br /&gt;&lt;br /&gt;*** libdvdread: CHECK_VALUE failed in nav_read.c:207 ***&lt;br /&gt;*** for dsi-&gt;dsi_gi.zero1 == 0 ***&lt;br /&gt;&lt;br /&gt;but right now i am happy that i am able to play DVDs properly in Ubuntu. I am ignoring this error as of now&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-7428210012775603684?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/7428210012775603684/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=7428210012775603684' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/7428210012775603684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/7428210012775603684'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2008/09/playing-dvd-in-ubuntu.html' title='Playing a DVD in ubuntu'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-7278810717854611811</id><published>2008-09-01T12:19:00.000-07:00</published><updated>2008-09-08T12:23:06.225-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>C in Ubuntu</title><content type='html'>The standard set of libraries for C are not installed by default. When i tried to compile a C file it gave errors like stdio.h not found,etc Eventually it did not create the out file. Found out from ubuntu forums that i need to install build-essential package to install few developer libraries and packages.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;sudo apt-get install build-essential&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;After this step compilation went through&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-7278810717854611811?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/7278810717854611811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=7278810717854611811' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/7278810717854611811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/7278810717854611811'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2008/09/c-in-ubuntu.html' title='C in Ubuntu'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-5467426308405226190</id><published>2008-08-30T11:54:00.000-07:00</published><updated>2008-08-30T12:01:42.266-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Ubuntu-8.04 rocks!</title><content type='html'>I installed Ubunty 8.04 Hardy on my Inspiron 1520. The installation went through very smoothly. I was amazed to find such an easy Linux installation. That too most of the hardware worked. Could test most of my hardware with the Live CD version itself. The installation was over in around 20 minutes.&lt;br /&gt;&lt;br /&gt;After i booted into the installed linux by mistake i installed the restricted drivers for my nvidia GeForce graphics card. That's the end of it. No Xserver worked after i rebooted. I did not hear the Ubuntu's community warning that i should not install the restricted driver. Could not get to uninstall it in recovery mode. So switched to command mode(without X) in normal bootup mode and did&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;sudo dpkg-reconfigure xserver-xorg -phigh&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;this reconfigured the Xserver files to use the default drivers for X and could boot again properly. Thanks to Ubuntu community forum! Now i need to find out how to get the proper versions of the driver.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-5467426308405226190?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/5467426308405226190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=5467426308405226190' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/5467426308405226190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/5467426308405226190'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2008/08/ubuntu-804-rocks.html' title='Ubuntu-8.04 rocks!'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-3440412870863600899</id><published>2007-11-11T09:29:00.000-08:00</published><updated>2007-11-11T09:33:16.825-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='windowsxp'/><title type='text'>Weak CMOS battery</title><content type='html'>For several weeks i had been facing issue with my BIOS settings that my PC never remembered the current date and time. The situation has become worse that windows is not even booting up with a weak CMOS battery. It just freezes in that blue logon screen. Even Safemode boot is not happening with the boot freezing at mup.sys. On the other hand Linux boots up properly.&lt;br /&gt;It seems that with a Weak CMOS battery windows will not boot.&lt;br /&gt;&lt;br /&gt;Its high time that my motherboard needs CMOS battery replaced.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-3440412870863600899?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/3440412870863600899/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=3440412870863600899' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/3440412870863600899'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/3440412870863600899'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2007/11/weak-cmos-battery.html' title='Weak CMOS battery'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-4037357688127505741</id><published>2007-11-09T01:43:00.000-08:00</published><updated>2007-11-09T01:48:24.513-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linuxconfig'/><title type='text'>DNS configuration in ubuntu</title><content type='html'>I tried to boot with Ubuntu live CD. Ethernet configuration was fine. ping to any internet sites worked but could not browse through browser since there was some DNS server issue. The DNS server was not resolved properly. Opened the Dlink router administration page through browser to find the DNS server IP address. There is a file called /etc/resolv.conf. (you might need to do sudo to edit this file). Replace the nameserver IP address with the DNS server IP address in the Dlink page.  Restarted the browser and it started working. Thanks to Vijairaj for guiding this out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-4037357688127505741?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/4037357688127505741/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=4037357688127505741' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/4037357688127505741'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/4037357688127505741'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2007/11/dns-configuration-in-ubuntu.html' title='DNS configuration in ubuntu'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-4038756865091045764</id><published>2007-09-13T08:22:00.000-07:00</published><updated>2008-10-30T08:27:11.906-07:00</updated><title type='text'>Safely remove hardware in windows for smooth linux use</title><content type='html'>Whenever i tried to access my FreeAgent USB Harddrive in windows and unplug it without using the safely remove hardware feature in windows, i am not able to mount it properly in linux. When i just boot into windows and connect the harddisk and use safely remove hardware. it starts mounting properly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-4038756865091045764?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/4038756865091045764/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=4038756865091045764' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/4038756865091045764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/4038756865091045764'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2007/09/safely-remove-hardware-in-windows-for.html' title='Safely remove hardware in windows for smooth linux use'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-244229450632616079</id><published>2007-09-11T09:25:00.000-07:00</published><updated>2007-11-11T09:28:40.526-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ubuntu'/><title type='text'>Ubuntu 7.10</title><content type='html'>Had a feel of Ubuntu from a older Live CD. The Ubuntu linux really rocks. So downloaded the latest Ubuntu 7.10 named Gutsy. Will try to install it and play around with it. It is really great to hear that the distro will be supported officially upto 2 years. A free distro with 2 years of support.&lt;br /&gt;Downloaded the iso image. Let us see how my plan goes?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-244229450632616079?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/244229450632616079/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=244229450632616079' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/244229450632616079'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/244229450632616079'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2007/09/ubuntu-710.html' title='Ubuntu 7.10'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-3671171675249993602</id><published>2007-05-16T17:59:00.000-07:00</published><updated>2007-10-16T18:03:14.776-07:00</updated><title type='text'>Makefile for Win32 environment</title><content type='html'>There is a precompiled makefile available which could be used to run GNU make in win-32 environments (MSDOS/Windows)&lt;br /&gt;&lt;br /&gt;Links below&lt;br /&gt;&lt;br /&gt;[1] &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=2435"&gt;http://sourceforge.net/project/showfiles.php?group_id=2435&lt;/a&gt;&lt;br /&gt;[2]&lt;a href="http://sourceforge.net/project/showfiles.php?group_id=2435&amp;amp;package_id=23918"&gt;http://sourceforge.net/project/showfiles.php?group_id=2435&amp;amp;package_id=23918&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-3671171675249993602?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/3671171675249993602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=3671171675249993602' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/3671171675249993602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/3671171675249993602'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2007/01/makefile-for-win32-environment.html' title='Makefile for Win32 environment'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-8283739959639992576</id><published>2007-03-12T07:23:00.000-07:00</published><updated>2007-03-12T07:40:27.084-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='makefile'/><title type='text'>Makefile -overriding variables</title><content type='html'>To override the variables defined in the makefile from the command line,this will do&lt;br /&gt;   &lt;span class="samp"&gt;&lt;span style="font-style: italic;"&gt;make CFLAGS='-g -O'&lt;/span&gt; .This will override the assignment of CFLAGS in the  makefile. the simple assignment in the makefile will be ignored. Found this out from [1]&lt;br /&gt;&lt;br /&gt;  There is a way to override this assignment in the command line using the override directive&lt;br /&gt;&lt;/span&gt; If a variable has been set with a command argument , then ordinary assignments in the makefile are ignored.  If you want to set the variable in the makefile even though it was set with a command argument, you can use an &lt;code&gt;override&lt;/code&gt; directive.&lt;br /&gt;Syntax:&lt;br /&gt;In makefile use&lt;br /&gt;&lt;pre class="example"&gt;override &lt;var&gt;variable&lt;/var&gt; = &lt;var&gt;value&lt;/var&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Further details in [2]&lt;br /&gt;&lt;span class="samp"&gt;&lt;br /&gt;&lt;/span&gt;  &lt;span style="font-weight: bold;"&gt;References:&lt;/span&gt;&lt;br /&gt;[1] http://www.gnu.org/software/autoconf/manual/make/Overriding.html&lt;br /&gt;[2]&lt;br /&gt;http://www.gnu.org/software/autoconf/manual/make/Override-Directive.html#Override-Directive&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-8283739959639992576?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/8283739959639992576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=8283739959639992576' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/8283739959639992576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/8283739959639992576'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2007/03/makefile-overriding-variables.html' title='Makefile -overriding variables'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-8915202688152387136</id><published>2007-02-12T05:09:00.000-08:00</published><updated>2007-02-12T05:21:04.480-08:00</updated><title type='text'>windows xp blues: Firefox js3250.dll problem</title><content type='html'>Suddenly my firefox failed to start stating that js3250.dll is not found. I reinstalled firefox and it started working .When i clicked an icon in the desktop got the error "Can't load library from memory". Firefox crashed abruptly. Without having any clue of what is happening i googled for an hour and found this working solution!This is the only solution that worked&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 153);"&gt;&lt;strong&gt;Go to C:\Windows\System32\ipv6monl.dll and delete it. Reinstall Firefox and it will work fine&lt;br /&gt;&lt;br /&gt;&lt;/strong&gt;&lt;/span&gt;This is the only solution that worked.Thanks to the link given below&lt;br /&gt;&lt;br /&gt;&lt;a href="HKEY_LOCAL_MACHINE%5CSOFTWARE%5CMicrosoft%5CWindows%20NT%5CCurrentVersion%5CWinlogon"&gt;http://anothermonkey.blogspot.com/2007/01/computers-bloody-computers-firefox-and.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-8915202688152387136?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/8915202688152387136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=8915202688152387136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/8915202688152387136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/8915202688152387136'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2007/02/windows-xp-blues-firefox-js3250dll.html' title='windows xp blues: Firefox js3250.dll problem'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-1048164404797641256</id><published>2007-02-01T05:18:00.000-08:00</published><updated>2007-03-12T07:31:20.488-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='makefile'/><title type='text'>alternate makefile name</title><content type='html'>&lt;p&gt; The way to specify the name of the makefile is with the &lt;samp&gt;`-f'&lt;/samp&gt; or &lt;samp&gt;`--file'&lt;/samp&gt; option (&lt;samp&gt;`--makefile'&lt;/samp&gt; also works).  For example, &lt;samp&gt;`-f altmake'&lt;/samp&gt; says to use the file &lt;tt&gt;`altmake'&lt;/tt&gt; as the makefile.  &lt;/p&gt; &lt;p&gt; If you use the &lt;samp&gt;`-f'&lt;/samp&gt; flag several times and follow each &lt;samp&gt;`-f'&lt;/samp&gt; with an argument, all the specified files are used jointly as makefiles.  &lt;/p&gt;  If you do not use the &lt;samp&gt;`-f'&lt;/samp&gt; or &lt;samp&gt;`--file'&lt;/samp&gt; flag, the default is to try &lt;tt&gt;`GNUmakefile'&lt;/tt&gt;, &lt;tt&gt;`makefile'&lt;/tt&gt;, and &lt;tt&gt;`Makefile'&lt;/tt&gt;, in that order, and use the first of these three which exists or can be made&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-1048164404797641256?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/1048164404797641256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=1048164404797641256' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/1048164404797641256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/1048164404797641256'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2007/02/alternate-makefile-name.html' title='alternate makefile name'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-511338642910256718</id><published>2007-01-20T11:13:00.000-08:00</published><updated>2007-02-12T05:13:12.249-08:00</updated><title type='text'>windows xp blues: ibm0001.exe malware</title><content type='html'>Suddenly my uncle reported that whenever he boots up his PC he is getting an error&lt;br /&gt;&lt;br /&gt;"&lt;span name="KonaBody"&gt;&lt;span class="searchword"&gt;Windows&lt;/span&gt; cannot find C:\program files\common files\microsoft shared\web folders\&lt;span class="searchword"&gt;ibm0001.exe" that file does not exist at all. Found a solution that worked at that instant&lt;br /&gt;&lt;br /&gt;open regedit type regedit in Run prompt&lt;br /&gt;&lt;br /&gt;navigate to the entry&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="CODE"&gt;HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;there will be a key named "shell" with value explorer.exe and with multiple spaces you will find ibm0001. exe link.Restore this to explorer.exe alone..&lt;br /&gt;&lt;br /&gt;even find result will show only explorer and i missed the ibm0001.exe at the end that was there at the end of the string with several empty spaces in the middle.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-511338642910256718?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/511338642910256718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=511338642910256718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/511338642910256718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/511338642910256718'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2007/01/windows-xp-blues-ibm0001exe-malware.html' title='windows xp blues: ibm0001.exe malware'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-1067428301727242821</id><published>2006-12-02T01:42:00.000-08:00</published><updated>2007-02-16T01:47:49.304-08:00</updated><title type='text'>windows xp:Recreating show desktop icon in quick launch</title><content type='html'>&lt;p&gt;&lt;span style="font-size:85%;"&gt; Use Notepad to create a text file with the following contents:&lt;br /&gt;                   [Shell]&lt;br /&gt;                   Command=2&lt;br /&gt;                   IconFile=explorer.exe,3&lt;br /&gt;                   [Taskbar]&lt;br /&gt;                   Command=ToggleDesktop&lt;/span&gt;&lt;/p&gt; &lt;span style="font-size:85%;"&gt;                  &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt; Save the file as Show Desktop.scf. (You can name it something                      else if you prefer, but make sure you use the .scf file extension.)&lt;/span&gt;&lt;/p&gt; &lt;span style="font-size:85%;"&gt;                  &lt;/span&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt; You can save the file where you want, and then create a                      shortcut on your Quick Launch toolbar.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:85%;"&gt;You will also need to make sure that the SCF file extension                      is set up properly in Windows&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-1067428301727242821?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/1067428301727242821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=1067428301727242821' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/1067428301727242821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/1067428301727242821'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2007/02/windows-xprecreating-show-desktop-icon.html' title='windows xp:Recreating show desktop icon in quick launch'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-116428991190764191</id><published>2006-11-23T05:47:00.000-08:00</published><updated>2006-11-23T05:51:51.926-08:00</updated><title type='text'>MAC frame format</title><content type='html'>&lt;p&gt; The following illustrates the format of an Ethernet frame as defined in the original IEEE 802.3 standard: &lt;/p&gt;&lt;p&gt; &lt;table border="1" width="600"&gt; &lt;tbody&gt;&lt;tr&gt; &lt;td align="center" width="15%"&gt;Preamble (7-bytes)&lt;/td&gt; &lt;td align="center" width="5%"&gt;Start Frame Delimiter (1-byte)&lt;/td&gt; &lt;td align="center" width="12%"&gt;Dest. MAC Address (6-bytes)&lt;/td&gt; &lt;td align="center" width="12%"&gt;Source MAC Address (6-bytes)&lt;/td&gt; &lt;td align="center" width="6%"&gt;Length / Type (2-bytes)&lt;/td&gt; &lt;td align="center" width="30%"&gt;MAC Client Data&lt;br /&gt;(0-n bytes)&lt;/td&gt; &lt;td align="center" width="10%"&gt;Pad&lt;br /&gt;(0-p bytes)&lt;/td&gt; &lt;td align="center" width="10%"&gt;Frame Check Sequence (4-bytes)&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;  &lt;/p&gt;&lt;dl&gt;&lt;dt&gt;&lt;b&gt;Preamble:&lt;/b&gt; &lt;/dt&gt;&lt;dd&gt;A sequences of 56 bits having alternating 1 and 0 values that are used for synchronization.  They serve to give components in the network time to detect the presence of a signal, and being reading the signal before the frame data arrives.Each byte will be 0x55&lt;br /&gt;&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Start Frame Delimiter:&lt;/b&gt; &lt;/dt&gt;&lt;dd&gt;A sequence of 8 bits having the bit configuration 10101011 that indicates the start of the frame.&lt;br /&gt;&lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Destination &amp; Source MAC Addresses:&lt;/b&gt; &lt;/dt&gt;&lt;dd&gt;The Destination MAC Address field identifies the station or stations that are to receive the frame.  The Source MAC Address identifies the station that originated the frame. The 802.3 standard permits these address fields to be either 2-bytes or 6-bytes in length, but virtually all Ethernet implementations in existence today use 6-byte addresses. A Destination Address may specify either an "individual address" destined for a single station, or a "multicast address" destined for a group of stations. A Destination Address of all 1 bits refers to all stations on the LAN and is called a "broadcast address". &lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Length/Type:&lt;/b&gt; &lt;/dt&gt;&lt;dd&gt;If the value of this field is less than or equal to 1500, then the Length/Type field indicates the number of bytes in the subsequent MAC Client Data field. If the value of this field is greater than or equal to 1536, then the Length/Type field indicates the nature of the MAC client protocol (protocol type).   &lt;/dd&gt;&lt;dt&gt;&lt;b&gt;MAC Client Data:&lt;/b&gt; &lt;/dt&gt;&lt;dd&gt;This field contains the data transferred from the source station to the destination station or stations. The maximum size of this field is 1500 bytes.  If the size of this field is less than 46 bytes, then use of the subsequent "Pad" field is necessary to bring the frame size up to the minimum length. &lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Pad:&lt;/b&gt; &lt;/dt&gt;&lt;dd&gt;If necessary, extra data bytes are appended in this field to bring the frame length up to its minimum size.  A minimum Ethernet frame size is 64 bytes from the Destination MAC Address field through the Frame Check Sequence. &lt;/dd&gt;&lt;dt&gt;&lt;b&gt;Frame Check Sequence:&lt;/b&gt; &lt;/dt&gt;&lt;dd&gt;This field contains a 4-byte cyclical redundancy check (CRC) value used for error checking.  When a source station assembles a MAC frame, it performs a CRC calculation on all the bits in the frame from the Destination MAC Address through the Pad fields (that is, all fields except the preamble, start frame delimiter, and frame check sequence).  The source station stores the value in this field and transmits it as part of the frame. When the frame is received by the destination station, it performs an identical check.  If the calculated value does not match the value in this field, the destination station assumes an error has occurred during transmission and discards the frame. &lt;/dd&gt;&lt;/dl&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-116428991190764191?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/116428991190764191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=116428991190764191' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/116428991190764191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/116428991190764191'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2006/11/mac-frame-format.html' title='MAC frame format'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-114960843864277288</id><published>2006-06-06T08:36:00.000-07:00</published><updated>2006-06-06T08:40:38.643-07:00</updated><title type='text'>A book on 2.6 kernel</title><content type='html'>&lt;span class="sans"&gt;Third edition of the book&lt;br /&gt;&lt;/span&gt;&lt;b class="sans"&gt;Understanding the Linux Kernel&lt;/b&gt; - by Bovet,cesati is out.&lt;br /&gt;&lt;br /&gt;This covers the 2.6 kernel internals.&lt;br /&gt;&lt;br /&gt;One more good buy is&lt;br /&gt;&lt;br /&gt;Linux kernel programming by Robert Love.&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt;[1] &lt;a href="http://www.amazon.com/gp/product/0596005652/ref=pd_lpo_k2_dp_k2a_2_txt/002-1078100-5163221?%5Fencoding=UTF8"&gt;Amazon Link for Bovet book&lt;/a&gt;&lt;br /&gt;[2] &lt;a href="http://www.amazon.com/gp/product/0672327201/qid=1149608225/sr=2-1/ref=pd_bbs_b_2_1/002-1078100-5163221?s=books&amp;v=glance&amp;amp;n=283155"&gt;Link for Robert Love Book&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-114960843864277288?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/114960843864277288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=114960843864277288' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/114960843864277288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/114960843864277288'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2006/06/book-on-26-kernel.html' title='A book on 2.6 kernel'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-114960806057860255</id><published>2006-06-06T08:30:00.000-07:00</published><updated>2007-03-12T07:33:14.004-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='makefile'/><title type='text'>Makefile wildcards!</title><content type='html'>Blogging after a very long gap!&lt;br /&gt;&lt;br /&gt;There came a need to compile all the c files in directory.Learnt that i need to make use of wildcards&lt;br /&gt;&lt;br /&gt;a makefile to compile all C source files in the directory and then link them together could be written as follows:    &lt;pre&gt;objects := $(patsubst %.c,%.o,$(wildcard *.c))&lt;br /&gt;&lt;br /&gt;foo : $(objects)&lt;br /&gt;      cc -o foo $(objects)&lt;br /&gt;&lt;br /&gt;and a few pointers as usual&lt;br /&gt;&lt;br /&gt;[1]&lt;a href="http://www.metalshell.com/view/tutorial/120/"&gt; http://www.metalshell.com/view/tutorial/120/&lt;/a&gt;&lt;br /&gt;[2] &lt;a href="http://theory.uwinnipeg.ca/localfiles/infofiles/make/make_25.html"&gt;http://theory.uwinnipeg.ca/localfiles/infofiles/make/make_25.html&lt;/a&gt;&lt;br /&gt;[3] &lt;a href="http://www.gnu.org/software/make/manual/make.html"&gt;http://www.gnu.org/software/make/manual/make.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-114960806057860255?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/114960806057860255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=114960806057860255' title='23 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/114960806057860255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/114960806057860255'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2006/06/makefile-wildcards.html' title='Makefile wildcards!'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>23</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-112317818231078358</id><published>2005-08-04T09:35:00.000-07:00</published><updated>2005-08-04T10:56:22.340-07:00</updated><title type='text'>Dynamic Minors</title><content type='html'>The USB device driver can make use of the USB's major number (usually 180 ).The minor number base is  registered with the usb subsystem during the device registration .This is done with the usb_register_dev function that takes a pointer to a struct usb_class_driver as an argument.The minor_base field of the structure is the start of the assigned minor range for the driver.&lt;br /&gt;&lt;br /&gt;The udev rules created the device node with the major number 180 and minor number (SKEL_MINOR_BASE) that i registered with the usb_class_driver function.A kernel with &lt;span style="font-weight: bold;"&gt;CONFIG_USB_DYNAMIC_MINORS&lt;/span&gt; configuration enabled,ignores this field and assigns minor number on the fly.The first usb device gets minor no 0 and the next 1 and so on.In that case udev is the best solution to handle the device nodes.The conventional static /dev management will not hold good in ths case.&lt;br /&gt;&lt;br /&gt;The minor no assigned for the device can be obtained after a succesful call to &lt;span style="font-weight: bold;"&gt;usb_register_dev(interface,&amp;skel_class_driver) &lt;/span&gt;from the  &lt;span style="font-weight: bold;"&gt;minor&lt;/span&gt; member of the &lt;span style="font-weight: bold;"&gt;usb_interface&lt;/span&gt; structure(interface-&gt;minor).&lt;br /&gt;&lt;br /&gt;For a working skeleton/example  details refer the usb-skeleton.c file in the kernel source tree.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-112317818231078358?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/112317818231078358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=112317818231078358' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/112317818231078358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/112317818231078358'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2005/08/dynamic-minors.html' title='Dynamic Minors'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-112153949120103647</id><published>2005-07-16T11:30:00.000-07:00</published><updated>2005-07-16T11:44:51.213-07:00</updated><title type='text'>Udev rules</title><content type='html'>&lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;A bit of history:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;In linux the devices are represented as a file in the device directory /dev that is used by other user space programs to access the device.A typical example is /dev/ttyS0 that represents the first serial port in the machine. Each and every device has a unique major and minor number. But the /dev directory is too big. I found some 10000+ entries in a Linux distro in the /dev directory which makes it almost impossible to keep track of the associations between the device file and the device.&lt;span style=""&gt;  &lt;/span&gt;For this the devfs concept evolved (thank god I haven’t worked much on the devfs now it has been removed from the kernel), which helps in creating the device nodes as and when the device is connected.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;Udev:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;udev run’s in user space and it is userspace device file system and it helps to create a dynamic /dev .It makes use of the hotplug events to accomplish its goals.To work with udev we need to create udev rules. Udev’s rules are in /etc/udev/rules.d directory.More info on udev can be found from [4].Udev makes use of the sysfs file system in the 2.6 kernels.To make use of  udev we need to create udev rules. &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;A udev rule defines the mapping between a device's attributes and the desired device filename. Default udev rules can be found in the /etc/udev/rules.d/50-udev.rules file. Files in the rules.d directory are parsed in the &lt;span style="font-weight: bold;"&gt;lexical&lt;/span&gt; order. When the udev finds a matching rule it stops parsing and the rule is applied.we can create our own rules the rule filename should have the .rules suffix.I prefer to create  my own rules file .&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;Details on writing udev rules can be found from [2] or [4].&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;span style="font-family: Arial;"&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt; &lt;pre style=""&gt;&lt;span style="font-family: Arial;"&gt;Here is an example:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;     &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;BUS="usb", SYSFS{idVendor}="04e6", SYSFS{idProduct}="e001", NAME="usb/mydev%n"&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;&lt;!--[if !supportEmptyParas]--&gt;This rule specifies to create the node mydev%n in the usb directory of /dev.When the device is plugged in after the drivers are loaded the sysfs nodes are created.When the vendor and product ids specified in the rule matches the one in sysfs the device node is created which is purely dynamic.when the device is unplugged the device node is removed.&lt;br /&gt;&lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal"&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;udev defaults to creating nodes with unix permissions of 0660 (read/write to owner and group), which is configured by the default_mode setting inside &lt;i&gt;/etc/udev/udev.conf&lt;/i&gt;. There may be some situations where you do not want to use the default permissions on your device node. Fortunately, you can easily override the permissions in your rules using the &lt;i&gt;MODE&lt;/i&gt; assignment key,as in MODE="0666"&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt; &lt;span style="font-size: 10pt; font-family: Arial;"&gt; &lt;!--[endif]--&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;Related Links:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;     &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;[1] &lt;a href="http://www.lanana.org/"&gt;http://www.lanana.org/&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;[2] &lt;a href="http://www.linuxjournal.com/article/7316"&gt;http://www.linuxjournal.com/article/7316&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;[3] &lt;a href="http://www.linuxjournal.com/article/7496"&gt;http://www.linuxjournal.com/article/7496&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;[4] &lt;a href="http://www.reactivated.net/writing_udev_rules.html"&gt;http://www.reactivated.net/writing_udev_rules.html&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;[5] &lt;a href="http://kernel.org/pub/linux/utils/kernel/hotplug/udev_vs_devfs"&gt;http://kernel.org/pub/linux/utils/kernel/hotplug/udev_vs_devfs&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;   &lt;p class="MsoNormal" style=""&gt;&lt;span style="font-size: 10pt; font-family: Arial;"&gt;[6] &lt;a href="http://kerneltrap.org/node/5340"&gt;http://kerneltrap.org/node/5340&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style=""&gt;&lt;span style=";font-family:Arial;font-size:10;"  &gt;&lt;a href="http://kerneltrap.org/node/5340"&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-112153949120103647?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/112153949120103647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=112153949120103647' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/112153949120103647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/112153949120103647'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2005/07/udev-rules.html' title='Udev rules'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-112143780108210781</id><published>2005-07-15T07:12:00.000-07:00</published><updated>2005-07-15T07:33:59.776-07:00</updated><title type='text'>Version dependency</title><content type='html'>&lt;span style="font-family:arial;"&gt;Kernel interfaces change from kernel to kernel in that case modules need to be compatible with both versions of kernel.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The need for this occasionally arise.The header file &amp;lt; linux/version.h &amp;gt; contains the related macros.This header is automatically included by module.h.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;LINUX_VERSION_CODE  macro expands to the kernel version release number.E.g:the 2.6.10 kernel is represented as 132618(0x02060a).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;KERNEL_VERSION(x,y,z) macro builds the integer corresponding to the given kernel version.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;E.g:KERNEL_VERSION(2,6,10) will expand to 132618 that can be used to compare the kernel version.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;This can be used with #ifdef to workaround the kernel related interface changes.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;An example:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The usb_unlink_urb has been changed to usb_kill_urb with 2.6.10 kernel.(&lt;/span&gt;&lt;span style="font-family:arial;"&gt;&lt;a href="http://kerneltrap.org/files/ChangeLog-2.6.10"&gt;http://kerneltrap.org/files/ChangeLog-2.6.10&lt;/a&gt; )&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;To handle this verson related change the above discussed macros can be used as in this code snippet:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;#include &amp;lt; linux/version.h &amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;#if LINUX_VERSION_CODE &amp;lt; KERNEL_VERSION(2,6,10)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;          usb_unlink_urb(bulk_out_urb);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;#else&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;           usb_kill_urb(bulk_out_urb);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:arial;" &gt;#endif&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-112143780108210781?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/112143780108210781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=112143780108210781' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/112143780108210781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/112143780108210781'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2005/07/version-dependency.html' title='Version dependency'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-111943846990023186</id><published>2005-06-22T03:53:00.000-07:00</published><updated>2005-06-23T01:55:55.646-07:00</updated><title type='text'>modversions.h problem</title><content type='html'>&lt;span style="font-family:times new roman;"&gt;I was downloading the kernel headers and copying it to /usr/src/..... and using that include directory for compiling the kernel module which turned out to be the wrong way and the best method is to include the one in /lib/modules/'uname -r'/build&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;There was no modversions.h as specified in &lt;linux&gt;.Indeed it was in config/modversions.h and corrected the include method like below that worked out !!&lt;/linux&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;#ifdef    CONFIG_MODVERSIONS&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;    #define    MODVERSIONS    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;    #include &amp;lt config/modversions.h &amp;gt &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 153);font-family:times new roman;" &gt;#endif&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Related Links:&lt;br /&gt;[1] &lt;a href="http://www.skynet.ie/%7Emark/home/kernel/symbols.html"&gt;http://www.skynet.ie/~mark/home/kernel/symbols.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-111943846990023186?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/111943846990023186/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=111943846990023186' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/111943846990023186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/111943846990023186'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2005/06/modversionsh-problem.html' title='modversions.h problem'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-111779358476751940</id><published>2005-06-03T07:03:00.000-07:00</published><updated>2005-06-03T10:48:45.566-07:00</updated><title type='text'>Recompiling the kernel</title><content type='html'>&lt;span style="font-family:times new roman;"&gt;This post is a concise version of [1]&lt;br /&gt;The kernel source can be downloaded from [2]&lt;br /&gt;&lt;br /&gt;If the linux source downloaded is a .bz2 (BZIP compressed format) use this command to extract&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#663333;"&gt;tar xfvj /path/to/linux-2.6.0-test7.tar.bz2&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;or if the source is in .gz (GZIP compressed format ) use this command to extract&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#663333;"&gt;tar xfvz /path/to/linux-2.6.0-test7.tar.gz&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Steps to be followed:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;make config /make menuconfig/ make xconfig&lt;br /&gt;&lt;br /&gt;select the required options&lt;br /&gt;&lt;br /&gt;(save the options to a file in case you want to rebuild this will be easy)&lt;br /&gt;&lt;br /&gt;make dep [not required for 2.6.x]&lt;br /&gt;make clean&lt;br /&gt;make bzImage&lt;br /&gt;&lt;br /&gt;If everything went correctly then the new kernel should exist in ./arch/$ARCH/boot&lt;br /&gt;&lt;br /&gt;make modules&lt;br /&gt;make modules_install (you need to be root to run this command)&lt;br /&gt;&lt;br /&gt;Create the initrd from the kernel image&lt;br /&gt;mkinitrd /boot/initrd-2.6.0.img 2.6.0&lt;br /&gt;Some versions of mkinitrd may require other options to specify the location of the new kernel. For example, the following syntax is required in some systems:&lt;br /&gt;mkinitrd -k vmlinux-VERSION -i initrd-VERSION&lt;br /&gt;&lt;br /&gt;From the ./linux directory, copy the kernel and System.map file to /boot&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Add the kernel to bootloader&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;GRUB&lt;br /&gt;&lt;/strong&gt;Once you have copied the bzImage and System.map to /boot, edit the grub configuration file located in /boot/grub/menu.lst. On some distributions /etc/grub.conf is a symbolic link to this file.&lt;br /&gt;Note that you do not have to rerun grub after making changes to this file&lt;br /&gt;&lt;span style="color:#000099;"&gt;title Test Kernel (2.6.0)&lt;br /&gt;root (hd0,1)&lt;br /&gt;kernel /boot/bzImage-2.6.0 ro root=LABEL=/&lt;br /&gt;initrd /boot/initrd-2.6.0.img&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;default specified as default=0&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;LILO&lt;br /&gt;&lt;/strong&gt;configuration file is located in /etc/lilo.conf on most systems. Unlike GrUB, any changes to lilo.conf will not be set until the lilo program is rerun.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#000099;"&gt;image=/boot/bzImage-2.6.0&lt;br /&gt;label=test-2.6.0&lt;br /&gt;root=/dev/hda2&lt;br /&gt;initrd=/boot/initrd-2.6.0.img&lt;br /&gt;read-only &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;default option specified as&lt;br /&gt;default=[LabelName]&lt;br /&gt;To ensure that the changes are correct please rerun lilo&lt;br /&gt;&lt;br /&gt;While upgrading to the 2.6.x kernel from 2.4.x kernel make it sure that the module-init-tools package is also updated&lt;br /&gt;&lt;br /&gt;More detailed documentation can be found in the Readme file in Documentation of the kernel package.&lt;br /&gt;&lt;br /&gt;For creating the arm-linux kernel follow instruction in [3]&lt;br /&gt;&lt;br /&gt;Related Links:&lt;br /&gt;[1] &lt;a href="http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html#BUILDING"&gt;http://www.digitalhermit.com/linux/Kernel-Build-HOWTO.html#BUILDING&lt;/a&gt;&lt;br /&gt;[2] &lt;a href="http://www.kernel.org/"&gt;http://www.kernel.org/&lt;/a&gt;&lt;br /&gt;[3] &lt;a href="http://www.arm.linux.org.uk/docs/kerncomp.php"&gt;http://www.arm.linux.org.uk/docs/kerncomp.php&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-111779358476751940?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/111779358476751940/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=111779358476751940' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/111779358476751940'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/111779358476751940'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2005/06/recompiling-kernel.html' title='Recompiling the kernel'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-111754887319709892</id><published>2005-05-31T06:48:00.000-07:00</published><updated>2005-05-31T07:16:53.226-07:00</updated><title type='text'>Structure packing in gcc</title><content type='html'>&lt;span style="font-family:times new roman;"&gt;This is a quite common problem.It took some time for me to find out the solution.&lt;br /&gt;gcc does not support the #pragma directives.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;The &lt;strong&gt;&lt;em&gt;&lt;span style="color:#663333;"&gt;__attribute__((packed))&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt; of gcc helps you to do structure packing.It has to be added to the definition of each and every structure to be packed.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;E.g:Here is a packed structure in which the field b is packed, so that it immediately follows a&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000099;"&gt;struct data&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000099;"&gt;{ &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000099;"&gt;char a; &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000099;"&gt;int b;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000099;"&gt;}__attribute__((packed)); &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Times New Roman;color:#000099;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;The attribute can be applied to the individual fields of a structure than applying it to entire structure as in this example&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000099;"&gt;struct foo&lt;br /&gt;{&lt;br /&gt;char a;&lt;br /&gt;int x[2] __attribute__ ((packed));&lt;br /&gt;};&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;Related gcc warnings:&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;strong&gt;-Wpacked&lt;/strong&gt; Warn if a structure is given the packed attribute, but the packed attribute has no effect on the layout or size of the structure. Such structures may be misalignedfor little benefit. For instance, in this code, the variable f.x in structbar will be misaligned even though struct bar does not itself have the packed attribute:&lt;br /&gt;&lt;span style="color:#000099;"&gt;struct foo &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000099;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000099;"&gt;int x;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000099;"&gt;char a, b, c, d;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000099;"&gt;} __attribute__((packed));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000099;"&gt;struct bar&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000099;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000099;"&gt;char z;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000099;"&gt;struct foo f;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#000099;"&gt;};&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;strong&gt;-Wpadded&lt;/strong&gt; Warn if padding is included in a structure, either to align an element of the structure or to align the whole structure. Sometimes when this happens it is possible to rearrange the fields of the structure to reduce the padding and so make the structure smaller.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;Just now came across another option in gcc&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#663333;"&gt;&lt;strong&gt;-fpack-struct&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;Packs all structure members together without holes.&lt;br /&gt;Warning: the ‘-fpack-struct’ switch causes GCC to generate code that isnot binary compatible with code generated without that switch. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;-Excerpts from the gcc3.3.2 documentation&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-111754887319709892?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/111754887319709892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=111754887319709892' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/111754887319709892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/111754887319709892'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2005/05/structure-packing-in-gcc.html' title='Structure packing in gcc'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-111746142792390725</id><published>2005-05-30T06:46:00.000-07:00</published><updated>2005-06-03T10:53:22.726-07:00</updated><title type='text'>Compiling a kernel module</title><content type='html'>&lt;span style="font-family:times new roman;"&gt;Kernel modules need to be compiled with certain gcc options to make them work. In addition, they also need to be compiled with certain symbols defined. This is because the kernel header files need to behave differently, depending on whether we're compiling a kernel module or an executable. You can define symbols using gcc's -D option, or with the #define preprocessor command. &lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-family:times new roman;"&gt;-c: A kernel module is not an independant executable, but an object file which will be linked into the kernel during runtime using insmod. As a result, modules should be compiled with the -c flag.&lt;br /&gt;-O2: The kernel makes extensive use of inline functions, so modules must be compiled with the optimization flag turned on. Without optimization, some of the assembler macros calls will be mistaken by the compiler for function calls. This will cause loading the module to fail, since insmod won't find those functions in the kernel.&lt;br /&gt;-W -Wall: A programming mistake can take take your system down. You should always turn on compiler warnings, and this applies to all your compiling endeavors, not just module compilation.&lt;br /&gt;-isystem /lib/modules/`uname -r`/build/include: You must use the kernel headers of the kernel you're compiling against. Using the default /usr/include/linux won't work.&lt;br /&gt;-D__KERNEL__: Defining this symbol tells the header files that the code will be run in kernel mode, not as a user process.&lt;br /&gt;-DMODULE: This symbol tells the header files to give the appropriate definitions for a kernel module.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;"&gt;We use gcc's -isystem option instead of -I because it tells gcc to surpress some "unused variable" warnings that -W -Wall causes when you include module.h. By using -isystem under gcc-3.0, the kernel header files are treated specially, and the warnings are surpressed.&lt;br /&gt;Sample:&lt;br /&gt;&lt;span style="color:#663333;"&gt;&lt;em&gt;gcc -D__KERNEL__ -DMODULE -I/lib/modules/`uname -r`/build/include -O2 -c testmod.c&lt;br /&gt;&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;This is much simpler in 2.6 kernel refer [2]&lt;br /&gt;for USB drivers if the module needs to be loaded as and when the device is plugged in use &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;span style="color:#663333;"&gt;-DCONFIG_HOTPLUG&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;strong&gt;To solve the problem of unresolved symbols in kernel module&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;Add the following at the starting to the kernel module source file you are creating. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;color:#3333ff;"&gt;#if defined __KERNEL__&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;color:#3333ff;"&gt;#include &amp;lt;linux/config.h&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;color:#3333ff;"&gt;#if defined( CONFIG_MODVERSIONS ) &amp;&amp;amp; ! defined( MODVERSIONS )&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;color:#3333ff;"&gt;#define MODVERSIONS&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;color:#3333ff;"&gt;#endif&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;color:#3333ff;"&gt;/* modversions.h should be before should be before module.h */&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;color:#3333ff;"&gt;#if defined( MODVERSIONS )&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;color:#3333ff;"&gt;#include &amp;lt;linux/modversions.h &amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;color:#3333ff;"&gt;#endif&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;color:#3333ff;"&gt;#include "linux/module.h"&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;color:#3333ff;"&gt;#include "linux/version.h"&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Times New Roman;"&gt;&lt;span style="color:#3333ff;"&gt;/* Now your module include files &amp;amp; source code follows */&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;Related Links:&lt;br /&gt;[1] &lt;a href="http://www.tldp.org/LDP/lkmpg/2.4/html/x208.html"&gt;http://www.tldp.org/LDP/lkmpg/2.4/html/x208.html&lt;/a&gt;&lt;br /&gt;[2] &lt;a href="http://www.tldp.org/LDP/lkmpg/2.6/html/x181.html"&gt;http://www.tldp.org/LDP/lkmpg/2.6/html/x181.html&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-111746142792390725?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/111746142792390725/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=111746142792390725' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/111746142792390725'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/111746142792390725'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2005/05/compiling-kernel-module.html' title='Compiling a kernel module'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-111711748651348704</id><published>2005-05-26T07:22:00.000-07:00</published><updated>2005-05-26T07:24:46.513-07:00</updated><title type='text'>USB Device Filesystem basics</title><content type='html'>The USB device filesystem is a dynamically generated filesystem, similar to the /proc filesystem. This filesystem can be mounted just about anywhere, however it is customarily mounted on /proc/bus/usb, which is an entry node created by the USB code, intended to be used as a mount point for this system. Mounting in other locations may break user space utilities, but should not affect the kernel support.&lt;br /&gt;&lt;br /&gt;You need to select "Preliminary USB Device Filesystem" to make this work. You also need to enable general /proc support, and to have it mounted (normally automatic).&lt;br /&gt;&lt;br /&gt;To mount the filesystem, you need to be root. Use the mount command:&lt;br /&gt;    &lt;em&gt;&lt;span style="color:#660000;"&gt;mount -t usbdevfs none /proc/bus/usb&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt; Note that the none keyword is arbitrary - you can use anything, and some people prefer to use usbdevfs, as it makes the mount output look better.&lt;br /&gt;&lt;br /&gt;If you do not want to have to mount the filesystem each time you reboot the system, you can add the following to /etc/fstab after the /proc entry:&lt;br /&gt;   none /proc/bus/usb usbdevfs defaults 0 0.&lt;br /&gt;This has the same effect as the mount command.&lt;br /&gt;After you have mounted the filesystem, the contents of /proc/bus/usb should look something like:&lt;br /&gt;dr-xr-xr-x 1 root root 0 Jan 26 10:40 001&lt;br /&gt;-r--r--r-- 1 root root 0 Jan 26 10:40 devices&lt;br /&gt;-r--r--r-- 1 root root 0 Jan 26 10:40 drivers&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-111711748651348704?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/111711748651348704/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=111711748651348704' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/111711748651348704'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/111711748651348704'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2005/05/usb-device-filesystem-basics.html' title='USB Device Filesystem basics'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-111711682079051742</id><published>2005-05-26T06:46:00.000-07:00</published><updated>2005-05-26T07:20:45.293-07:00</updated><title type='text'>Linux Dynamic Linking</title><content type='html'>&lt;span style="font-family:times new roman;"&gt;&lt;span style="color:#666666;"&gt;Linux allows dynamic linking of libraries during the time the executable is loaded or when required (shared libraries are usually of .so.x.y.z)&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#666666;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#666666;"&gt;The shared object can be created using the steps mentioned in [3].&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="color:#666666;"&gt;Suppose the shared library is named libmylib.so&lt;br /&gt;If you create an executable using the shared object while compilation of the executable&lt;br /&gt;&lt;strong&gt;&lt;em&gt;gcc source.c –lmylib –o myapp&lt;/em&gt;&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#666666;"&gt;In this case when myapp is loaded/started the shared object mylib is loaded.This is the very basic method of using a shared library.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="color:#666666;"&gt;There is a way to load/unload the dl libraries as needed using the dlopen,dlclose routines&lt;br /&gt;Use –ldl while linking and include dlfcn.h in the executable &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#666666;"&gt;The related functions are &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#666666;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#666666;"&gt;dlopen()&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;span style="color:#666666;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="color:#666666;"&gt;The dlopen function opens a library and prepares it for use.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#660000;"&gt;void * dlopen(const char *filename, int flag);&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;em&gt;&lt;/em&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;If &lt;em&gt;filename&lt;/em&gt; an absolute path, dlopen() will just try to use it .Otherwise, dlopen() will search for the library in the following order:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;*List of directories in the user's LD_LIBRARY_PATH environment variable. &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;*The list of libraries specified in /etc/ld.so.cache (which is generated from /etc/ld.so.conf).&lt;br /&gt;/lib, followed by /usr/lib&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;Note the order here; this is the reverse of the order used by the old a.out&lt;br /&gt;loader. The old a.out loader, when loading a program, first searched /usr/lib, then /lib .This shouldn't normally matter, since a library should only be in one or the otherdirectory (never both) &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;the value of &lt;em&gt;flag&lt;/em&gt; must be either&lt;br /&gt;RTLD_LAZY, meaning ``resolve undefined symbols as code&lt;br /&gt;from the dynamic library is executed'', or&lt;br /&gt;RTLD_NOW, meaning ``resolve all undefined symbols before dlopen() returns and fail if this cannot be done''.&lt;br /&gt;RTLD_GLOBAL may be optionally or'ed with either value inflag, meaning that the external symbols defined in the library will be made available to subsequently loaded libraries&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;If the libraries depend on each other (e.g., X depends on Y), then you need to load the dependees first (in this example, load Y first, and then X).&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;dlerror()&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;Errors can be reported by calling dlerror(), which returns a string describing the error from the last call todlopen(), dlsym(), or dlclose(). One oddity is that after calling dlerror(), future calls to dlerror() will return NULL until another error has been encountered.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="color:#333333;"&gt;&lt;strong&gt;dlsym()&lt;br /&gt;&lt;/strong&gt;dlsym() looks up the value of a symbol in a given (opened) library.&lt;/span&gt; &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;"&gt;&lt;em&gt;&lt;span style="color:#660000;"&gt;void * dlsym(void *handle, char *symbol);&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;span style="color:#333333;"&gt;the &lt;em&gt;handle&lt;/em&gt; is the value returned from dlopen, and &lt;em&gt;symbol&lt;/em&gt; is a NULL-terminated string.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;dlclose()&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;The converse of dlopen() is dlclose(), which closes a DL library. The dl library maintains link counts for dynamic file handles, so a dynamic library is not actually deallocated until dlclose has been called on it as many times as dlopen has succeeded on it.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;This is an example i came across from which i learnt how to use the above functions&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="color:#330099;"&gt;#include "stdio.h"&lt;stdlib.h&gt;&lt;br /&gt;#include "stdlib.h"&lt;stdio.h&gt;&lt;br /&gt;#include "dlfcn.h"&lt;dlfcn.h&gt;&lt;br /&gt;int main(int argc, char **argv) {&lt;br /&gt;void *handle;&lt;br /&gt;double (*cosine)(double);&lt;br /&gt;char *error;&lt;br /&gt;handle = dlopen ("/lib/libm.so.6", RTLD_LAZY);&lt;br /&gt;if (!handle) {&lt;br /&gt;fputs (dlerror(), stderr);&lt;br /&gt;exit(1);&lt;br /&gt;}&lt;br /&gt;cosine = dlsym(handle, "cos");&lt;br /&gt;if ((error = dlerror()) != NULL) {&lt;br /&gt;fputs(error, stderr);&lt;br /&gt;exit(1);&lt;br /&gt;}&lt;br /&gt;printf ("%f\n", (*cosine)(2.0));&lt;br /&gt;dlclose(handle);&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#333333;"&gt;The program should be compiled linking dl&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;em&gt;&lt;span style="font-family:times new roman;color:#660000;"&gt;gcc -o foo foo.c -ldl&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#660000;"&gt;&lt;span style="font-family:times new roman;color:#000000;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;&lt;strong&gt;Library constructor and destructor functions&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style="color:#660000;"&gt;&lt;span style="color:#000000;"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;Libraries should export initialization and cleanup routines using the gcc&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="color:#660000;"&gt;&lt;em&gt;__attribute__((constructor))&lt;/em&gt;&lt;/span&gt; &lt;/span&gt;&lt;span style="font-family:times new roman;"&gt;&lt;span style="color:#333333;"&gt;and&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#660000;"&gt;&lt;em&gt;__attribute__((destructor))&lt;/em&gt;&lt;/span&gt; &lt;span style="color:#333333;"&gt;function attributes.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;Constructor routines are executed before dlopen returns (or before main() is started if the library is loaded at load time).&lt;br /&gt;Destructor routines are executed before dlclose returns (or after exit() or completion of main() if the library is loaded at load time).&lt;br /&gt;&lt;br /&gt;The C example prototypes for these functions are:&lt;br /&gt;&lt;/span&gt;&lt;em&gt;&lt;span style="font-family:times new roman;color:#660000;"&gt;void __attribute__ ((constructor)) my_init(void);&lt;br /&gt;void __attribute__ ((destructor)) my_fini(void);&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;Shared libraries must not be compiled with the gcc arguments ``-nostartfiles'' or ``-nostdlib''. If those arguments are used, the constructor/destructor routines will not be executed&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;Related commands:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#333333;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;strong&gt;ldd&lt;/strong&gt;&lt;br /&gt;Displays a list of the shared libraries each program requires. For example if your executable is a.out and you need to know what all libraries this a.out requires for operation you can invoke the command ldd as ldd a.out&lt;br /&gt;In Linux, the environment variable LD_LIBRARY_PATH is a colon-separated set of directories where libraries should be searched for first, before the standard set of directories&lt;br /&gt;Or it can be added in the configuration file /etc/ld.so.conf &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#333333;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;strong&gt;ldconfig&lt;/strong&gt; &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;creates the necessary links and cache (for use by the run-time linker, ld.so) to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf, and in the trusted directories (/usr/lib and /lib). ldconfig checks the header and file names of the libraries it encounters when determining which versions should have their links updated. ldconfig ignores symbolic links when scanning for libraries.ldconfig should normally be run by the super-user as it may require write permission on some root owned directories and files. It is normally run automatically at bootup, from /etc/rc, or manually whenever new DLL's are installed.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#333333;"&gt;&lt;span style="font-family:times new roman;"&gt;&lt;strong&gt;nm&lt;/strong&gt; :&lt;br /&gt;The nm command can report the list of symbols in a given library. It works on both static and shared libraries. For a given library it lists the symbol names defined, each symbol's value, and the symbol's type. It can also identify where the symbol was defined in the source code (by filename and line number), if that information is available in the library (see the -l option).&lt;br /&gt;The type is displayed as a letter lowercase means that the symbol is local, while uppercase means that the symbol is global (external). Typical symbol types include T (a normal definition in the code section), D (initialized data section), B (uninitialized data section), U (undefined; the symbol is used by the library but not defined by the library), and W (weak; if another library also defines this symbol, that definition overrides this one).&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:times new roman;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;Related links/references:&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;[1]&lt;/span&gt;&lt;/em&gt;&lt;a href="http://www.linuxjournal.com/article/6463"&gt;&lt;em&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;http://www.linuxjournal.com/article/6463&lt;/span&gt;&lt;/em&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#333333;"&gt;[2]&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;a href="http://www.linuxjournal.com/article/1059"&gt;&lt;em&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;http://www.linuxjournal.com/article/1059&lt;/span&gt;&lt;/em&gt;&lt;/a&gt;&lt;span style="font-family:times new roman;"&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#333333;"&gt;[3]&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;a href="http://www-106.ibm.com/developerworks/linux/library/l-shobj/"&gt;&lt;em&gt;&lt;span style="font-family:times new roman;color:#333333;"&gt;http://www-106.ibm.com/developerworks/linux/library/l-shobj/&lt;/span&gt;&lt;/em&gt;&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-111711682079051742?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/111711682079051742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=111711682079051742' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/111711682079051742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/111711682079051742'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2005/05/linux-dynamic-linking.html' title='Linux Dynamic Linking'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-111694908335550238</id><published>2005-05-24T08:36:00.000-07:00</published><updated>2005-05-24T08:38:03.360-07:00</updated><title type='text'>Recovering root password</title><content type='html'>I forgot the root password of my linux machine and googled to get this solution that worked for me&lt;br /&gt;&lt;br /&gt;boot with the linux rescue disk&lt;br /&gt;&lt;br /&gt;give the command&lt;br /&gt;&lt;strong&gt;chroot /mnt/sysimage &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;passwd&lt;/strong&gt; (this changes the root password!)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-111694908335550238?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/111694908335550238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=111694908335550238' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/111694908335550238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/111694908335550238'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2005/05/recovering-root-password.html' title='Recovering root password'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-11963565.post-111694846646151253</id><published>2005-05-24T08:19:00.000-07:00</published><updated>2005-05-24T08:27:46.466-07:00</updated><title type='text'>Linux GRUB rescue</title><content type='html'>Just thought of keying in some of my experience with Linux here to be of use for the community(acutally it will be of use for me :) since i often forget out what i did that day)....&lt;br /&gt;Will try to make this a list of linux tips for day to day linux administration/programming/kernel.&lt;br /&gt;&lt;br /&gt;Today i got my MBR with GRUB corrupted found out how to reinstall&lt;br /&gt;&lt;br /&gt;boot with the rescure CD for the distro(I am using Fedora core 2).The entire file system will be mounted in /mnt/sysimage&lt;br /&gt;&lt;br /&gt;do&lt;br /&gt;&lt;strong&gt;chroot /mnt/sysimage&lt;/strong&gt; to become the root&lt;br /&gt;then do &lt;strong&gt;grub-install /dev/hda1&lt;/strong&gt;(disk partition)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/11963565-111694846646151253?l=tuxsudh.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tuxsudh.blogspot.com/feeds/111694846646151253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=11963565&amp;postID=111694846646151253' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/111694846646151253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11963565/posts/default/111694846646151253'/><link rel='alternate' type='text/html' href='http://tuxsudh.blogspot.com/2005/05/linux-grub-rescue.html' title='Linux GRUB rescue'/><author><name>Sudhar</name><uri>http://www.blogger.com/profile/16506653257706635109</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry></feed>
