You are on page 1of 6

# to start up x server

$ cd /usr/x11r6/bin/
$ startxwin.sh

# to clear the console screen in gtk folder

alias clear='cat temp.txt'

# to display the content of folder with color

alias ls='ls -f --color'

# to export display variable

$ display=192.168.4.136:0.0
$ export display

# to compile gtk source file


$ gcc source.c -wall -o exe `gtk-config --libs --cflags`

#---------------------------------------------------------
# net services
#---------------------------------------------------------
to start/stop inetd:

$ net start inetd


$ net stop inetd

#---------------------------------------------------------
# using rshd in cygwin
#---------------------------------------------------------
exsample for user : administrator

/etc/inetd.conf

to enable the following services:

shell stream tcp nowait root /usr/sbin/rshd rshd -l


login stream tcp nowait root /usr/sbin/rlogind rlogind

goto user's home folder:

$ cd /home/administrator
$ vi .rhosts

192.168.4.162 administrator
[computer_name administrator]

restart bash shell and test command:

$ rsh -l administrator 192.168.4.162 ls

#---------------------------------------------------------
# using putty for client
#---------------------------------------------------------
please reference the following link for more detail
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

#---------------------------------------------------------
# support component for window programing
#---------------------------------------------------------
http://www.ssh-activex.com/download-ssh-activex.html
http://www.djhd.com/onlinehelp/myssh/execcommand.htm
http://www.activexperts.com/activsocket/howto/telnet/vb/ -> telnet

http://activexperts.com/activsocket/howto/telnet/vc/
-> telnet for vc++6 -> cool, try it first

#----------------------------------------------------------
# install guide
#----------------------------------------------------------
http://www.ibiblio.org/apollo/wingtkhowto.html -> guide
http://www.gtk.org/download-windows.html -> download source

http://wingtk.sourceforge.net/ -> for glade

path %path%;c:\wingtk\bin -> autoexec.bat

http://library.gnome.org/devel/gtk/unstable/ -> api reference

#-----------------------------------------------------------
# download and install mingw
#-----------------------------------------------------------

http://www.mingw.org/mingwiki/index.php/gettingstarted -> guide to install mingw

http://www.compsci.hunter.cuny.edu/~sweiss/course_materials/csci493.73/gtk_install
ation.pdf

http://modulatum.wordpress.com/2008/06/02/get-started-with-gtk-using-mingw/ ->
simple guide (co ve chay duoc)

#-----------------------------------------------------------
# using glade and cygwin
#-----------------------------------------------------------

1> ( using mirror mirror.rhsmith.umd.edu)


install cygwin, xwin and libraries such as atk, pango, pkg-config...
2> install gtk-dev-2.10.11-win32-1.exe (note: not check any environment variable)
( only tick : glade and documentations )
-> now, we write a simple hello.c and try to compile whit command
$ gcc -o exe hello.c `pkg-config --libs --cflags`

5> compile the project


we can compile the glade sources by using following manual command line
for instance my project's name is hello

1> edit main.c


add :

#define g_os_win32

comment out the following line :

// package_prefix = g_win32_get_package_installation_directory (null,


null);
// package_data_dir = g_build_filename (package_prefix, "share", null);
// package_locale_dir = g_build_filename (package_prefix, "share",
"locale", null);

change the following

pixmap_dir = g_build_filename (package_data_dir, package, "pixmaps", null);

to

pixmap_dir = g_build_filename (package_prefix, package, "pixmaps", null);

( to retry /usr/src/hello/pixmaps )

2> use the following command line (or run compile.sh script)

$ cd hello/src
$ gcc
-o hello
*.c
-dpackage = \""hello"\"
-dpackage_prefix = \""/usr/src"\"
-dpackage_data_dir = \""/usr/src/hello/data"\"
-dpackage_locale_dir = \""/usr/src/hello/locale"\"
`pkg-config --libs --cflags gtk+-2.0`

and we can run the result in the folder /source

# problems
http://lists.freedesktop.org/archives/pkg-config/2006-august/000128.html ->
about pkg-config

#-----------------------------------------------------------
# how to uninstall cygwin
#-----------------------------------------------------------

* delete all in the folder c:\cygwin


1> method 1: run "cygtidy" (download via internet)
2> method 2: run commad regedt32
in hkey_local_machine or hkey_current_user
delete the entry in registry "software\cygnus"

#-----------------------------------------------------------
# using cygwin
#-----------------------------------------------------------
http://www.zieg.com/faqs/cygwin/ -> guide to use cygwin

#-----------------------------------------------------------
# note for makefile
#-----------------------------------------------------------
top line of "command line" must be a tab (not a space)
top line of "ifeq" must not be a tab

#------------------------------------------------------------
# script writing note
#------------------------------------------------------------

