/home/karthik/blog

Useful References – DBUS

Posted in Linux, Programming by Karthik Murugesan on February 26, 2008

Useful References – Enlightenment Foundation Libraries (EFL/E17) in embedded linux

Posted in Linux, Programming by Karthik Murugesan on February 11, 2008

Modifying the cramfs image

Posted in Linux, Programming by Karthik Murugesan on December 31, 2007

1. Mount the cramfs file system image as a loop device. This will be read-only image.

2. Create a new directory (e.g $HOME/initrd-new) which will be used for modifying the image (RW mode)

3. Go to the mounted cramfs image directory and get the list of files using the following command

    find / > /tmp/filelist.txt

4. Use cpio to copy the contents from the mounted directory to the new directory

    cat /tmp/filelist.txt | cpio -pdm /$HOME/initrd-new

5. modify the contents in the new directory as required.

6. Once the changes are done, use mkcramfs to create the cramfs image again.

    mkcramfs /tmp/new-initrd new-initrd

Useful References – Android Internals

Posted in Linux, Mobile Frameworks, Programming by Karthik Murugesan on December 31, 2007

Useful References – Linux ELF format

Posted in Linux, Programming by Karthik Murugesan on December 31, 2007

Switch Case Vs If else performance

Posted in Programming by Karthik Murugesan on December 19, 2006

Most people know that performance of switch/case is better than an if/else statement, if the case values are narrowed. But many doesnt know the reason why switch/case statement performance is better. I came across this tutorial which discusses on the assembly view of switch/case for different scenarios like narrowed case values, wides case values etc and how it differs from the if/else statement. From this, its clear that the Switch/case performance is better for narrowed case values.

Even though the discussion is specific to 68000, the concept remains the same across processors/compilers.

check it out @ http://www.eventhelix.com/RealtimeMantra/Basics/CToAssemblyTranslation3.htm

Function Invocation: Assembly view & Stack Manipulation

Posted in Programming by Karthik Murugesan on December 18, 2006

Came across the article on how the C function invocation happens and how the stack is manipulated in intel 30386 architectures. Even though the description is specific to win32 __cdecl APIs on Intel architecture, the concept almost remains the same in most architectures.

check it out @ http://www.unixwiz.net/techtips/win32-callconv-asm.html

Win32: Function Calling Conventions __cdecl & __stdcall

Posted in Programming by Karthik Murugesan on December 17, 2006

I was wondering why VC6 linker prepends an underscore to the function names while displaying errors during linking. I found this article on the win32 function calling conventions and details on why VC6 compiler rewrites the function names in the symbol table.

Check it out @ http://www.unixwiz.net/techtips/win32-callconv.htm

Linux: Dynamic Library interposition in *nix Operating system

Posted in Linux, Programming by Karthik Murugesan on November 26, 2006

Articles on Dynamic library interposition using LD_PRELOAD path which can be used for tuning performance, collecting runtime statistics, or debugging applications etc. Check it out @

http://developers.sun.com/solaris/articles/lib_interposers.html for Solaris

http://www.linuxjournal.com/article/7795 for Linux

Introduction to the Volatile Keyword [www.embedded.com]

Posted in Programming by Karthik Murugesan on November 17, 2006

This articule gives a good overview with examplets about the volatile keyword in C.

Check it out @ http://www.embedded.com/showArticle.jhtml?articleID=9900209