Saturday, October 30, 2010

Xen compilation

When I was trying to compile Xen-4.0.1, I got these messages:

make[1]: Entering directory `/xen-4.0-testing.hg/xen'
make -f Rules.mk _install
make[2]: Entering directory `/xen-4.0-testing.hg/xen'
make -C tools
make[3]: Entering directory `/xen-4.0-testing.hg/xen/tools'
[ -d figlet ] && make -C figlet
make[4]: Entering directory `/xen-4.0-testing.hg/xen/tools/figlet'
make[4]: `figlet' is up to date.
make[4]: Leaving directory `/xen-4.0-testing.hg/xen/tools/figlet'
make symbols
make[4]: Entering directory `/xen-4.0-testing.hg/xen/tools'
make[4]: `symbols' is up to date.
make[4]: Leaving directory `/xen-4.0-testing.hg/xen/tools'
make[3]: Leaving directory `/xen-4.0-testing.hg/xen/tools'
make -f /xen-4.0-testing.hg/xen/Rules.mk include/xen/compile.h
make[3]: Entering directory `/xen-4.0-testing.hg/xen'
 __  __            _  _    ___   ____              _                   
 \ \/ /___ _ __   | || |  / _ \ |___ \    _ __ ___/ |   _ __  _ __ ___ 
  \  // _ \ '_ \  | || |_| | | |  __) |__| '__/ __| |__| '_ \| '__/ _ \
  /  \  __/ | | | |__   _| |_| | / __/|__| | | (__| |__| |_) | | |  __/
 /_/\_\___|_| |_|    |_|(_)___(_)_____|  |_|  \___|_|  | .__/|_|  \___|
                                                       |_|             
make[3]: Leaving directory `/xen-4.0-testing.hg/xen'
[ -e include/asm ] || ln -sf asm-x86 include/asm
make -f /xen-4.0-testing.hg/xen/Rules.mk -C include
make[3]: Entering directory `/xen-4.0-testing.hg/xen/include'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/xen-4.0-testing.hg/xen/include'
make -f /xen-4.0-testing.hg/xen/Rules.mk -C arch/x86 asm-offsets.s
make[3]: Entering directory `/xen-4.0-testing.hg/xen/arch/x86'
make[3]: `asm-offsets.s' is up to date.
make[3]: Leaving directory `/xen-4.0-testing.hg/xen/arch/x86'
make -f /xen-4.0-testing.hg/xen/Rules.mk include/asm-x86/asm-offsets.h
make[3]: Entering directory `/xen-4.0-testing.hg/xen'
make[3]: `include/asm-x86/asm-offsets.h' is up to date.
make[3]: Leaving directory `/xen-4.0-testing.hg/xen'
make -f /xen-4.0-testing.hg/xen/Rules.mk -C arch/x86 /xen-4.0-testing.hg/xen/xen
make[3]: Entering directory `/xen-4.0-testing.hg/xen/arch/x86'
make -f /xen-4.0-testing.hg/xen/Rules.mk -C /xen-4.0-testing.hg/xen/arch/x86/boot built_in.o
make[4]: Entering directory `/xen-4.0-testing.hg/xen/arch/x86/boot'
RELOC=0x7c000 XEN_BITSPERLONG=64 make -f build32.mk reloc.S
make[5]: Entering directory `/xen-4.0-testing.hg/xen/arch/x86/boot'
make[5]: *** ../../../../.config: Is a directory.  Stop.
make[5]: Leaving directory `/xen-4.0-testing.hg/xen/arch/x86/boot'
make[4]: *** [reloc.S] Error 2
make[4]: Leaving directory `/xen-4.0-testing.hg/xen/arch/x86/boot'
make[3]: *** [/xen-4.0-testing.hg/xen/arch/x86/boot/built_in.o] Error 2
make[3]: Leaving directory `/xen-4.0-testing.hg/xen/arch/x86'
make[2]: *** [/xen-4.0-testing.hg/xen/xen] Error 2
make[2]: Leaving directory `/xen-4.0-testing.hg/xen'
make[1]: *** [install] Error 2
make[1]: Leaving directory `/xen-4.0-testing.hg/xen'
make: *** [install-xen] Error 2

The message showed me that it was expecting the .config exist in the root folder. I copied the file from /usr/src/linux (kernel source) and recompile. it worked!

USB plug-in rule for TI MSP-EXP43xx LaunchPad Kit

Content of file /etc/udev/rules.d/udev/46-TI_launchpad.rules:

ATTRS{idVendor}=="0451", ATTRS{idProduct}=="2036", MODE="0660", GROUP="plugdev"
ATTRS{idVendor}=="0451", ATTRS{idProduct}=="F432", MODE="0660", GROUP="plugdev"

Friday, October 29, 2010

Script to remove tailing "(00)" in filenames

#!/usr/bin/tclsh

foreach f [glob *.*] {
    if {[regexp -all -nocase {(.*)\.(.*)} $f dummy fullname ext] } {
        if { [regexp -all -nocase {(.*)\(00\)} $fullname dummy name ] } {
             set cmd "file rename -force \"$f\" \"$name.$ext\""
             puts $cmd
             eval $cmd
        }
    }
}

Thursday, October 28, 2010

To find function declaration in static library

The following command finds a reference to function "gtk_widget_get_pango_context" in static library libwxOil.a:

linux-bvhg:~/> nm -l -C libwxOil.a  | grep gtk_widget_get_pango_context
                 U gtk_widget_get_pango_context(_GtkWidget*)  /home/myname/src/XaraLX/wxOil/ftfonts.cpp:868

GLIB and wxWidget Class conflict

When compiling XaraLX, there is a conflict between GLIB-2.0 and  wxWidget 2.8 as shown below:

/usr/local/include/glib-2.0/gio/giotypes.h:127:47: error: conflicting declaration `typedef struct _GSocket GSocket'
/usr/include/wx-2.8/wx/unix/gsockunx.h:41:1: error: `class GSocket' has a previous declaration as `class GSocket'

The quick solution is to modify <XaraLX directory>/wxOil/ftfonts.cpp.  Edit this file and change from:

#ifdef __WXGTK20__
#include <gtk/gtk.h>
extern GtkWidget *wxGetRootWindow();
#endif

to:

#ifdef __WXGTK20__
//#include <gtk/gtk.h>
extern PangoContext *gtk_widget_get_pango_context    (GtkWidget   *widget);
extern GtkWidget *wxGetRootWindow();
#endif

Microsoft is officially all out to promote Windows 7 mobile

Check this out:

http://create.msdn.com/en-US/home/about/how_it_works_create
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=04704acf-a63a-4f97-952c-8b51b34b00ce&displaylang=en
https://microsoft.promo.eprize.com/windowsphone7/