$0 -> script name


$1 -> 1st argument
$2 -> 2st argument

example : write a script delete hello.exe if it's exist

using :

if ls -l | grep "hello.exe"
then
rm hello.exe
fi

#------------------------------------------------------------
# debug technology
#------------------------------------------------------------
create debug.h and edit the following

#ifndef debug_h
#define debug_h

#define debug 1 /* enable debugging */

#define dbg(...) if(debug) printf(__va_args__)

#endif

#----------------------------------------------------------
# linux command
#----------------------------------------------------------
dos2unix *.* -> convert all file in current dir
dos2unix */*.* -> convert all file in sub dir
dos2unix */*/*.: -> convert all file in sub sub dir ...

#------------------------------------------------------------
# mp3 note
#------------------------------------------------------------

http://oreilly.com/catalog/mp3/chapter/ch02.html
http://www.dv.co.yu/mpgscript/mpeghdr.htm
http://www.acm.uiuc.edu/webmonkeys/book/c_guide/2.12.html -> c language file
acess
http://www.p23.nl/projects/mp3header/ -> mp3 frame header analysic
http://www.codeproject.com/kb/audio-video/mpegaudioinfo.aspx -> mp3 frame header
analysic
http://www.mail-archive.com/mp3encoder@geek.rcc.se/msg04026.html -> about mp3
frame's crc
http://wiki.hydrogenaudio.org/index.php?title=mp3 -> wiki mp3
http://www.mp3-tech.org/programmer/docs/mp3_theory.pdf -> the excilence page for
mp3 technology
for more information : read mp3_theory.pdf and thesisreportdecoder.pdf
intellisense : support for programming such as vc#, visual c 2005

#-----------------------------------------------------------
# best ide for linux & window support intellisence feature
#-----------------------------------------------------------

http://www.codeblocks.org/downloads -> for download and help

http://wiki.codeblocks.org/index.php?title=installing_cygwin_compiler -> guide for


setting the compiler

http://www.codeblocks.org/docs/manual_en.pdf -> manual

#----------------------------------------------------------
# run dos command using bat file (code::blocks)
#----------------------------------------------------------
1> create new run.bat file
2> goto "project" -> "build option"
3> choose tab "pre/post build steps
4> add command : "run.bat" (e.g. in post/build steps session)
5> click ok and rebuild project for checking

#----------------------------------------------------------
# ecos under cygwin instalation guide
#----------------------------------------------------------

1> from the bash shell type


$ mkdir ecos
$ cd ecos
2> get script file .tcl for installation
$ wget --passive-ftp ftp://ecos.sourceware.org/pub/ecos/ecos-install.tcl
3> run script
$ sh ecos-install.tcl

note: while running script, if connected failed, we can fix this problem by
editing
the script file. chane "variable metadata_url" for excistence mirrors.
5> choose gcc options and quit with "q"
6> choose mirror

#----------------------------------------------------------
# build redboot for ml403 platform
#----------------------------------------------------------
1> edit flag ( for ml403 redboot )
-i$(hw_design) -i$(hw_design)/ppc405_0/include -i$(ecos_extra)
-> -i../bsp -i../bsp/ppc405_0/include -i$(ecos_extra)
in this case we create the /bsp directory under $(project) directory
2> ortheway : we use configtool for only configuring the system, and invoke
"make" under cygwin command shell for compiling instead clicking the build
button of configtool on the menu bar. before compile, we must export the
value of the hw_design variable.

ex: $ mkdir redboot -> we create project in here (under /usr/src/)


directory structure: generated by configtool
redboot _____redboot_build
|
|_____redboot_install
|
|_____redboot_mlt
|
|_____redboot.ecc (project name)
|
|_____hardware_design -> we create new folder here

$ export hw_design=/usr/src/redboot/hardware_design

note: when use edk under window, we mus convert all files in ppc405_0 folder
and sub folders to unix format by command :
$ cd ppc405_0
$ dos2unix *.* */*.* */*/*.* ...

#----------------------------------------------------------
# build redboot for olimex lpc2294
#----------------------------------------------------------
http://sgs.gomel.by/sg/articles/olpce2294/index.html

#----------------------------------------------------------
# ecos application developing
#----------------------------------------------------------
http://homepage.ntlworld.com/dallaway/papers/ew07.html -> instroduce ecos
applications
http://noc.lmkr.com/html/white_papers/redboot_ecos_paper.pdf -> linker, behavior
of system
http://digitais.ist.utl.pt/ec-sc/0405/docs/ecos-2.0b1/doc/html/ref/ecos-ref.html
-> ecos reference
http://www.informit.com/content/downloads/perens/0130354732.pdf -> ecos embedded
reference

You might also like