<?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-2392320021887275263</id><updated>2012-02-16T04:08:10.880-08:00</updated><title type='text'>tech_log</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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>51</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2392320021887275263.post-4896803189142283590</id><published>2009-11-04T15:41:00.000-08:00</published><updated>2009-11-04T15:43:07.720-08:00</updated><title type='text'>sh4 Linux cross-toolchain (by Code Sourcery)</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;1) Pre-build sh-linux-gcc toolchain :&lt;br/&gt;Download Sourcery G++ Lite 4.4-45 for SuperH GNU/Linux from :&lt;br/&gt;http://www.codesourcery.com/sgpp/lite/superh/portal/release1041&lt;br/&gt;choose : IA32 GNU/Linux Installer&lt;br/&gt;&lt;br/&gt;2) Install toolchain to Linux host :&lt;br/&gt;$ /bin/sh renesas-4.4-45-sh-linux-gnu.bin&lt;br/&gt;Will lounch graphical installer which will install toolchain to :&lt;br/&gt;~/CodeSourcery/&lt;br/&gt;&lt;br/&gt;3) Compile hello.c :&lt;br/&gt;$ ~/CodeSourcery/Sourcery_G++_Lite/bin/sh-linux-gnu-gcc -o hello hello.c&lt;br/&gt;&lt;br/&gt;This will already search libraries to pre-destined paths :&lt;br/&gt;&lt;br/&gt;drasko@Marx:~/sh4_projects$ ~/CodeSourcery/Sourcery_G++_Lite/bin/sh-linux-gnu-gcc -v -o hello hello.c&lt;br/&gt;Using built-in specs.&lt;br/&gt;Target: sh-linux-gnu&lt;br/&gt;Configured with: /scratch/ams/4.4-sh-linux-gnu-lite/src/gcc-4.4/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=sh-linux-gnu --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --with-cpu=sh4a --with-multilib-list=sh4al,!mb/m4al --with-endian=little,big --enable-extra-sgxxlite-multilibs --enable-incomplete-targets --with-gnu-as --with-gnu-ld --with-specs='%{O2:%{!fno-remove-local-statics: -fremove-local-statics}} %{O*:%{O|O0|O1|O2|Os:;:%{!fno-remove-local-statics: -fremove-local-statics}}}' --enable-languages=c,c++ --enable-shared --disable-lto --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery G++ Lite 4.4-45' --with-bugurl=https://support.codesourcery.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/sh-linux-gnu/libc --with-build-sysroot=/scratch/ams/4.4-sh-linux-gnu-lite/install/sh-linux-gnu/libc --with-gmp=/scratch/ams/4.4-sh-linux-gnu-lite/obj/host-libs-4.4-45-sh-linux-gnu-i686-pc-linux-gnu/usr --with-mpfr=/scratch/ams/4.4-sh-linux-gnu-lite/obj/host-libs-4.4-45-sh-linux-gnu-i686-pc-linux-gnu/usr --with-ppl=/scratch/ams/4.4-sh-linux-gnu-lite/obj/host-libs-4.4-45-sh-linux-gnu-i686-pc-linux-gnu/usr --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --with-cloog=/scratch/ams/4.4-sh-linux-gnu-lite/obj/host-libs-4.4-45-sh-linux-gnu-i686-pc-linux-gnu/usr --disable-libgomp --enable-poison-system-directories --with-build-time-tools=/scratch/ams/4.4-sh-linux-gnu-lite/install/sh-linux-gnu/bin --with-build-time-tools=/scratch/ams/4.4-sh-linux-gnu-lite/install/sh-linux-gnu/bin&lt;br/&gt;Thread model: posix&lt;br/&gt;gcc version 4.4.1 (Sourcery G++ Lite 4.4-45) &lt;br/&gt;COLLECT_GCC_OPTIONS='-v' '-o' 'hello'&lt;br/&gt; /home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../libexec/gcc/sh-linux-gnu/4.4.1/cc1 -quiet -v -iprefix /home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/sh-linux-gnu/4.4.1/ -isysroot /home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../sh-linux-gnu/libc hello.c -quiet -dumpbase hello.c -auxbase hello -version -o /tmp/ccTmWWcy.s&lt;br/&gt;ignoring nonexistent directory "/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../sh-linux-gnu/libc/usr/local/include"&lt;br/&gt;ignoring duplicate directory "/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/../../lib/gcc/sh-linux-gnu/4.4.1/include"&lt;br/&gt;ignoring duplicate directory "/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/../../lib/gcc/sh-linux-gnu/4.4.1/include-fixed"&lt;br/&gt;ignoring duplicate directory "/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/../../lib/gcc/sh-linux-gnu/4.4.1/../../../../sh-linux-gnu/include"&lt;br/&gt;#include "..." search starts here:&lt;br/&gt;#include &amp;lt;...&amp;gt; search starts here:&lt;br/&gt; /home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/sh-linux-gnu/4.4.1/include&lt;br/&gt; /home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/sh-linux-gnu/4.4.1/include-fixed&lt;br/&gt; /home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/sh-linux-gnu/4.4.1/../../../../sh-linux-gnu/include&lt;br/&gt; /home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../sh-linux-gnu/libc/usr/include&lt;br/&gt;End of search list.&lt;br/&gt;GNU C (Sourcery G++ Lite 4.4-45) version 4.4.1 (sh-linux-gnu)&lt;br/&gt;    compiled by GNU C version 4.3.2, GMP version 4.3.1, MPFR version 2.4.1-p5.&lt;br/&gt;GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072&lt;br/&gt;Compiler executable checksum: 6d45046fc0139f32061c226770713dae&lt;br/&gt;COLLECT_GCC_OPTIONS='-v' '-o' 'hello'&lt;br/&gt; /home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/sh-linux-gnu/4.4.1/../../../../sh-linux-gnu/bin/as -v -little -o /tmp/ccGtcr9X.o /tmp/ccTmWWcy.s&lt;br/&gt;GNU assembler version 2.19.51 (sh-linux-gnu) using BFD version (Sourcery G++ Lite 4.4-45) 2.19.51.20090709&lt;br/&gt;COMPILER_PATH=/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../libexec/gcc/sh-linux-gnu/4.4.1/:/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../libexec/gcc/:/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/sh-linux-gnu/4.4.1/../../../../sh-linux-gnu/bin/&lt;br/&gt;LIBRARY_PATH=/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/sh-linux-gnu/4.4.1/:/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/:/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/sh-linux-gnu/4.4.1/../../../../sh-linux-gnu/lib/:/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../sh-linux-gnu/libc/lib/:/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../sh-linux-gnu/libc/usr/lib/&lt;br/&gt;COLLECT_GCC_OPTIONS='-v' '-o' 'hello'&lt;br/&gt; /home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../libexec/gcc/sh-linux-gnu/4.4.1/collect2 --sysroot=/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../sh-linux-gnu/libc --eh-frame-hdr -m shlelf_linux -dynamic-linker /lib/ld-linux.so.2 -o hello /home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../sh-linux-gnu/libc/usr/lib/crt1.o /home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../sh-linux-gnu/libc/usr/lib/crti.o /home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/sh-linux-gnu/4.4.1/crtbegin.o -L/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/sh-linux-gnu/4.4.1 -L/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc -L/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/sh-linux-gnu/4.4.1/../../../../sh-linux-gnu/lib -L/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../sh-linux-gnu/libc/lib -L/home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../sh-linux-gnu/libc/usr/lib /tmp/ccGtcr9X.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../lib/gcc/sh-linux-gnu/4.4.1/crtend.o /home/drasko/CodeSourcery/Sourcery_G++_Lite/bin/../sh-linux-gnu/libc/usr/lib/crtn.o&lt;br/&gt;drasko@Marx:~/sh4_projects$&lt;br/&gt;&lt;br/&gt;4) Lounch quemu test :&lt;br/&gt;drasko@Marx:~/sh4_projects$ qemu-sh4 -L ~/CodeSourcery/Sourcery_G++_Lite/sh-linux-gnu/libc/ ./hello&lt;br/&gt;Hello from SH4&lt;br/&gt;drasko@Marx:~/sh4_projects$&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=668744cd-3092-8115-bf94-9859194115ee' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-4896803189142283590?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/4896803189142283590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=4896803189142283590' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/4896803189142283590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/4896803189142283590'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/11/sh4-linux-cross-toolchain-by-code.html' title='sh4 Linux cross-toolchain (by Code Sourcery)'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-7735491953567564047</id><published>2009-11-03T14:09:00.000-08:00</published><updated>2009-11-03T14:11:55.681-08:00</updated><title type='text'>u-boot in qemu</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;1) make versatile_config&lt;br/&gt;2) Start u-boot.bin in qemu :&lt;br/&gt;$ qemu-system-arm -M versatileab -nographic -m 256 -kernel u-boot.bin&lt;br/&gt;&lt;br/&gt;3) Debugging:&lt;br/&gt;$ qemu-system-arm -M versatileab -nographic -m 256 -kernel u-boot.bin -s -S&lt;br/&gt;$ drasko@Marx:~/qemu-arm/u-boot-2009.03$ arm-linux-gnu-gdb u-boot&lt;br/&gt;GNU gdb 6.8-debian&lt;br/&gt;Copyright (C) 2008 Free Software Foundation, Inc.&lt;br/&gt;License GPLv3+: GNU GPL version 3 or later &amp;lt;http://gnu.org/licenses/gpl.html&amp;gt;&lt;br/&gt;This is free software: you are free to change and redistribute it.&lt;br/&gt;There is NO WARRANTY, to the extent permitted by law.  Type "show copying"&lt;br/&gt;and "show warranty" for details.&lt;br/&gt;This GDB was configured as "--host=i486-linux-gnu --target=arm-linux-gnu"...&lt;br/&gt;(gdb) target remote localhost:1234&lt;br/&gt;Remote debugging using localhost:1234&lt;br/&gt;[New Thread 1]&lt;br/&gt;0x00000000 in ?? ()&lt;br/&gt;(gdb) &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Explanation :&lt;br/&gt;&lt;br/&gt;Debugging with the moxie qemu simulator&lt;br/&gt;&lt;br/&gt;I’ve finally cracked the gdb+qemu puzzle, so now we can debug code running on the qemu moxie simulator!&lt;br/&gt;&lt;br/&gt;The last little gotcha was that the simulated $pc wasn’t being updated after single-stepping. This will get you nowhere fast! But it’s all fixed now, and here’s how it works…&lt;br/&gt;&lt;br/&gt;$ qemu-system-moxie -s -S -kernel hello.x&lt;br/&gt;&lt;br/&gt;This tells qemu to load our hello world program, hello.x. The “-s” option tells it to wait for a connection from GDB on port 1234. The -S option tells it to freeze on startup, and wait for a “continue” command from the debugger.&lt;br/&gt;&lt;br/&gt;Now, in a different terminal, fire up moxie-elf-gdb on hello.x and connect to qemu like so:&lt;br/&gt;&lt;br/&gt;(gdb) target remote localhost:1234&lt;br/&gt;&lt;br/&gt;GDB and qemu should be talking now, and the debugger will report that the sim is waiting on __start, the entry point to our hello.x ELF file. Put a breakpoint on main, and hit ‘c’ to continue. You should be debugging as usual now. I normally run moxie-elf-gdb within emacs in order to get a nice UI, but invoking it from ddd or Eclipse should work just as well.&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=cff8f715-f383-81d3-9009-c55af434a255' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-7735491953567564047?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/7735491953567564047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=7735491953567564047' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/7735491953567564047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/7735491953567564047'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/11/u-boot-in-qemu.html' title='u-boot in qemu'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-979855232627869285</id><published>2009-09-02T13:43:00.000-07:00</published><updated>2009-09-02T13:44:54.315-07:00</updated><title type='text'>Linux development manpages on Debian [man]</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Marx:/home/drasko# apt-get install manpages-posix-dev&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=f975db10-a2e3-86d3-8658-e932b1c5fe47' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-979855232627869285?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/979855232627869285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=979855232627869285' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/979855232627869285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/979855232627869285'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/09/linux-development-manpages-on-debian.html' title='Linux development manpages on Debian [man]'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-5572025910892047779</id><published>2009-08-12T05:44:00.000-07:00</published><updated>2009-08-12T05:44:00.514-07:00</updated><title type='text'>Pomodoro technique and timer (applet) in Debian</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;http://www.pomodorotechnique.com/&lt;br/&gt;&lt;br/&gt;http://timerapplet.sourceforge.net/&lt;br/&gt;http://packages.debian.org/fr/lenny/timer-applet&lt;br/&gt;http://www.flickr.com/photos/7982697@N05/sets/72157600138316537/detail/&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=c9bb2892-f098-8b70-821f-02ce111461d9' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-5572025910892047779?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/5572025910892047779/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=5572025910892047779' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/5572025910892047779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/5572025910892047779'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/08/pomodoro-technique-and-timer-applet-in.html' title='Pomodoro technique and timer (applet) in Debian'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-3328436717080578027</id><published>2009-08-12T05:09:00.000-07:00</published><updated>2009-08-12T05:09:00.144-07:00</updated><title type='text'>Zero length arrays in C</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;http://www.mail-archive.com/freebsd-hackers@freebsd.org/msg21219.html&lt;br/&gt;http://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html&lt;br/&gt;&lt;br/&gt;5.14 Arrays of Length Zero&lt;br/&gt;&lt;br/&gt;Zero-length arrays are allowed in GNU C. They are very useful as the last element of a structure which is really a header for a variable-length object:&lt;br/&gt;&lt;br/&gt;     &lt;font face='Courier New'&gt;struct line {&lt;br/&gt;       int length;&lt;br/&gt;       char contents[0];&lt;br/&gt;     };&lt;br/&gt;     &lt;br/&gt;     struct line *thisline = (struct line *)&lt;br/&gt;       malloc (sizeof (struct line) + this_length);&lt;br/&gt;&lt;br/&gt;     thisline-&amp;gt;length = this_length;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;In ISO C90, you would have to give contents a length of 1, which means either you waste space or complicate the argument to malloc.&lt;br/&gt;&lt;br/&gt;In ISO C99, you would use a flexible array member, which is slightly different in syntax and semantics:&lt;br/&gt;&lt;br/&gt;    * Flexible array members are written as contents[] without the 0.&lt;br/&gt;    * Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero.&lt;br/&gt;    * Flexible array members may only appear as the last member of a struct that is otherwise non-empty.&lt;br/&gt;    * A structure containing a flexible array member, or a union containing such a structure (possibly recursively), may not be a member of a structure or an element of an array. (However, these uses are permitted by GCC as extensions.) &lt;br/&gt;&lt;br/&gt;GCC versions before 3.0 allowed zero-length arrays to be statically initialized, as if they were flexible arrays. In addition to those cases that were useful, it also allowed initializations in situations that would corrupt later data. Non-empty initialization of zero-length arrays is now treated like any case where there are more initializer elements than the array holds, in that a suitable warning about "excess elements in array" is given, and the excess elements (all of them, in this case) are ignored.&lt;br/&gt;&lt;br/&gt;Instead GCC allows static initialization of flexible array members. This is equivalent to defining a new structure containing the original structure followed by an array of sufficient size to contain the data. I.e. in the following, f1 is constructed as if it were declared like f2.&lt;br/&gt;&lt;br/&gt;     &lt;font face='Courier New'&gt;struct f1 {&lt;br/&gt;       int x; int y[];&lt;br/&gt;     } f1 = { 1, { 2, 3, 4 } };&lt;br/&gt;     &lt;br/&gt;     struct f2 {&lt;br/&gt;       struct f1 f1; int data[3];&lt;br/&gt;     } f2 = { { 1 }, { 2, 3, 4 } };&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;The convenience of this extension is that f1 has the desired type, eliminating the need to consistently refer to f2.f1.&lt;br/&gt;&lt;br/&gt;This has symmetry with normal static arrays, in that an array of unknown size is also written with [].&lt;br/&gt;&lt;br/&gt;Of course, this extension only makes sense if the extra data comes at the end of a top-level object, as otherwise we would be overwriting data at subsequent offsets. To avoid undue complication and confusion with initialization of deeply nested arrays, we simply disallow any non-empty initialization except when the structure is the top-level object. For example:&lt;br/&gt;&lt;br/&gt;     &lt;font face='Courier New'&gt;struct foo { int x; int y[]; };&lt;br/&gt;     struct bar { struct foo z; };&lt;br/&gt;     &lt;br/&gt;     struct foo a = { 1, { 2, 3, 4 } };        // Valid.&lt;br/&gt;     struct bar b = { { 1, { 2, 3, 4 } } };    // Invalid.&lt;br/&gt;&lt;br/&gt;     struct bar c = { { 1, { } } };            // Valid.&lt;br/&gt;     struct foo d[1] = { { 1 { 2, 3, 4 } } };  // Invalid.&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;-------------------&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;The idea is to use this zero-length array as a reference to variable&lt;br/&gt;&lt;br/&gt;length data that’d be stored using the struct. If you are wondering why&lt;br/&gt;a pointer is not used, the size of a pointer would be non-zero, whereas&lt;br/&gt;the size of a zero-length array is guaranteed to be zero.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;-------------------&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;****************    Cool explanation   *********************************&lt;br/&gt;&lt;br/&gt;On Tue, Mar 20, 2001 at 01:03:21PM -0600, Peter Seebach wrote:&lt;br/&gt;&amp;gt; In message &amp;lt;[EMAIL PROTECTED]&amp;gt;, Shankar Agarwal writes:&lt;br/&gt;&lt;br/&gt;&amp;gt; &amp;gt;Can someone pls tell me if it is possible to define an array of size 0.&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; Not in C.&lt;br/&gt;&lt;br/&gt;Actually you can (see below).  It depends on the compiler and how strict&lt;br/&gt;you have it checking things.  It only works in this case because the &lt;br/&gt;&lt;br/&gt;memory manager is allocating an entire page for the structure, not&lt;br/&gt;just the size of the structure.&lt;br/&gt;&lt;br/&gt;It's not uncommon to use this for message-based communications where you&lt;br/&gt;have a header and payload  and want to use sizeof(struct message) to get &lt;br/&gt;&lt;br/&gt;the header size, but also want to use foo.payload to access the message &lt;br/&gt;itself.  In that case, it's more likely to be used as a cast on a buffer,&lt;br/&gt;(e.g., ((struct message*) buffer)-&amp;gt;payload)&lt;br/&gt;&lt;br/&gt;Realize, tho, there's a potential portability issue, if you use this.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;What follows was done on a NetBSD 1.5 system.&lt;br/&gt;&lt;br/&gt;&lt;font face='Courier New'&gt;[24]% cat zero.c &amp;amp;&amp;amp; make zero &amp;amp;&amp;amp; ./zero&lt;br/&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br/&gt;&lt;br/&gt;struct zero_array {&lt;br/&gt;        int header;&lt;br/&gt;        int payload[0];&lt;br/&gt;&lt;br/&gt;};&lt;br/&gt;&lt;br/&gt;int main()&lt;br/&gt;{&lt;br/&gt;        struct zero_array foo;&lt;br/&gt;&lt;br/&gt;        foo.header=1;&lt;br/&gt;        foo.payload[0]=10;&lt;br/&gt;        foo.payload[1]=12;&lt;br/&gt;        printf("Foo:\n\theader: %d\n", foo.header);&lt;br/&gt;        printf("\tpayload 0: %d\n", foo.payload[0]);&lt;br/&gt;&lt;br/&gt;        printf("\tpayload 1: %d\n", foo.payload[1]);&lt;br/&gt;        return 0;&lt;br/&gt;}&lt;br/&gt;cc -O2   -o zero zero.c&lt;br/&gt;Foo:&lt;br/&gt;        header: 1&lt;br/&gt;        payload 0: 10&lt;br/&gt;        payload 1: 12&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;****************************************************************************&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;In message &amp;lt;[EMAIL PROTECTED]&amp;gt;, John Franklin writes:&lt;br/&gt;&amp;gt;On Tue, Mar 20, 2001 at 01:03:21PM -0600, Peter Seebach wrote:&lt;br/&gt;&lt;br/&gt;&amp;gt;&amp;gt; In message &amp;lt;[EMAIL PROTECTED]&amp;gt;, Shankar Agarwal writes:&lt;br/&gt;&amp;gt;&amp;gt; &amp;gt;Can someone pls tell me if it is possible to define an array of size 0.&lt;br/&gt;&lt;br/&gt; &lt;br/&gt;&amp;gt;&amp;gt; Not in C.&lt;br/&gt;&lt;br/&gt;&amp;gt;Actually you can (see below).  It depends on the compiler and how strict&lt;br/&gt;&amp;gt;you have it checking things.&lt;br/&gt;&lt;br/&gt;The C language doesn't allow zero-sized objects.  Some systems may, but&lt;br/&gt;&lt;br/&gt;C itself doesn't.&lt;br/&gt;&lt;br/&gt;&amp;gt;What follows was done on a NetBSD 1.5 system.&lt;br/&gt;&lt;br/&gt;More importantly, it was done with gcc, which (by default) compiles a&lt;br/&gt;language called "GNU C", which is very similar to C, but has some extensions.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;In C99, you can do this "portably" (C99 isn't exactly universally adopted yet)&lt;br/&gt;by saying&lt;br/&gt;        &lt;font face='Courier New'&gt;struct message {&lt;br/&gt;                int header;&lt;br/&gt;                char payload[];&lt;br/&gt;        };&lt;br/&gt;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;and then doing&lt;br/&gt;        &lt;font face='Courier New'&gt;struct message *p;&lt;br/&gt;        p = malloc(sizeof(struct message) + 10);&lt;br/&gt;        p-&amp;gt;header = 10;&lt;br/&gt;        strcpy(p-&amp;gt;payload, "123456789");&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face='Courier New'&gt;&amp;gt;int main()&lt;br/&gt;&amp;gt;{&lt;br/&gt;&lt;br/&gt;&amp;gt;        struct zero_array foo;&lt;br/&gt;&amp;gt;&lt;br/&gt;&amp;gt;        foo.header=1;&lt;br/&gt;&amp;gt;        foo.payload[0]=10;&lt;br/&gt;&amp;gt;        foo.payload[1]=12;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;This isn't even a result of the page management, you're just overwriting&lt;br/&gt;&lt;br/&gt;other space.&lt;br/&gt;&lt;br/&gt;If you did&lt;br/&gt;        &lt;font face='Courier New'&gt;struct zero_array foo;&lt;br/&gt;        int a[2];&lt;/font&gt;&lt;br/&gt;you would probably find that a[0] was 10, and a[1] was 12.  Probably.&lt;br/&gt;The behavior is totally undefined, and it's not exactly reliable.  :)&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;-------&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;On Fri, Mar 30, 2001 at 10:37:28AM -0500, Lord Isildur wrote:&lt;br/&gt;&amp;gt; sine one knows the size of the struct, who need the pointer? just &lt;br/&gt;&amp;gt; take the displacement. &lt;br/&gt;&amp;gt; &lt;br/&gt;&lt;br/&gt;&amp;gt; char* buf; /* some buffer */&lt;br/&gt;&amp;gt; struct foo{&lt;br/&gt;&amp;gt; int header;&lt;br/&gt;&amp;gt; struct funkystruct blah;&lt;br/&gt;&amp;gt; };&lt;br/&gt;&amp;gt; &lt;br/&gt;&amp;gt; (struct foo*)buf; /*your headers are here */&lt;br/&gt;&amp;gt; (struct foo*)buf+1; /* and your data is here */&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Could, true. Buf if foo is:&lt;br/&gt;&lt;br/&gt;struct foo{&lt;br/&gt; struct header head;&lt;br/&gt; struct funcystruct data[0];&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;you can say:&lt;br/&gt;        mesg-&amp;gt;head-&amp;gt;headerbits;&lt;br/&gt;        mesg-&amp;gt;data[x]-&amp;gt;databits;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;A bit more readable, IMHO.&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=098427a0-683a-8d54-98c2-71f3123c1cad' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-3328436717080578027?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/3328436717080578027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=3328436717080578027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/3328436717080578027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/3328436717080578027'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/08/zero-length-arrays-in-c.html' title='Zero length arrays in C'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-5466435245822089692</id><published>2009-08-11T09:56:00.000-07:00</published><updated>2009-08-11T09:56:00.340-07:00</updated><title type='text'>Debug TRACE() with variadic arguments</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Define :&lt;br/&gt;&lt;br/&gt;&lt;font face='Courier New'&gt;#ifdef DEBUG&lt;br/&gt;#define TRACE(...) printf("DBG MESSAGE: " __VA_ARGS__)&lt;br/&gt;#else&lt;br/&gt;#define TRACE(...)&lt;br/&gt;#endif&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;and then in program, you can use something like :&lt;br/&gt;&lt;font face='Courier New'&gt;&lt;br/&gt;TRACE("my_array[%d]=%x\n", i , arr_val);&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;All the argument from &lt;font face='Courier New'&gt;TRACE() &lt;/font&gt;will be taken and substitued in the place of &lt;font face='Courier New'&gt;__VA_ARGS__&lt;/font&gt;, which will make printf to work well and print this message, with sentence DBG MESSAGE: in the begining.&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=639de6c9-85d5-80b9-a1f5-466cba18475b' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-5466435245822089692?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/5466435245822089692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=5466435245822089692' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/5466435245822089692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/5466435245822089692'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/08/debug-trace-with-variadic-arguments.html' title='Debug TRACE() with variadic arguments'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-6929883137919593984</id><published>2009-08-07T06:51:00.000-07:00</published><updated>2009-08-07T06:51:00.537-07:00</updated><title type='text'>strtoul() result begins with ffffffff</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;How is it possible that:&lt;br/&gt;char bin[64];&lt;br/&gt;char test[10] = "74";&lt;br/&gt;&lt;br/&gt;bin[0] = strtoul (test, &amp;amp;e, 16);&lt;br/&gt;printf("bin[0]=%#x\n", bin[0]);&lt;br/&gt;&lt;br/&gt;is giving:&lt;br/&gt;bin[0]=0x74&lt;br/&gt;&lt;br/&gt;and if we put:&lt;br/&gt;char test[10] = "84";&lt;br/&gt;&lt;br/&gt;result printed is:&lt;br/&gt;bin[0]=0xffffff84&lt;br/&gt;&lt;br/&gt;Well, for all X in char test[10] = "X4"; that are less than 8, digit X starts with binary "0". For 8 and more, it will start with binary "1". Since we put "=" between char bin[64], thus SIGNED, and result that strtoul()  signed. Two things happen here:&lt;br/&gt;&lt;br/&gt;1) &lt;b&gt;Assignment conversion&lt;/b&gt;&lt;strong&gt;&lt;b&gt;&lt;a name='HDRASGNCON' href='http://www.lnf.infn.it/Calcolo/doc/aixcxx/html/language/ref/rulvlari.htm#xtdc'/&gt;&lt;/b&gt;&lt;br/&gt;&lt;/strong&gt;An assignment conversion makes the value of the right operand have the same data type as the left operand.&lt;br/&gt;(In assignment operations, the type of the value being assigned is converted to the type of the variable that receives the assignment. C allows conversions by assignment between integral and floating types, even if information is lost in the conversion.)&lt;br/&gt;That means that our unsigned long return value of strtoul() becomes signed char.&lt;br/&gt;&lt;br/&gt;2)&lt;b&gt; Conversions from Unsigned Integral Types&lt;/b&gt;&lt;b&gt; &lt;/b&gt;    &lt;div class='title'&gt;An unsigned integer is converted to a shorter unsigned or signed integer by truncating the high-order bits, or to a longer unsigned or signed integer by zero-extending.&lt;br/&gt;When the value with integral type is demoted to a signed integer with smaller size, or an unsigned integer is converted to its corresponding signed integer, the value is unchanged if it can be represented in the new type. However, the value it represents changes if the sign bit is set, as in the following example.&lt;br/&gt;&lt;br/&gt;&lt;font face='Courier New'&gt;int j;&lt;br/&gt;unsigned short k = 65533;&lt;br/&gt;&lt;br/&gt;j = k;&lt;br/&gt;printf_s( "%hd\n", j );   // Prints -3&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;Let's look at char. The highest positive value you can represent with one char is +127, i.e. 0x7F. Anything above this is represented as a negative. For example, 0x80 is actually -128, the biggest (in amplitude) negative number you can represent with char (and 0xFF is -1).&lt;br/&gt;&lt;br/&gt;So, printing our result like this:&lt;br/&gt;&lt;font face='Courier New'&gt;char test[10] = "80";&lt;br/&gt;bin[0] = strtoul (test, &amp;amp;e, 16);&lt;br/&gt;printf("bin[0]=%d\n", bin[0]);&lt;br/&gt;drasko@Lenin:~/stuff$ ./test&lt;br/&gt;bin[0]=-128&lt;/font&gt;&lt;br/&gt;&lt;/div&gt;&lt;span id='ctl00_MTContentSelector1_mainContentContainer_ctl01'&gt; &lt;div id='ctl00_MTContentSelector1_mainContentContainer_ctl01_' class='libCScode'&gt;    &lt;/div&gt;&lt;/span&gt;Makes more sense, because %#x switch was additional confusion, because it printed additional (starting) 3 bytes for negaitve number, putting them all into F.&lt;br/&gt;&lt;br/&gt;RESOLUTION OF THE PROBLEM:&lt;br/&gt;The buffer that takes result of assignment must be decleared as unsigned char, and not as signed char!&lt;br/&gt;&lt;br/&gt;If we change&lt;br/&gt;&lt;font face='Courier New'&gt;char bin[64];&lt;/font&gt;&lt;br/&gt;to&lt;br/&gt;&lt;font face='Courier New'&gt;unsigned char bin[64];&lt;/font&gt;&lt;br/&gt;results will be good.&lt;br/&gt;&lt;cite&gt;&lt;i/&gt;&lt;br/&gt;&lt;/cite&gt; &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=95ac954f-54f8-8b54-b6f7-fdc91de77fa4' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-6929883137919593984?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/6929883137919593984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=6929883137919593984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/6929883137919593984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/6929883137919593984'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/08/strtoul-result-begins-with-ffffffff.html' title='strtoul() result begins with ffffffff'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-4937139869317205892</id><published>2009-08-05T10:20:00.000-07:00</published><updated>2009-08-05T10:20:00.769-07:00</updated><title type='text'>warning: implicit declaration of function ‘close’</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;#include &amp;lt;unistd.h&amp;gt;             /* definition of close() */&lt;br/&gt;&lt;br/&gt;http://linux.die.net/man/2/close&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=7f6f1951-de20-8993-9c35-4582b5c10b36' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-4937139869317205892?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/4937139869317205892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=4937139869317205892' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/4937139869317205892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/4937139869317205892'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/08/warning-implicit-declaration-of_05.html' title='warning: implicit declaration of function ‘close’'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-7994599754548849734</id><published>2009-08-05T10:17:00.000-07:00</published><updated>2009-08-05T10:17:00.391-07:00</updated><title type='text'>warning: implicit declaration of function ‘htons’</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;pre&gt;Include &amp;lt;netinet/in.h&amp;gt; instead of &amp;lt;linux/in.h&amp;gt; to get htons()&lt;br /&gt;prototpye.&lt;br /&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=3c8c7148-8fa9-857d-bf78-ef7abab8f8f2' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-7994599754548849734?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/7994599754548849734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=7994599754548849734' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/7994599754548849734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/7994599754548849734'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/08/warning-implicit-declaration-of.html' title='warning: implicit declaration of function ‘htons’'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-881033865797163287</id><published>2009-08-05T09:59:00.000-07:00</published><updated>2009-08-05T10:11:37.640-07:00</updated><title type='text'>ether_ntoa() format</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;div class='gwt-Label L' style='white-space: nowrap;'&gt;ether_ntoa_r.c - glibc-2.3.5/inet :&lt;span id='l25'&gt;&lt;span class='stx-keyword'/&gt;&lt;br/&gt;&lt;font face='Courier New'&gt;char *&lt;br/&gt;ether_ntoa_r (const struct ether_addr *addr, char *buf)&lt;br/&gt;{&lt;br/&gt;  sprintf (buf, "%x:%x:%x:%x:%x:%x",&lt;br/&gt;           addr-&amp;gt;ether_addr_octet[0], addr-&amp;gt;ether_addr_octet[1],&lt;br/&gt;           addr-&amp;gt;ether_addr_octet[2], addr-&amp;gt;ether_addr_octet[3],&lt;br/&gt;           addr-&amp;gt;ether_addr_octet[4], addr-&amp;gt;ether_addr_octet[5]);&lt;br/&gt;  return buf;&lt;br/&gt;}&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;That means that if we have some of the bytes like 5, or 0, we can get an address like this :&lt;br/&gt;5:3a:31:0:34:1c&lt;br/&gt;&lt;br/&gt;This is not adequate if we want to be sure that value has been printed always with two nubers between ':'.&lt;br/&gt;&lt;br/&gt;That's why we can a coriged solution :&lt;br/&gt;&lt;font face='Courier New'&gt;sprintf (mac, "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x",&lt;br/&gt;           ea.ether_addr_octet[0], ea.ether_addr_octet[1],&lt;br/&gt;           ea.ether_addr_octet[2], ea.ether_addr_octet[3],&lt;br/&gt;           ea.ether_addr_octet[4], ea.ether_addr_octet[5]);&lt;/font&gt;&lt;span id='l25'&gt;&lt;span class='stx-keyword'&gt;&lt;br/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=b07ae1bc-a27b-889e-9f0d-10a5bba7a8b4' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-881033865797163287?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/881033865797163287/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=881033865797163287' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/881033865797163287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/881033865797163287'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/08/etherntoa-format.html' title='ether_ntoa() format'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-3495962619702143183</id><published>2009-08-03T05:40:00.000-07:00</published><updated>2009-08-03T05:40:00.436-07:00</updated><title type='text'>error: expected ')' before '*' token</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;This kind of error is reported by compiler when it tries to parse sybols it does understand, because they were not reported to it - proper my_type_def.h header file is missing.&lt;br/&gt;&lt;br/&gt;my_error_t my_function(my_type_t *my_pointer)&lt;br/&gt;{&lt;br/&gt;   ...&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;Here, because #include my_header.h (where my_type_t is defined) is missing, compiler is telling us this message.&lt;br/&gt;&lt;br/&gt;Solution :&lt;br/&gt;include proper headers!&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=36ec4e2f-6d02-800e-b6f1-ead841086edb' alt='' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-3495962619702143183?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/3495962619702143183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=3495962619702143183' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/3495962619702143183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/3495962619702143183'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/08/error-expected-before-token.html' title='error: expected &amp;#39;)&amp;#39; before &amp;#39;*&amp;#39; token'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-4211896542532789149</id><published>2009-07-16T02:44:00.000-07:00</published><updated>2009-07-16T02:44:00.292-07:00</updated><title type='text'>Selecting previous code chunks from svn for copy/paste</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;You want to select and copy paste chunks of code from previous svn revision, but svn diff marks changes with "+ " or "-" in the beginnig of each line. In trac, lines are prefixed with line numbers, so selct will pick up these also.&lt;br/&gt;&lt;br/&gt;We want a chunk of what was in previous revision, but easy to select/copy/paste:&lt;br/&gt;&lt;br/&gt;drasko@marx:~/u-boot$ svn diff -r HEAD:PREV --diff-cmd diff -x -n common/cmd_spidboot.c&lt;br/&gt;&lt;br/&gt;Use:&lt;br/&gt;drasko@marx:~/u-boot$ svn help diff&lt;br/&gt;and:&lt;br/&gt;drasko@marx:~/u-boot$ man diff&lt;br/&gt;to see what the command means, but basically it tells svn to use diff command with specific switches.&lt;br/&gt;&lt;br/&gt;If you want to select only new changes, change HEAD:PREV to PREV:HEAD&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-4211896542532789149?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/4211896542532789149/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=4211896542532789149' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/4211896542532789149'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/4211896542532789149'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/07/selecting-previous-code-chunks-from-svn.html' title='Selecting previous code chunks from svn for copy/paste'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-5579068317060724849</id><published>2009-07-10T16:52:00.000-07:00</published><updated>2009-07-10T16:53:20.471-07:00</updated><title type='text'>Numbers in different formats from command line</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;HEX -&amp;gt; BASE OF 2&lt;br/&gt;In order to quickly view a hex number in binary format from a command line there is a little trick.&lt;br/&gt;xxd can be used to hexdump a bin file, but also to do reverse - to create a binary file out of hexdump format. Well, hexdump format looks like this :&lt;br/&gt;0000000: 12 ff 3e&lt;br/&gt;That means in this format:&lt;br/&gt;&amp;lt;offset&amp;gt;: &amp;lt;byte&amp;gt; &amp;lt;byte&amp;gt; ...&lt;br/&gt;This is the format that xxd -r will take and produce bin output.&lt;br/&gt;Adding -p option, we can write hexdump in this format:&lt;br/&gt;&amp;lt;byte&amp;gt;&amp;lt;byte&amp;gt;...&lt;br/&gt;That means that file with this content :&lt;br/&gt;31 32 31&lt;br/&gt;given to xxd -r -p test.txt &amp;gt; hex.bin&lt;br/&gt;will produce hex.bin with these contents:&lt;br/&gt;121&lt;br/&gt;i. e. real binary values will be showed, and Vi will print these chars as "1" (ascii value 31),"2" (ascii value 32), "1".&lt;br/&gt;hd will hexdump this bin file backward again, and present it in the hexdump format:&lt;br/&gt;drasko@Marx:~/video$ hd hex.bin &lt;br/&gt;00000000  31 32 31                                          |121|&lt;br/&gt;00000003&lt;br/&gt;&lt;br/&gt;That gives the idea to use xdd to transform number in hexadecimal format actually into bin, and analyze that bin via hd or xdd again, to represent it back in hexdump value, only this time we can add switches how we want this bin value to be showed.&lt;br/&gt;For example:&lt;br/&gt;drasko@Marx:~$ xxd -r -p | xxd&lt;br/&gt;0a           &amp;lt;------------- enter 0a and press &amp;lt;ENTER&amp;gt;, and after CTRL+D here to give EOF&lt;br/&gt;0000000: 0a                                       .&lt;br/&gt;drasko@Marx:~$ &lt;br/&gt;&lt;br/&gt;Cool. Let's try to give a switch to second xxd to make it represent given binary into base 2 format:&lt;br/&gt;&lt;br/&gt;drasko@Marx:~$ xxd -r -p | xxd -b&lt;br/&gt;0a&lt;br/&gt;0000000: 00001010                                               .&lt;br/&gt;&lt;br/&gt;NOTE:&lt;br/&gt;We must always enter hex nuber in byte-per-byte format, because this is hexdump format that xxd is expecting. We cannot do :&lt;br/&gt;drasko@Marx:~$ xxd -r -p | xxd&lt;br/&gt;238&lt;br/&gt;0000000: 23                                       #&lt;br/&gt;because produced binary will be just one byte,  0x23, and when we represent that in base 2, results will not be what we wanted:&lt;br/&gt;drasko@Marx:~$ xxd -r -p | xxd -b&lt;br/&gt;238&lt;br/&gt;0000000: 00100011 &lt;br/&gt;&lt;br/&gt;We actually wanted this :&lt;br/&gt;drasko@Marx:~$ xxd -r -p | xxd -b&lt;br/&gt;0238&lt;br/&gt;0000000: 00000010 00111000                                      .8&lt;br/&gt;drasko@Marx:~$ &lt;br/&gt;&lt;br/&gt;HEX -&amp;gt; BASE OF 10 (and back)&lt;br/&gt;Use python interpreter for this:&lt;br/&gt;drasko@Marx:~$ python&lt;br/&gt;Python 2.5.2 (r252:60911, Sep 29 2008, 21:15:13) &lt;br/&gt;[GCC 4.3.2] on linux2&lt;br/&gt;Type "help", "copyright", "credits" or "license" for more information.&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; 0x32&lt;br/&gt;50&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; hex(50)&lt;br/&gt;'0x32'&lt;br/&gt;&amp;gt;&amp;gt;&amp;gt; &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-5579068317060724849?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/5579068317060724849/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=5579068317060724849' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/5579068317060724849'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/5579068317060724849'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/07/numbers-in-different-formats-from.html' title='Numbers in different formats from command line'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-3710615058725413399</id><published>2009-06-25T11:06:00.000-07:00</published><updated>2009-07-08T22:57:01.554-07:00</updated><title type='text'>On structure assignment (pack your ETH header structures!)</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Program like this :&lt;br/&gt;&lt;br/&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br/&gt;#include &amp;lt;stddef.h&amp;gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;int main()&lt;br/&gt;{&lt;br/&gt;    int i, j;&lt;br/&gt;    char a[] = { 0x0, 0x1, 0x2, 0x4, 0x5, 0x6, 0x7, 0x8};&lt;br/&gt;&lt;br/&gt;    typedef struct&lt;br/&gt;    {&lt;br/&gt;        char c;&lt;br/&gt;        short s;&lt;br/&gt;        int k;&lt;br/&gt;    } s_t;&lt;br/&gt;&lt;br/&gt;    s_t str;&lt;br/&gt;&lt;br/&gt;    printf ("offsetof(str, c) = %d\n", offsetof(s_t, c));&lt;br/&gt;    printf ("offsetof(str, s) = %d\n", offsetof(s_t, s));&lt;br/&gt;    printf ("offsetof(str, k) = %d\n", offsetof(s_t, k));&lt;br/&gt;&lt;br/&gt;    str = *( (s_t *)a );&lt;br/&gt;&lt;br/&gt;    printf("str.c = %#x\n", str.c);&lt;br/&gt;    printf("str.s = %#x\n", str.s);&lt;br/&gt;    printf("str.k = %#x\n", str.k);&lt;br/&gt;&lt;br/&gt;    return 0;&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;Will give output like this :&lt;br/&gt;&lt;br/&gt;drasko@bg:~/stuff$ ./struct_ass &lt;br/&gt;offsetof(str, c) = 0&lt;br/&gt;offsetof(str, s) = 2&lt;br/&gt;offsetof(str, k) = 4&lt;br/&gt;str.c = 0&lt;br/&gt;str.s = 0x402&lt;br/&gt;str.k = 0x8070605&lt;br/&gt;drasko@bg:~/stuff$ &lt;br/&gt;&lt;br/&gt;If, however, structure was packed, like this :&lt;br/&gt;&lt;br/&gt;typedef struct&lt;br/&gt;    {&lt;br/&gt;        char c;&lt;br/&gt;        short s;&lt;br/&gt;        int k;&lt;br/&gt;    } __attribute__ ((__packed__)) s_t;&lt;br/&gt;&lt;br/&gt;Result would be different :&lt;br/&gt;&lt;br/&gt;drasko@bg:~/stuff$ ./struct_ass &lt;br/&gt;offsetof(str, c) = 0&lt;br/&gt;offsetof(str, s) = 1&lt;br/&gt;offsetof(str, k) = 3&lt;br/&gt;str.c = 0&lt;br/&gt;str.s = 0x201&lt;br/&gt;str.k = 0x7060504&lt;br/&gt;drasko@bg:~/stuff$ &lt;br/&gt;&lt;br/&gt;So - advice for casting your ETH packet stream into ETH header-like pkt_hdr struct for easier manipulation of memcers in ETH frame (like src and dst MAC addr and ethtype) :&lt;br/&gt;&lt;u&gt;pack your header struct to kill the padding!&lt;/u&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=e6671ac6-7338-818f-a607-601424df64c2' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-3710615058725413399?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/3710615058725413399/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=3710615058725413399' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/3710615058725413399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/3710615058725413399'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/06/on-structure-assignment-pack-your-eth.html' title='On structure assignment (pack your ETH header structures!)'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-3155108692163255628</id><published>2009-06-22T09:37:00.000-07:00</published><updated>2009-07-08T22:57:00.970-07:00</updated><title type='text'>expected '=', ',', ';', 'asm' or '__attribute__'</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;error: expected '=', ',', ';', 'asm' or '__attribute__' before 'foo_t'&lt;br/&gt;&lt;br/&gt;This error message can appear on compilation of .c file, whose very first function is :&lt;br/&gt;&lt;br/&gt;foo_t bar(void)&lt;br/&gt;{&lt;br/&gt;   /* ... */&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;This signalize that ';' is missing before your function and adding it would surely solve the problem, like this :&lt;br/&gt;&lt;br/&gt;; foo_t bar(void)&lt;br/&gt;{&lt;br/&gt;   /* ... */&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;But that is only placebo. Real problem comes actually from the missing ';' in include file, foo.h, that is included and unrolled by preprocessor right before the definition of the bar() in your .c file. For example, last lines of foo.h might be :&lt;br/&gt;&lt;br/&gt;/* ... */&lt;br/&gt;typedef baz_t (* handler)(int arg1, int arg2)          &amp;lt;--- MISSING ';'&lt;br/&gt;#endif /* FOO_H */&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=b8398f90-6685-8af3-8d4c-03529aa23f22' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-3155108692163255628?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/3155108692163255628/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=3155108692163255628' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/3155108692163255628'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/3155108692163255628'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/06/expected-or.html' title='expected &amp;#39;=&amp;#39;, &amp;#39;,&amp;#39;, &amp;#39;;&amp;#39;, &amp;#39;asm&amp;#39; or &amp;#39;__attribute__&amp;#39;'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-5332060165428803117</id><published>2009-06-22T07:17:00.000-07:00</published><updated>2009-06-22T07:17:01.429-07:00</updated><title type='text'>Vi - Hidden missing tab in Makefile</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Makefile:&amp;lt;line_num&amp;gt;: *** missing separator.  Stop.&lt;br/&gt;&lt;br/&gt;Most probably because of missing TAB in the begining of the line. you know this, you verified that you are starting line by pressing TAB in your Vi, and still you are getting this error. Why?&lt;br/&gt;&lt;br/&gt;Try&lt;br/&gt;:set et?&lt;br/&gt;&lt;br/&gt;and if it shows:&lt;br/&gt;expandtab&lt;br/&gt;&lt;br/&gt;then this is an answer. Expandtab is transfering your tabs into spaces (and this is very often demanded Vi setup by project coding standard).&lt;br/&gt;&lt;br/&gt;Solution:&lt;br/&gt;In instert mode press CTRL+v, &amp;lt;tab&amp;gt;&lt;br/&gt;This will insert real tab char.&lt;br/&gt;&lt;br/&gt;Verify that line begins with real &amp;lt;TAB&amp;gt; char by issuing Vi command :&lt;br/&gt;:set list&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=bb78d690-1fcf-844a-b201-ce3e17ac43d5' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-5332060165428803117?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/5332060165428803117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=5332060165428803117' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/5332060165428803117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/5332060165428803117'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/06/vi-hidden-missing-tab-in-makefile.html' title='Vi - Hidden missing tab in Makefile'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-8014906617214556230</id><published>2009-06-22T07:10:00.000-07:00</published><updated>2009-06-22T07:10:04.854-07:00</updated><title type='text'>Neat and compact itoa() implementation</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;char* itoa(int val, int base)&lt;br/&gt;{&lt;br/&gt;    static char buf[32] = {0};&lt;br/&gt;    int i = 30;&lt;br/&gt;    for(; val &amp;amp;&amp;amp; i ; --i, val /= base)&lt;br/&gt;        buf[i] = "0123456789abcdef"[val % base];&lt;br/&gt;    &lt;br/&gt;    return &amp;amp;buf[i+1];&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=4935e2dd-5b41-8ff6-8a90-5a753bc3d8df' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-8014906617214556230?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/8014906617214556230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=8014906617214556230' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/8014906617214556230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/8014906617214556230'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/06/neat-and-compact-itoa-implementation.html' title='Neat and compact itoa() implementation'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-6713390582693747772</id><published>2009-06-14T15:11:00.000-07:00</published><updated>2009-06-14T15:13:02.144-07:00</updated><title type='text'>cyrillic in LaTeX</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Marx:/home/drasko/alp# apt-get install texlive-lang-cyrillic&lt;br/&gt;&lt;br/&gt;\documentclass{article}&lt;br/&gt;%\usepackage{ucs}&lt;br/&gt;\usepackage[utf8]{inputenc}&lt;br/&gt;\usepackage[T2A]{fontenc}&lt;br/&gt;%\usepackage[english, serbian]{babel}&lt;br/&gt;\title{Србија, бато, Србија}&lt;br/&gt;\author{Драшко ДРАШКОВИЋ}&lt;br/&gt;\date{19 јануар 2009}&lt;br/&gt;\begin{document}&lt;br/&gt;\maketitle&lt;br/&gt;Успех!&lt;br/&gt;\end{document}&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-6713390582693747772?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/6713390582693747772/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=6713390582693747772' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/6713390582693747772'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/6713390582693747772'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/06/cyrillic-in-latex.html' title='cyrillic in LaTeX'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-1331862592260453088</id><published>2009-06-07T08:49:00.000-07:00</published><updated>2009-06-07T08:50:14.295-07:00</updated><title type='text'>xmame settings on Linux</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Place roms in dir.&lt;br/&gt;In order to launch xmame, change /etc/xmame/xmamerc&lt;br/&gt;### Data files/directories ###&lt;br/&gt;#rompath                 /usr/share/games/xmame/roms&lt;br/&gt;rompath                 /home/drasko/mame/roms&lt;br/&gt;&lt;br/&gt;Go to the roms dir and :&lt;br/&gt;$ drasko@Marx:~/mame/roms$ xmame.SDL -ef 3 -fullscreen kungfum.zip&lt;br/&gt;&lt;br/&gt;Only xmame.SDL can do fullscreen, pure xmame can not.&lt;br/&gt;&lt;br/&gt;Use shift+home or shift+insert for scaling if not in fullscreen mode.&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-1331862592260453088?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/1331862592260453088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=1331862592260453088' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/1331862592260453088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/1331862592260453088'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/06/xmame-settings-on-linux.html' title='xmame settings on Linux'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-3488743405147147512</id><published>2009-06-06T06:56:00.000-07:00</published><updated>2009-06-06T06:57:23.198-07:00</updated><title type='text'>Advanced Linux Programming Book</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;br/&gt;&lt;cite&gt;www.&lt;b&gt;advancedlinuxprogramming&lt;/b&gt;.com&lt;/cite&gt;&lt;br/&gt;&lt;br/&gt;French translation :&lt;br/&gt;http://www.advancedlinuxprogramming-fr.org/doku.php&lt;br/&gt;&lt;br/&gt;Get tex sources :&lt;br/&gt;$ svn co svn://svn.tuxfamily.org/svnroot/advancedlp/advancedlp/trunk&lt;br/&gt;&lt;i&gt;&lt;br/&gt;&lt;/i&gt;resolving of &lt;i&gt;! LaTeX Error: File `sectsty.sty' not found.&lt;/i&gt; :&lt;i&gt;&lt;br/&gt;&lt;/i&gt;# apt-get install texlive-latex-extra&lt;i&gt;&lt;br/&gt;&lt;/i&gt;&lt;br/&gt;In the sources there is ruines.png missing. &lt;br/&gt;!pdfTeX error: pdflatex (file ../img/ruines.png): cannot find image file&lt;br/&gt;Resolving that error:&lt;br/&gt;$ cd fr/trunk/fr/src/img&lt;br/&gt;drasko@Marx:~/alp/fr/trunk/fr/src/img$ ls&lt;br/&gt;codesourcery.png&lt;br/&gt;drasko@Marx:~/alp/fr/trunk/fr/src/img$ cp codesourcery.png ruines.png&lt;i&gt;&lt;br/&gt;&lt;/i&gt;(I just pathceh it, to have some .png at all in order to build)&lt;i&gt;&lt;br/&gt;&lt;br/&gt;&lt;/i&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-3488743405147147512?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/3488743405147147512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=3488743405147147512' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/3488743405147147512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/3488743405147147512'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/06/advanced-linux-programming-book.html' title='Advanced Linux Programming Book'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-1753908015671061279</id><published>2009-06-06T05:51:00.000-07:00</published><updated>2009-06-06T05:53:01.097-07:00</updated><title type='text'>KOS - The Kid Operating System</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Nice project for self education on OS :&lt;br/&gt;http://kos.enix.org/&lt;br/&gt;&lt;br/&gt;$ mkdir kos&lt;br/&gt;$ cd kos&lt;br/&gt;$ cvs -d :pserver:anonymous@kos.enix.org:/var/cvs/kos login&lt;br/&gt;$ cvs -z3 -d :pserver:anonymous@kos.enix.org:/var/cvs/kos co .&lt;br/&gt;(in order to download all dirs)&lt;br/&gt;$ cd kos-doc&lt;br/&gt;$ su&lt;br/&gt;# apt-get install kile&lt;br/&gt;(easiest way to get all you need for Latex + nice editor,&lt;br/&gt;but that will not be enough, because texlive-latex-base comes with a little bug: kvoptins.sty missing&lt;br/&gt;https://bugs.launchpad.net/ubuntu/+source/texlive-base/+bug/114299 )&lt;br/&gt;# apt-get install texlive-latex-recommended&lt;br/&gt;(to get them)&lt;br/&gt;$ make ps&lt;br/&gt;&lt;br/&gt;Happy starting!&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-1753908015671061279?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/1753908015671061279/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=1753908015671061279' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/1753908015671061279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/1753908015671061279'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/06/kos-kid-operating-system.html' title='KOS - The Kid Operating System'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-493973005578861173</id><published>2009-05-27T07:36:00.000-07:00</published><updated>2009-05-27T07:36:00.619-07:00</updated><title type='text'>Transforming eth addr string to a sequence of numbers</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Here is a function that takes a srting in a form 11:22:33:44:55:66,&lt;br/&gt;or similar (for example 000001:022:3:000000000000000044:5:06) and transform it in a sequence of hex nubers to be stored in the appropriate nvram structure field, which is of type char eth_address[6] (so it really takes number, not string chars and ':' delimiters) :&lt;br/&gt;&lt;br/&gt;int i = 0;&lt;br/&gt;char *s = my_eth_addr_string;&lt;br/&gt;char *e = NULL;&lt;br/&gt;for (i = 0; i &amp;lt; 6; i++) &lt;br/&gt;{&lt;br/&gt;    nvram.eth_address[i] = s ? strtoul (s, &amp;amp;e, 16) : 0;&lt;br/&gt;    if (s)&lt;br/&gt;        s = (*e) ? e + 1 : e;&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=6760815a-73b9-8def-aeaf-0dc7ea37cb14' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-493973005578861173?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/493973005578861173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=493973005578861173' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/493973005578861173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/493973005578861173'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/05/transforming-eth-addr-string-to.html' title='Transforming eth addr string to a sequence of numbers'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-8660546917054674731</id><published>2009-05-22T07:51:00.000-07:00</published><updated>2009-05-22T07:51:00.370-07:00</updated><title type='text'>U-Boot environment vars</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;- In &lt;b&gt;u-boot/include/configs/versatile.h&lt;/b&gt; :&lt;br/&gt;&lt;br/&gt;/*-----------------------------------------------------------------------&lt;br/&gt; * FLASH and environment organization&lt;br/&gt; */&lt;br/&gt;&lt;br/&gt;#define VERSATILE_SYS_BASE                    0x10000000&lt;br/&gt;#define VERSATILE_SYS_FLASH_OFFSET            0x4C&lt;br/&gt;#define VERSATILE_FLASHCTRL              (VERSATILE_SYS_BASE + VERSATILE_SYS_FLASH_OFFSET)&lt;br/&gt;#define VERSATILE_FLASHPROG_FLVPPEN          (1 &amp;lt;&amp;lt; 0)    /* Enable writing to flash */&lt;br/&gt;&lt;br/&gt;#define CFG_MAX_FLASH_BANKS    1        /* max number of memory banks */&lt;br/&gt;#define PHYS_FLASH_SIZE         0x34000000    /* 64MB */&lt;br/&gt;/* timeout values are in ticks */&lt;br/&gt;#define CFG_FLASH_ERASE_TOUT    (20*CFG_HZ)    /* Timeout for Flash Erase */&lt;br/&gt;#define CFG_FLASH_WRITE_TOUT    (20*CFG_HZ)    /* Timeout for Flash Write */&lt;br/&gt;#define CFG_MAX_FLASH_SECT    (256)&lt;br/&gt;&lt;br/&gt;#define PHYS_FLASH_1        (CFG_FLASH_BASE)&lt;br/&gt;&lt;br/&gt;#define CFG_ENV_IS_IN_FLASH     1               /* env in flash instead of CFG_ENV_IS_NOWHERE */&lt;br/&gt;#define CFG_ENV_SECT_SIZE       0x00020000      /* 256 KB sectors (x2) */&lt;br/&gt;#define CFG_ENV_SIZE            0x10000         /* Total Size of Environment Sector */&lt;br/&gt;#define CFG_ENV_OFFSET          0x01f00000      /* environment starts here  */&lt;br/&gt;#define CFG_ENV_ADDR            (CFG_FLASH_BASE + CFG_ENV_OFFSET)&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;This is important - CFG_ENV_ADDR. It tells where will be env variables held in memory (in this case flash).&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;- In &lt;b&gt;u-boot/common/env_flash.c&lt;/b&gt; :&lt;br/&gt;&lt;br/&gt;char * env_name_spec = "Flash";&lt;br/&gt;&lt;br/&gt;#ifdef ENV_IS_EMBEDDED&lt;br/&gt;&lt;br/&gt;extern uchar environment[];&lt;br/&gt;env_t *env_ptr = (env_t *)(&amp;amp;environment[0]);&lt;br/&gt;&lt;br/&gt;#ifdef CMD_SAVEENV&lt;br/&gt;/* static env_t *flash_addr = (env_t *)(&amp;amp;environment[0]);-broken on ARM-wd-*/&lt;br/&gt;static env_t *flash_addr = (env_t *)CFG_ENV_ADDR;&lt;br/&gt;#endif&lt;br/&gt;&lt;br/&gt;#else /* ! ENV_IS_EMBEDDED */&lt;br/&gt;&lt;br/&gt;env_t *env_ptr = (env_t *)CFG_ENV_ADDR;&lt;br/&gt;#ifdef CMD_SAVEENV&lt;br/&gt;static env_t *flash_addr = (env_t *)CFG_ENV_ADDR;&lt;br/&gt;#endif&lt;br/&gt;&lt;br/&gt;#endif /* ENV_IS_EMBEDDED */&lt;br/&gt;&lt;br/&gt;#ifdef CFG_ENV_ADDR_REDUND&lt;br/&gt;static env_t *flash_addr_new = (env_t *)CFG_ENV_ADDR_REDUND;&lt;br/&gt;&lt;br/&gt;/* CFG_ENV_ADDR is supposed to be on sector boundary */&lt;br/&gt;static ulong end_addr = CFG_ENV_ADDR + CFG_ENV_SECT_SIZE - 1;&lt;br/&gt;static ulong end_addr_new = CFG_ENV_ADDR_REDUND + CFG_ENV_SECT_SIZE - 1;&lt;br/&gt;&lt;br/&gt;#define ACTIVE_FLAG   1&lt;br/&gt;#define OBSOLETE_FLAG 0&lt;br/&gt;#endif /* CFG_ENV_ADDR_REDUND */&lt;br/&gt;&lt;br/&gt;extern uchar default_environment[];&lt;br/&gt;extern int default_environment_size;&lt;br/&gt;&lt;br/&gt;Also there basic intialization of gd general data structure (and to check if Flash is OK, stuff like this...) :&lt;br/&gt;&lt;br/&gt;int  env_init(void)&lt;br/&gt;{&lt;br/&gt;#ifdef CONFIG_OMAP2420H4&lt;br/&gt;    int flash_probe(void);&lt;br/&gt;&lt;br/&gt;    if(flash_probe() == 0)&lt;br/&gt;        goto bad_flash;&lt;br/&gt;#endif&lt;br/&gt;    if (crc32(0, env_ptr-&amp;gt;data, ENV_SIZE) == env_ptr-&amp;gt;crc) {&lt;br/&gt;        gd-&amp;gt;env_addr  = (ulong)&amp;amp;(env_ptr-&amp;gt;data);&lt;br/&gt;        gd-&amp;gt;env_valid = 1;&lt;br/&gt;        return(0);&lt;br/&gt;    }&lt;br/&gt;#ifdef CONFIG_OMAP2420H4&lt;br/&gt;bad_flash:&lt;br/&gt;#endif&lt;br/&gt;    gd-&amp;gt;env_addr  = (ulong)&amp;amp;default_environment[0];&lt;br/&gt;    gd-&amp;gt;env_valid = 0;&lt;br/&gt;    return (0);&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;- In &lt;b&gt;u-boot/arm_lib/board.c&lt;/b&gt; :&lt;br/&gt;&lt;br/&gt;gd pointer to env is initialized: &lt;br/&gt;&lt;br/&gt;typedef int (init_fnc_t) (void);&lt;br/&gt;&lt;br/&gt;int print_cpuinfo (void); /* test-only */&lt;br/&gt;&lt;br/&gt;init_fnc_t *init_sequence[] = {&lt;br/&gt;    cpu_init,        /* basic cpu dependent setup */&lt;br/&gt;    board_init,        /* basic board dependent setup */&lt;br/&gt;    interrupt_init,        /* set up exceptions */&lt;br/&gt;    env_init,        /* initialize environment */&lt;br/&gt;    init_baudrate,        /* initialze baudrate settings */&lt;br/&gt;    serial_init,        /* serial communications setup */&lt;br/&gt;    console_init_f,        /* stage 1 init of console */&lt;br/&gt;    display_banner,        /* say that we are here */&lt;br/&gt;#if defined(CONFIG_DISPLAY_CPUINFO)&lt;br/&gt;    print_cpuinfo,        /* display cpu info (and speed) */&lt;br/&gt;#endif&lt;br/&gt;#if defined(CONFIG_DISPLAY_BOARDINFO)&lt;br/&gt;    checkboard,        /* display board info */&lt;br/&gt;#endif&lt;br/&gt;    dram_init,        /* configure available RAM banks */&lt;br/&gt;    display_dram_config,&lt;br/&gt;    NULL,&lt;br/&gt;};&lt;br/&gt;&lt;br/&gt;void start_armboot (void)&lt;br/&gt;{&lt;br/&gt;    init_fnc_t **init_fnc_ptr;&lt;br/&gt;    char *s;&lt;br/&gt;#ifndef CFG_NO_FLASH&lt;br/&gt;    ulong size;&lt;br/&gt;#endif&lt;br/&gt;#if defined(CONFIG_VFD) || defined(CONFIG_LCD)&lt;br/&gt;    unsigned long addr;&lt;br/&gt;#endif&lt;br/&gt;&lt;br/&gt;    /* Pointer is writable since we allocated a register for it */&lt;br/&gt;    gd = (gd_t*)(_armboot_start - CFG_MALLOC_LEN - sizeof(gd_t));&lt;br/&gt;    /* compiler optimization barrier needed for GCC &amp;gt;= 3.4 */&lt;br/&gt;    __asm__ __volatile__("": : :"memory");&lt;br/&gt;&lt;br/&gt;    memset ((void*)gd, 0, sizeof (gd_t));&lt;br/&gt;    gd-&amp;gt;bd = (bd_t*)((char*)gd - sizeof(bd_t));&lt;br/&gt;    memset (gd-&amp;gt;bd, 0, sizeof (bd_t));&lt;br/&gt;&lt;br/&gt;    monitor_flash_len = _bss_start - _armboot_start;&lt;br/&gt;&lt;br/&gt;    for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {&lt;br/&gt;        if ((*init_fnc_ptr)() != 0) {&lt;br/&gt;            hang ();&lt;br/&gt;        }&lt;br/&gt;    }&lt;br/&gt;&lt;br/&gt;which is a call to function in &lt;b&gt;u-boot/common/env_flash.c&lt;/b&gt;.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Chunk of memory in Flash that hoslds env variables is later relocated from Flash to RAM :&lt;br/&gt;&lt;br/&gt;/* initialize environment */&lt;br/&gt;    env_relocate ();&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=c0ee0ad4-af7e-8ee1-8be6-30c5565f4617' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-8660546917054674731?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/8660546917054674731/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=8660546917054674731' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/8660546917054674731'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/8660546917054674731'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/05/u-boot-environment-vars.html' title='U-Boot environment vars'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-8352478110065117327</id><published>2009-05-19T07:47:00.000-07:00</published><updated>2009-05-19T07:47:00.184-07:00</updated><title type='text'>Some missing includes</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;problem : test.c:392: warning: incompatible implicit declaration of built-in function ‘memcpy’&lt;br/&gt;solution : #include &amp;lt;string.h&amp;gt;&lt;br/&gt;&lt;br/&gt;problem : linux/example.h:29: error: expected specifier-qualifier-list before ‘uint32_t’&lt;br/&gt;solution : #include &amp;lt;inttypes.h&amp;gt;&lt;br/&gt;&lt;br/&gt;Also note : for using strerr() and friends include errno.h&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=b5a47865-0055-838d-813c-02639fb51ce3' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-8352478110065117327?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/8352478110065117327/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=8352478110065117327' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/8352478110065117327'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/8352478110065117327'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/05/some-missing-includes.html' title='Some missing includes'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-8341755337793036797</id><published>2009-05-15T05:57:00.000-07:00</published><updated>2009-05-15T05:57:00.419-07:00</updated><title type='text'>Linux relocation address - where to find it</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Here is a liitle text that help you find zreladdr-y needed by the U-Boot bootloader procedure to copy Linux kernel to SDRAM and launch it:&amp;lt;br /&amp;gt;&lt;br/&gt;As you could have notice from the mach-types file, the name of the variable is not MACH_CM922TXA10,&lt;br/&gt;but CONFIG_ is appended by the configuration tool, and this variable contains either a ’n’ or an&lt;br/&gt;’y’ (for no or yes boolean value). If it is selected (yes value), the name of the folder of our machine is&lt;br/&gt;appended to the machine-y variable, which contains the folders to be visited during compilation (machis&lt;br/&gt;automatically appended). make will enter in our folder, but we must tell him what it must do, then we&lt;br/&gt;create the arch/arm/mach-cm922txa10/Makefile with the content :&lt;br/&gt;#&lt;br/&gt;# Makefile for the linux kernel.&lt;br/&gt;#&lt;br/&gt;# Object file lists.&lt;br/&gt;obj-y := arch.o irq.o mm.o time.o&lt;br/&gt;obj-m :=&lt;br/&gt;obj-n :=&lt;br/&gt;obj- :=&lt;br/&gt;This Makefile is quite static since we have no configuration available at this time. Object files&lt;br/&gt;listed here are inherited from the EPXA10db machine support. In the same folder we have to put an extra&lt;br/&gt;Makefile, the Makefile.boot which only contains the physical address of the text segment (this&lt;br/&gt;gives the value of ZRELADDR, which is the physical address of TEXTADDR) :&lt;br/&gt;zreladdr-y := 0x00008000&lt;br/&gt;&lt;br/&gt;------------------------------------&lt;br/&gt;&lt;br/&gt;example:&lt;br/&gt;&lt;br/&gt;drasko@marx:~/linux-2.6/arch/arm/mach-versatile$ cat Makefile.boot&lt;br/&gt;       zreladdr-y    := 0x00008000&lt;br/&gt;params_phys-y    := 0x00000100&lt;br/&gt;   initrd_phys-y    := 0x00800000&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=3611ae71-bfeb-8f5b-8e2e-af72b4f12b78' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-8341755337793036797?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/8341755337793036797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=8341755337793036797' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/8341755337793036797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/8341755337793036797'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/05/linux-relocation-address-where-to-find.html' title='Linux relocation address - where to find it'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-2191270034622024991</id><published>2009-05-15T02:20:00.000-07:00</published><updated>2009-05-15T02:20:00.564-07:00</updated><title type='text'>Where is that god damn MD5 lib?</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Trying to link your code that uses MD5_Init(&amp;amp;ctx), MD5_Update() and MD5_Final(md5_sum, &amp;amp;ctx), but you just can not find the library that provides the function on Linux? &amp;lt;br /&amp;gt;&lt;br/&gt;Well - it is lib openssl, http://www.openssl.org/.&lt;br/&gt;&lt;br/&gt;Iclude header:  #include &amp;lt;openssl/md5.h&amp;gt;&lt;br/&gt;Link your code with:  -lssl.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;pre&gt;&lt;br/&gt;&lt;/pre&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=2de04715-2376-8208-a902-6bf1fa2b29c2' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-2191270034622024991?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/2191270034622024991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=2191270034622024991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/2191270034622024991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/2191270034622024991'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/05/where-is-that-god-damn-md5-lib.html' title='Where is that god damn MD5 lib?'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-7987192294328196430</id><published>2009-05-15T01:37:00.000-07:00</published><updated>2009-05-15T01:37:00.396-07:00</updated><title type='text'>strtoul() and friends in U-Boot</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Cannot find them? Look at the u-boot/lib_generic/vsprintf.c.&lt;br/&gt;There is definition for:&lt;span class='entry'&gt;&lt;br/&gt;unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base)&lt;br/&gt;and the others..&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=21e3911c-e04f-82d7-81c0-a7ec51c5fde0' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-7987192294328196430?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/7987192294328196430/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=7987192294328196430' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/7987192294328196430'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/7987192294328196430'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/05/strtoul-and-friends-in-u-boot.html' title='strtoul() and friends in U-Boot'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-835842323251210024</id><published>2009-05-04T02:42:00.000-07:00</published><updated>2009-05-04T02:42:00.693-07:00</updated><title type='text'>Adding a command to u-boot</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;1) Add .o file to COBJS in ./common/Makefile&lt;br/&gt;2) Add CFG_CMD_&amp;lt;MY_COMMAND&amp;gt; to CONFIG_COMMANDS macro in ./include/configs/&amp;lt;board_name&amp;gt;.h&lt;br/&gt;3) Add CFG_CMD_&amp;lt;MY_COMMAND&amp;gt; definition to ./include/cmd_confdefs.h&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=09fb8473-0073-80d9-92fc-d959f8c97019' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-835842323251210024?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/835842323251210024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=835842323251210024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/835842323251210024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/835842323251210024'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/05/adding-command-to-u-boot.html' title='Adding a command to u-boot'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-4257493600547463584</id><published>2009-03-23T10:27:00.000-07:00</published><updated>2009-03-23T10:27:00.085-07:00</updated><title type='text'>Examining your ARM asm of a compiled elf of u-boot</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Note: u-boot.bin is in bin format, not in elf. For arm-linux-objdump dissassembly use the other image, u-boot (no extension) :&lt;br/&gt;&lt;pre class='programlisting'&gt;arm-linux-objdump -DSt u-boot &amp;gt; u-boot.dis&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/pre&gt;If you see the code "mixed up", i.e. some instructions that come later in C code now perceed or come in between of some instructions in asm, that might be because optimization is switched on for gcc, and it tries to find best possible arrangement of asm instructions.&lt;br/&gt;&lt;br/&gt;For better inspection and in order that asm instructions come in the same order as the ones in the C counterpart program, find -Os optimization options in CFLAGS, and switch it off (delete it).&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=7419c0bc-fb52-4907-9f95-f5931297fcee' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-4257493600547463584?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/4257493600547463584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=4257493600547463584' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/4257493600547463584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/4257493600547463584'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/03/examining-your-arm-asm-of-compiled-elf.html' title='Examining your ARM asm of a compiled elf of u-boot'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-8370565375385018032</id><published>2009-03-21T18:47:00.000-07:00</published><updated>2009-03-21T18:48:23.347-07:00</updated><title type='text'>qemu-arm/arm-linux-gnu-gdb Remote Debugging</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;1) start QEMU:&lt;br/&gt;drasko@Marx:~/arm$ qemu-arm -L /usr/arm-linux-gnu/ -g 1234 hello&lt;br/&gt;&lt;br/&gt;2) QEMU is now started and hangs on waiting on coming connetction from the remote GDB on port 1234&lt;br/&gt;&lt;br/&gt;3) Open new terminal and start GDB:&lt;br/&gt;drasko@Marx:~/arm$ arm-linux-gnu-gdbtui&lt;br/&gt;&lt;br/&gt;4) In  GDB:(gdb) file hello&lt;br/&gt;Reading symbols from /home/drasko/arm/hello...done.&lt;br/&gt;(gdb) target remote localhost:1234&lt;br/&gt;Remote debugging using localhost:1234&lt;br/&gt;[New Thread 1]&lt;br/&gt;0x40081860 in ?? () from /usr/arm-linux-gnu/lib/ld-linux.so.2&lt;br/&gt;(gdb) b main&lt;br/&gt;Breakpoint 1 at 0x84f4: file hello.c, line 23.&lt;br/&gt;(gdb) c&lt;br/&gt;Continuing.&lt;br/&gt;&lt;br/&gt;Breakpoint 1, main () at hello.c:23&lt;br/&gt;(gdb) &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=01b77db6-da92-416f-ad0e-fc0d5f3db4c8' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-8370565375385018032?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/8370565375385018032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=8370565375385018032' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/8370565375385018032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/8370565375385018032'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/03/qemu-armarm-linux-gnu-gdb-remote.html' title='qemu-arm/arm-linux-gnu-gdb Remote Debugging'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-2180675039955046778</id><published>2009-02-22T13:45:00.000-08:00</published><updated>2009-02-22T13:46:17.353-08:00</updated><title type='text'>Trouble apt-getting gdb-arm-linux-gnu</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Package collided with already installed gdb (man pages).&lt;br/&gt;&lt;div class='syntax'&gt;&lt;div style='font-family: monospace;' class='text'&gt;&lt;ol&gt;&lt;li class='li1'&gt;&lt;div class='de1'&gt;Marx:/usr/share/man/man1# apt-get install gdb-arm-linux-gnu&lt;/div&gt;&lt;/li&gt;&lt;li class='li2'&gt;&lt;div class='de2'&gt;Reading package lists... Done&lt;/div&gt;&lt;/li&gt;&lt;li class='li1'&gt;&lt;div class='de1'&gt;Building dependency tree       &lt;/div&gt;&lt;/li&gt;&lt;li class='li2'&gt;&lt;div class='de2'&gt;Reading state information... Done&lt;/div&gt;&lt;/li&gt;&lt;li class='li1'&gt;&lt;div class='de1'&gt;Suggested packages:&lt;/div&gt;&lt;/li&gt;&lt;li class='li2'&gt;&lt;div class='de2'&gt;  gdb-doc&lt;/div&gt;&lt;/li&gt;&lt;li class='li1'&gt;&lt;div class='de1'&gt;The following NEW packages will be installed:&lt;/div&gt;&lt;/li&gt;&lt;li class='li2'&gt;&lt;div class='de2'&gt;  gdb-arm-linux-gnu&lt;/div&gt;&lt;/li&gt;&lt;li class='li1'&gt;&lt;div class='de1'&gt;0 upgraded, 1 newly installed, 0 to remove and 189 not upgraded.&lt;/div&gt;&lt;/li&gt;&lt;li class='li2'&gt;&lt;div class='de2'&gt;Need to get 0B/2348kB of archives.&lt;/div&gt;&lt;/li&gt;&lt;li class='li1'&gt;&lt;div class='de1'&gt;After this operation, 5046kB of additional disk space will be used.&lt;/div&gt;&lt;/li&gt;&lt;li class='li2'&gt;&lt;div class='de2'&gt;(Reading database ... 107197 files and directories currently installed.)&lt;/div&gt;&lt;/li&gt;&lt;li class='li1'&gt;&lt;div class='de1'&gt;Unpacking gdb-arm-linux-gnu (from .../gdb-arm-linux-gnu_6.8-3_i386.deb) ...&lt;/div&gt;&lt;/li&gt;&lt;li class='li2'&gt;&lt;div class='de2'&gt;dpkg: error processing /var/cache/apt/archives/gdb-arm-linux-gnu_6.8-3_i386.deb (--unpack):&lt;/div&gt;&lt;/li&gt;&lt;li class='li1'&gt;&lt;div class='de1'&gt; trying to overwrite `/usr/share/man/man1/gdb.1.gz', which is also in package gdb&lt;/div&gt;&lt;/li&gt;&lt;li class='li2'&gt;&lt;div class='de2'&gt;dpkg-deb: subprocess paste killed by signal (Broken pipe)&lt;/div&gt;&lt;/li&gt;&lt;li class='li1'&gt;&lt;div class='de1'&gt;Processing triggers for man-db ...&lt;/div&gt;&lt;/li&gt;&lt;li class='li2'&gt;&lt;div class='de2'&gt;Errors were encountered while processing:&lt;/div&gt;&lt;/li&gt;&lt;li class='li1'&gt;&lt;div class='de1'&gt; /var/cache/apt/archives/gdb-arm-linux-gnu_6.8-3_i386.deb&lt;/div&gt;&lt;/li&gt;&lt;li class='li2'&gt;&lt;div class='de2'&gt;E: Sub-process /usr/bin/dpkg returned an error code (1)&lt;/div&gt;&lt;/li&gt;&lt;li class='li1'&gt;&lt;div class='de1'&gt;Marx:/usr/share/man/man1#&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;Resolution:&lt;br/&gt;dpkg -i --force-overwrite /var/cache/apt/archives/gdb-arm-linux-gnu_6.8-3_i386.deb&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;div class='zemanta-pixie'&gt;&lt;img src='http://img.zemanta.com/pixy.gif?x-id=de932eca-1af6-4246-845c-79a325024fdd' class='zemanta-pixie-img'/&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-2180675039955046778?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/2180675039955046778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=2180675039955046778' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/2180675039955046778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/2180675039955046778'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/02/trouble-apt-getting-gdb-arm-linux-gnu.html' title='Trouble apt-getting gdb-arm-linux-gnu'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-7754407669810501125</id><published>2009-02-03T05:09:00.000-08:00</published><updated>2009-02-03T05:09:00.982-08:00</updated><title type='text'>Ethernet card data on Linux</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;h3 class='post-title'&gt;&lt;br /&gt;&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class='post-body'&gt;&lt;br /&gt;&lt;div class='KonaBody'&gt;&lt;br /&gt;&lt;div style='text-align: justify;'&gt;&lt;span style='font-size: 180%;'&gt;F&lt;/span&gt;or logging on to the net or for attaching as a node on a &lt;span style='font-family: courier new;'&gt;LAN&lt;/span&gt;,&lt;br /&gt;your computer needs a network card. The network card forms the&lt;br /&gt;interface between your computer and the network. There are different&lt;br /&gt;kinds of network cards available in the market depending on its speed&lt;br /&gt;and other features. Here is a tip to find out the characteristics of&lt;br /&gt;your network card.&lt;br/&gt;&lt;/div&gt;&lt;br/&gt;&lt;div style='text-align: justify;'&gt;If you want to find what type of network card is used, its speed, on which &lt;span style='font-weight: bold; font-family: courier new;'&gt;IRQ&lt;/span&gt; it is listed, and the chip type used, you use the following command :&lt;br/&gt;&lt;/div&gt;&lt;br/&gt;&lt;pre&gt;&amp;lt;code&amp;gt;# &amp;lt;span style="font-weight: bold;"&amp;gt;dmesg |grep &amp;lt;span style="color: rgb(153, 0, 0);"&amp;gt;eth0&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt; &amp;lt;div style="text-align: justify;"&amp;gt;Here &amp;lt;span style="font-weight: bold; font-family: courier new;"&amp;gt;eth0&amp;lt;/span&amp;gt; is the first network card. If you have additional cards, it will be named &amp;lt;span style="font-family: courier new;"&amp;gt;eth1&amp;lt;/span&amp;gt;, &amp;lt;span style="font-family: courier new;"&amp;gt;eth2&amp;lt;/span&amp;gt; and so on. And here is the output of the above command :&amp;lt;br /&amp;gt;&amp;lt;/div&amp;gt; &amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;divert: allocating divert_blk for eth0&amp;lt;br /&amp;gt;eth0: &amp;lt;span style="color: rgb(0, 0, 153); font-weight: bold;"&amp;gt;RealTek RTL8139&amp;lt;/span&amp;gt; at 0xd800, 00:80:48:34:c2:84, &amp;lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&amp;gt;IRQ 9&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;eth0:  Identified 8139 chip type 'RTL-8100B/8139D'&amp;lt;br /&amp;gt;divert: freeing divert_blk for eth0&amp;lt;br /&amp;gt;divert: allocating divert_blk for eth0&amp;lt;br /&amp;gt;eth0: RealTek RTL8139 at 0xd800, 00:90:44:34:a5:33, IRQ 9&amp;lt;br /&amp;gt;eth0:  Identified 8139 chip type 'RTL-8100B/8139D'&amp;lt;br /&amp;gt;eth0: &amp;lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&amp;gt;link up&amp;lt;/span&amp;gt;, &amp;lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&amp;gt;100Mbps&amp;lt;/span&amp;gt;, &amp;lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&amp;gt;full-duplex&amp;lt;/span&amp;gt;, lpa 0x41E1&amp;lt;br /&amp;gt;eth0: no IPv6 routers present&amp;lt;br /&amp;gt;...&amp;lt;br /&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;div style="text-align: justify;"&amp;gt;The important things to note here are those highlighted in colour. As you can see from the above listing, my ethernet card is a &amp;lt;span style="font-family: courier new;"&amp;gt;RealTek RTL8139&amp;lt;/span&amp;gt; chipset based card on &amp;lt;span style="font-family: courier new;"&amp;gt;IRQ 9&amp;lt;/span&amp;gt; (Interrupt Request). Its speed is &amp;lt;span style="font-family: courier new;"&amp;gt;100 Mbps&amp;lt;/span&amp;gt; and is a &amp;lt;span style="font-family: courier new;"&amp;gt;full-duplex&amp;lt;/span&amp;gt; card. And the link is up.&amp;lt;/div&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;div style="text-align: justify;"&amp;gt;As&lt;br /&gt;is the philosophy of Linux, there is more than one way of finding the&lt;br /&gt;same information. Linux also comes with a cute sounding tool called &amp;lt;span style="font-weight: bold; font-family: courier new;"&amp;gt;mii-tool&amp;lt;/span&amp;gt; which can also be used to get the same information about your network card.&amp;lt;br /&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;# &amp;lt;span style="font-weight: bold;"&amp;gt;mii-tool -v eth0&amp;lt;/span&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;eth0: &amp;lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&amp;gt;negotiated&amp;lt;/span&amp;gt; &amp;lt;span style="font-weight: bold; color: rgb(153, 0, 0);"&amp;gt;100baseTx&amp;lt;/span&amp;gt;-&amp;lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&amp;gt;FD&amp;lt;/span&amp;gt;, link ok&amp;lt;br /&amp;gt;product info: vendor 00:00:00, model 0 rev 0&amp;lt;br /&amp;gt;basic mode:   &amp;lt;span style="font-weight: bold; color: rgb(0, 0, 153);"&amp;gt;autonegotiation enabled&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;basic status: autonegotiation complete, link ok&amp;lt;br /&amp;gt;&amp;lt;span style="font-weight: bold;"&amp;gt;capabilities&amp;lt;/span&amp;gt;: 100baseTx-FD 100baseTx-HD 10baseT-FD&amp;lt;br /&amp;gt;             10baseT-HD&amp;lt;br /&amp;gt;...&amp;lt;br /&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt; &amp;lt;div style="text-align: justify;"&amp;gt;Here &amp;lt;span style="font-weight: bold; font-size: 130%;"&amp;gt;&amp;lt;span style="font-family: courier new;"&amp;gt;-v&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; is verbose mode. From the above listed output, one can see that the ethernet card is working as a &amp;lt;span style="font-family: courier new;"&amp;gt;100baseTX&amp;lt;/span&amp;gt;, &amp;lt;span style="font-family: courier new;"&amp;gt;FD&amp;lt;/span&amp;gt; (Full Duplex) card which can work in the following modes :&amp;lt;br /&amp;gt;&amp;lt;/div&amp;gt; &amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;100 Mbps  Speed (Full duplex or half duplex )  or&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;10 Mbps  speed (Full duplex or half duplex).&amp;lt;br /&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt; &amp;lt;div style="text-align: justify;"&amp;gt;And it &amp;lt;span style="font-weight: bold;"&amp;gt;uses autonegotiation to bring up the link&amp;lt;/span&amp;gt;. You can call the above device as a 10/100 NIC.&amp;lt;br /&amp;gt;&amp;lt;/div&amp;gt; &amp;lt;div style="text-align: justify;"&amp;gt;Another tool which also does the same thing is &amp;lt;span style="font-weight: bold; font-family: courier new;"&amp;gt;ethtool&amp;lt;/span&amp;gt;. Try the following command on your machine to see the output.&amp;lt;br /&amp;gt;&amp;lt;/div&amp;gt; &amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;# &amp;lt;span style="font-weight: bold;"&amp;gt;ethtool eth0&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;Settings for eth0:&amp;lt;br /&amp;gt;  Supported ports: [ TP MII ]&amp;lt;br /&amp;gt;  Supported link modes:   10baseT/Half 10baseT/Full&amp;lt;br /&amp;gt;                          100baseT/Half 100baseT/Full&amp;lt;br /&amp;gt;  Supports auto-negotiation: Yes&amp;lt;br /&amp;gt;  Advertised link modes:  10baseT/Half 10baseT/Full&amp;lt;br /&amp;gt;                          100baseT/Half 100baseT/Full&amp;lt;br /&amp;gt;  Advertised auto-negotiation: Yes&amp;lt;br /&amp;gt;  &amp;lt;span style="font-weight: bold;"&amp;gt;Speed: &amp;lt;span style="color: rgb(153, 0, 0);"&amp;gt;100Mb/s&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;  &amp;lt;span style="font-weight: bold;"&amp;gt;Duplex: &amp;lt;span style="color: rgb(0, 0, 153);"&amp;gt;Full&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;  Port: MII&amp;lt;br /&amp;gt;  PHYAD: 32&amp;lt;br /&amp;gt;  Transceiver: internal&amp;lt;br /&amp;gt;  &amp;lt;span style="font-weight: bold;"&amp;gt;Auto-negotiation: &amp;lt;span style="color: rgb(153, 0, 0);"&amp;gt;on&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;  Supports Wake-on: pumbg&amp;lt;br /&amp;gt;  Wake-on: p&amp;lt;br /&amp;gt;  Current message level: 0x00000007 (7)&amp;lt;br /&amp;gt;  Link detected: yes&amp;lt;br /&amp;gt;&amp;lt;/code&amp;gt;&lt;/pre&gt;Here full duplex, half duplex and auto-negotiation have the following meanings.&lt;br/&gt;&lt;div style='text-align: justify;'&gt;&lt;span style='font-weight: bold; color: rgb(153, 0, 0);'&gt;Full Duplex&lt;/span&gt;&lt;br /&gt;- Logic that enables concurrent sending and receiving. This is usually&lt;br /&gt;desirable and enabled when your computer is connected to a switch.&lt;br/&gt;&lt;/div&gt;&lt;br/&gt;&lt;div style='text-align: justify;'&gt;&lt;span style='font-weight: bold; color: rgb(153, 0, 0);'&gt;Half Duplex&lt;/span&gt;&lt;br /&gt;- This logic requires a card to only send or receive at a single point&lt;br /&gt;of time. When your machine is connected to a Hub, it auto-negotiates&lt;br /&gt;itself and uses half duplex to avoid collisions.&lt;br/&gt;&lt;/div&gt;&lt;br/&gt;&lt;div style='text-align: justify;'&gt;&lt;span style='font-weight: bold; color: rgb(153, 0, 0);'&gt;Auto-negotiation&lt;/span&gt;&lt;br /&gt;- This is the process of deciding whether to work in full duplex mode&lt;br /&gt;or half duplex mode. An ethernet card supporting autonegotiation will&lt;br /&gt;decide for itself which mode is the optimal one depending on the&lt;br /&gt;network it is attached to.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-7754407669810501125?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/7754407669810501125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=7754407669810501125' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/7754407669810501125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/7754407669810501125'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/02/ethernet-card-data-on-linux.html' title='Ethernet card data on Linux'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-4067518475915753584</id><published>2009-01-31T16:11:00.000-08:00</published><updated>2009-01-31T16:12:18.407-08:00</updated><title type='text'>How To Install Microsoft Internet Explorer on Linux</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Fom here: http://www.tatanka.com.br/ies4linux/page/Main_Page&lt;br/&gt;and here: http://www.cyberciti.biz/tips/how-to-install-internet-explorer-on-linux.html&lt;br/&gt;&lt;br/&gt;&lt;code&gt;$ wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz&lt;br/&gt;&lt;br /&gt;$ tar -zxvf ies4linux-latest.tar.gz&lt;br/&gt;&lt;br /&gt;$ cd ies4linux-*&lt;br/&gt;&lt;br /&gt;$ ./ies4linux&lt;br/&gt;&lt;br/&gt;&lt;/code&gt;Just follow on screen installations. Once installed type the following command to start IE6:&lt;br/&gt;&lt;br /&gt;&lt;code&gt;$ ~/bin/ie6&lt;br/&gt;&lt;br/&gt;&lt;/code&gt;&lt;code&gt;&lt;br/&gt;&lt;/code&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-4067518475915753584?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/4067518475915753584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=4067518475915753584' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/4067518475915753584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/4067518475915753584'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/01/how-to-install-microsoft-internet.html' title='How To Install Microsoft Internet Explorer on Linux'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-4421709355265847742</id><published>2009-01-26T08:25:00.000-08:00</published><updated>2009-01-31T16:12:39.353-08:00</updated><title type='text'>Using grep --exclude</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;br/&gt;grep -Ir --exclude="*\.svn*" &lt;pattern&gt; &amp;lt;pattern&amp;gt; .&lt;br/&gt;&lt;/pattern&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-4421709355265847742?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/4421709355265847742/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=4421709355265847742' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/4421709355265847742'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/4421709355265847742'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/01/using-grep-exclude.html' title='Using grep --exclude'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-862042441466698268</id><published>2009-01-23T09:11:00.000-08:00</published><updated>2009-01-23T09:11:00.481-08:00</updated><title type='text'>How to extract RPM or DEB packages</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;From: http://www.g-loaded.eu/2008/01/28/how-to-extract-rpm-or-deb-packages/&lt;br/&gt;&lt;br/&gt;RPM and DEB packages are both containers for other files. An RPM is some sort of &lt;strong&gt;cpio&lt;/strong&gt; archive. On the other hand, a DEB file is a pure &lt;strong&gt;ar&lt;/strong&gt;&lt;br /&gt;archive. So, it should be possible to unpack their contents using&lt;br /&gt;standard archiving tools, regardless of your distribution’s package&lt;br /&gt;format. Under normal conditions, you should use your distribution’s&lt;br /&gt;standard package manager, &lt;strong&gt;rpm&lt;/strong&gt; or &lt;strong&gt;dpkg&lt;/strong&gt; and their frontends, to manage those files. But, if you need to be more generic, here is how to do it.&lt;br/&gt;&lt;br /&gt;&lt;span id='more-482'/&gt;&lt;br /&gt;&lt;h4&gt;RPM&lt;/h4&gt;&lt;br /&gt;&lt;p&gt;For RPMs you need two command line utilities, &lt;strong&gt;rpm2cpio&lt;/strong&gt; and &lt;strong&gt;cpio&lt;/strong&gt;. Extracting the contents of the RPM package is an &lt;em&gt;one-step&lt;/em&gt; process:&lt;/p&gt;&lt;br /&gt;&lt;pre class='console'&gt;rpm2cpio mypackage.rpm | cpio -vid&amp;lt;/pre&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;If you just need to list the contents of the package without extracting them, use the following:&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;pre class="console"&amp;gt;rpm2cpio mypackage.rpm | cpio -vt&amp;lt;/pre&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;The &amp;lt;strong&amp;gt;-v&amp;lt;/strong&amp;gt; option is used in order to get verbose&lt;br /&gt;output to the stdout. If you don’t need it, you can safely omit this&lt;br /&gt;switch. For more information about the &amp;lt;code&amp;gt;cpio&amp;lt;/code&amp;gt; options, please refer to the &amp;lt;code&amp;gt;cpio(1)&amp;lt;/code&amp;gt; manual page.&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;h4&amp;gt;DEB&amp;lt;/h4&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;DEB files are &amp;lt;em&amp;gt;ar archives&amp;lt;/em&amp;gt;, which contain three files:&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;debian-binary&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;control.tar.gz&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;data.tar.gz&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;As you might have already guessed, the needed archived files exist in &amp;lt;code&amp;gt;data.tar.gz&amp;lt;/code&amp;gt;. It is also obvious that unpacking this file is a &amp;lt;em&amp;gt;two-step&amp;lt;/em&amp;gt; process.&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;First, extract the aforementioned three files from the DEB file (&amp;lt;strong&amp;gt;ar&amp;lt;/strong&amp;gt; archive):&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;pre class="console"&amp;gt;ar vx mypackage.deb&amp;lt;/pre&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;Then extract the contents of &amp;lt;code&amp;gt;data.tar.gz&amp;lt;/code&amp;gt; using &amp;lt;strong&amp;gt;tar&amp;lt;/strong&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;pre class="console"&amp;gt;tar -xzvf data.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;Or, if you just need to get a &amp;lt;em&amp;gt;listing&amp;lt;/em&amp;gt; of the files:&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;pre class="console"&amp;gt;tar -tzvf data.tar.gz&lt;/pre&gt;&lt;br /&gt;&lt;p&gt;Again the &lt;strong&gt;-v&lt;/strong&gt; option in both &lt;strong&gt;ar&lt;/strong&gt; and &lt;strong&gt;tar&lt;/strong&gt; is used in order to get verbose output. It is safe not to use it. For more information, read the man pages: &lt;code&gt;tar(1)&lt;/code&gt; and &lt;code&gt;ar(1)&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-862042441466698268?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/862042441466698268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=862042441466698268' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/862042441466698268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/862042441466698268'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/01/how-to-extract-rpm-or-deb-packages.html' title='How to extract RPM or DEB packages'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-2544611567599712569</id><published>2009-01-22T13:53:00.001-08:00</published><updated>2009-01-23T08:08:59.627-08:00</updated><title type='text'>ARM Development Boards and JTAG</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;BOARDS&lt;br/&gt;http://www.developmentboard.net/&lt;br/&gt;http://www.mikroe.com/en/tools/easyarm/&lt;br/&gt;http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3784&lt;br/&gt;http://www.olimex.com/dev/index.html&lt;br/&gt;https://www.kwikbyte.com/store/home.php?cat=249&lt;br/&gt;http://www.hitex.com/index.php?id=235&lt;br/&gt;http://www.openmoko.com/&lt;br/&gt;&lt;br/&gt;JTAG&lt;br/&gt;http://www.amontec.com/eshop/cmd.php&lt;br/&gt;http://www.amontec.com/jtagkey-tiny.shtml&lt;br/&gt;http://www.olimex.com/dev/index.html&lt;br/&gt;http://www.macraigor.com&lt;br/&gt;http://openocd.berlios.de/web/&lt;br/&gt;&lt;br/&gt;Windoze Toolchains&lt;br/&gt;http://www.amontec.com/sdk4arm.shtml&lt;br/&gt;http://www.gnuarm.com/&lt;br/&gt;http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/#winarm&lt;br/&gt;http://www.yagarto.de/index.html&lt;br/&gt;&lt;br/&gt;OMAP Boards&lt;br/&gt;http://beagleboard.org/&lt;br/&gt;http://gumstix.com/&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-2544611567599712569?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/2544611567599712569/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=2544611567599712569' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/2544611567599712569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/2544611567599712569'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/01/arm-development-boards-and-jtag.html' title='ARM Development Boards and JTAG'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-3276582599998276831</id><published>2009-01-22T12:43:00.001-08:00</published><updated>2009-01-22T12:48:33.492-08:00</updated><title type='text'>Setting up Debian WiFi driver on DELL Inspiron 1525</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;To find out WiFi interface:&lt;br/&gt;Marx:/home/drasko# lspci&lt;br/&gt;00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 0c)&lt;br/&gt;00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c)&lt;br/&gt;00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 0c)&lt;br/&gt;00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 02)&lt;br/&gt;00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 02)&lt;br/&gt;00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 02)&lt;br/&gt;00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02)&lt;br/&gt;00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 02)&lt;br/&gt;00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 02)&lt;br/&gt;00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 02)&lt;br/&gt;00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 02)&lt;br/&gt;00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 02)&lt;br/&gt;00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 02)&lt;br/&gt;00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 02)&lt;br/&gt;00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f2)&lt;br/&gt;00:1f.0 ISA bridge: Intel Corporation 82801HEM (ICH8M) LPC Interface Controller (rev 02)&lt;br/&gt;00:1f.1 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 02)&lt;br/&gt;00:1f.2 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 02)&lt;br/&gt;00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 02)&lt;br/&gt;02:09.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller (rev 05)&lt;br/&gt;02:09.1 SD Host controller: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22)&lt;br/&gt;02:09.2 System peripheral: Ricoh Co Ltd R5C843 MMC Host Controller (rev 12)&lt;br/&gt;02:09.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 12)&lt;br/&gt;02:09.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev ff)&lt;br/&gt;09:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8040 PCI-E Fast Ethernet Controller (rev 12)&lt;br/&gt;&lt;b&gt;0b:00.0 Network controller: Broadcom Corporation BCM4312 802.11b/g (rev 01)&lt;/b&gt;&lt;br/&gt;Marx:/home/drasko# &lt;br/&gt;&lt;br/&gt;OK, we need drivers for &lt;b&gt;Broadcom BCM4312&lt;/b&gt;.&lt;br/&gt;&lt;br/&gt;So I tried:&lt;br/&gt;&lt;br/&gt;Marx:/home/drasko# apt-cache search broadcom&lt;br/&gt;b43-fwcutter - Utility for extracting Broadcom 43xx firmware&lt;br/&gt;bcm5700-source - module source for Broadcom's bcm5700 ethernet driver&lt;br/&gt;bluez-firmware - Firmware for Bluetooth devices&lt;br/&gt;firmware-bnx2 - Binary firmware for Broadcom NetXtremeII&lt;br/&gt;Marx:/home/drasko# &lt;br/&gt;&lt;br/&gt;b43-fwcutter package seemed promising, so I checked out http://wireless.kernel.org/en/users/Drivers/b43&lt;br/&gt;&lt;br/&gt;Unfortunately, on this site is noted:&lt;br/&gt;&lt;br/&gt;&lt;h1 id='supported'&gt;&lt;small&gt;&lt;small&gt;supported&lt;/small&gt;&lt;/small&gt;&lt;/h1&gt;&lt;br/&gt;&lt;span class='anchor' id='line-15'&gt;&lt;ul&gt;&lt;li&gt;bcm4303 (802.11b-only chips, uses b43legacy) &lt;span class='anchor' id='line-16'&gt;&lt;span class='anchor' id='line-17'/&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class='gap'&gt;bcm4306 (Rev. 2 uses b43legacy, Rev. 3 uses b43) &lt;span class='anchor' id='line-18'&gt;&lt;span class='anchor' id='line-19'/&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class='gap'&gt;bcm4309 (only the 2.4GHz part) &lt;span class='anchor' id='line-20'&gt;&lt;span class='anchor' id='line-21'/&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class='gap'&gt;bcm4311 rev 1 / bcm4312 &lt;span class='anchor' id='line-22'&gt;&lt;span class='anchor' id='line-23'/&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class='gap'&gt;bcm4311 rev 2 / bcm4312 (needs patches for 2.6.24) &lt;span class='anchor' id='line-24'&gt;&lt;span class='anchor' id='line-25'/&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class='gap'&gt;bcm4312 (only the 2.4GHz part) &lt;span class='anchor' id='line-26'&gt;&lt;span class='anchor' id='line-27'/&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class='gap'&gt;bcm4318 &lt;span class='anchor' id='line-28'&gt;&lt;span class='anchor' id='line-29'/&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class='line867'&gt;&lt;br/&gt;&lt;/p&gt;&lt;h1 id='unsupported'&gt;&lt;small&gt;&lt;small&gt;unsupported&lt;/small&gt;&lt;/small&gt;&lt;/h1&gt;&lt;br/&gt;&lt;span class='anchor' id='line-30'&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;The 802.11a part of the 4309 and 4312 is not supported. &lt;/b&gt;&lt;span class='anchor' id='line-31'&gt;&lt;span class='anchor' id='line-32'/&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class='gap'&gt;BCM&lt;br/&gt;4310 USB - This device has an LP PHY. We think that means low power. In&lt;br/&gt;any case, previous code does not work. The reverse engineers have&lt;br/&gt;translated a great deal of the code and are currently generating specs&lt;br/&gt;for the code writers. Note: This card uses the PCI bus, despite its&lt;br/&gt;name. &lt;span class='anchor' id='line-33'&gt;&lt;span class='anchor' id='line-34'/&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class='gap'&gt;BCM&lt;br/&gt;4322 802.11a/b/g/n (Has PCI-ID 0x432B) - This device has an N Phy.&lt;br/&gt;There is no support for any Draft 802.11n features. We are working on&lt;br/&gt;it. &lt;span class='anchor' id='line-35'&gt;&lt;span class='anchor' id='line-36'/&gt;&lt;/span&gt;&lt;/li&gt;&lt;li class='gap'&gt;BCM&lt;br/&gt;4321 (Has PCI-IDs 0x4328 and 0x4329) - These devices have N Phys. There&lt;br/&gt;is no support for any Draft 802.11n features. We are working on it. &lt;/li&gt;&lt;/ul&gt;Now what?&lt;br/&gt;&lt;br/&gt;Googleing led me to here: http://jomcode.com/fadhil/?p=59&lt;br/&gt;&lt;br/&gt;Official drivers can be found here: http://www.broadcom.com/support/802.11/linux_sta.php&lt;br/&gt;&lt;br/&gt;Build it as writtend in README that comes with a driver (it is a kernel module that have to be modprobed).&lt;br/&gt;&lt;br/&gt;My /etc/network/interfaces:&lt;br/&gt;&lt;br/&gt;# This file describes the network interfaces available on your system&lt;br/&gt;# and how to activate them. For more information, see interfaces(5).&lt;br/&gt;&lt;br/&gt;# The loopback network interface&lt;br/&gt;auto lo&lt;br/&gt;iface lo inet loopback&lt;br/&gt;&lt;br/&gt;# The primary network interface&lt;br/&gt;allow-hotplug eth0&lt;br/&gt;iface eth0 inet dhcp&lt;br/&gt;&lt;br/&gt;# Wireless network interface&lt;br/&gt;#auto eth1&lt;br/&gt;allow-hotplug eth1&lt;br/&gt;iface eth1 inet dhcp&lt;br/&gt;   wireless-essid Adael-Gratuit&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Usefull commands:&lt;br/&gt;&lt;/span&gt;&lt;/span&gt;&lt;pre&gt;# aptitude install wireless-tools&amp;lt;br /&amp;gt;# iwconfig&amp;lt;br /&amp;gt;# iwlist &amp;lt;span id="line-15" class="anchor"&amp;gt;&amp;lt;span id="line-30" class="anchor"&amp;gt;eth1&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt; scan&amp;lt;br /&amp;gt;# iwconfig eth1 essid &amp;lt;span id="line-15" class="anchor"&amp;gt;&amp;lt;span id="line-30" class="anchor"&amp;gt;Adael-Gratuit&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;etc...&amp;lt;br /&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;/pre&gt;&lt;br/&gt;&lt;span class='anchor' id='line-15'&gt;&lt;span class='anchor' id='line-30'&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-3276582599998276831?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/3276582599998276831/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=3276582599998276831' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/3276582599998276831'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/3276582599998276831'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2009/01/setting-up-debian-wifi-driver-on-dell.html' title='Setting up Debian WiFi driver on DELL Inspiron 1525'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-548133996939254056</id><published>2008-12-16T08:59:00.000-08:00</published><updated>2009-01-06T06:56:16.898-08:00</updated><title type='text'>Suppressing annoying find / -name "something" error messages like "find: `/proc/1/fd': Permission denied"</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Have you ever tried looking for some file like this:&lt;br /&gt;&lt;br /&gt;&lt;small&gt;&lt;span style="font-family:Courier New;"&gt;drasko@kanta:~$ find / -name "some_file.c"&lt;br /&gt;find: `/.mozilla': Permission denied&lt;br /&gt;find: `/proc/tty/driver': Permission denied&lt;br /&gt;find: `/proc/1/task/1/fd': Permission denied&lt;br /&gt;find: `/proc/1/task/1/fdinfo': Permission denied&lt;br /&gt;find: `/proc/1/fd': Permission denied&lt;br /&gt;find: `/proc/1/fdinfo': Permission denied&lt;br /&gt;find: `/proc/2/task/2/fd': Permission denied&lt;br /&gt;find: `/proc/2/task/2/fdinfo': Permission denied&lt;br /&gt;find: `/proc/2/fd': Permission denied&lt;br /&gt;find: `/proc/2/fdinfo': Permission denied&lt;br /&gt;find: `/proc/3/task/3/fd': Permission denied&lt;br /&gt;find: `/proc/3/task/3/fdinfo': Permission denied&lt;br /&gt;find: `/proc/3/fd': Permission denied&lt;/span&gt;&lt;/small&gt;&lt;br /&gt;and many lines like this...&lt;br /&gt;&lt;br /&gt;Eventually, you loose yourself in this and do not see the eventual hit. You do not see the tree because of the forest.&lt;br /&gt;&lt;br /&gt;Now, you will not get out easily just by piping this to grep, like:&lt;br /&gt;drasko@kanta:~$ find / -name "some_file.c" | grep some_file.c&lt;br /&gt;because these "Permission denied" lines do not go to the stdout but to stderr, so they will be displayed anyway.&lt;br /&gt;&lt;br /&gt;Solution is to redirect &lt;small&gt;&lt;span style="font-family:Courier New;"&gt;stderr&lt;/span&gt;&lt;/small&gt; out of &lt;small&gt;&lt;span style="font-family:Courier New;"&gt;find&lt;/span&gt;&lt;/small&gt; to &lt;small&gt;&lt;span style="font-family:Courier New;"&gt;/dev/null&lt;/span&gt;&lt;/small&gt;:&lt;br /&gt;&lt;small&gt;&lt;span style="font-family:Courier New;"&gt;&lt;br /&gt;drasko@kanta:~$ find / -name "some_file.c" 2&amp;gt; /dev/null&lt;br /&gt;/home/drasko/some_file.c&lt;br /&gt;drasko@kanta:~$ &lt;/span&gt;&lt;/small&gt;&lt;br /&gt;&lt;br /&gt;Here you go.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-548133996939254056?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/548133996939254056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=548133996939254056' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/548133996939254056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/548133996939254056'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2008/12/suppreassing-annoying-find-name.html' title='Suppressing annoying find / -name &amp;quot;something&amp;quot; error messages like &amp;quot;find: `/proc/1/fd&amp;#39;: Permission denied&amp;quot;'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-7545994794831310476</id><published>2008-12-12T05:09:00.000-08:00</published><updated>2008-12-12T05:10:30.152-08:00</updated><title type='text'>ASM_CMT macro for creating comments in asm produced from C</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;br/&gt;C code:&lt;br/&gt;&lt;br/&gt;//! Assembly comment&lt;br/&gt;#define ASM_CMT(str) asm volatile("@ " str)&lt;br/&gt;&lt;br/&gt;int main()&lt;br/&gt;{&lt;br/&gt;   int i = 5;&lt;br/&gt;   int j = 0;&lt;br/&gt;&lt;br/&gt;   ASM_CMT("This is a comment!");&lt;br/&gt;&lt;br/&gt;   for (i=0; i&amp;lt;10; i++)&lt;br/&gt;      j = i + 1;&lt;br/&gt;&lt;br/&gt;   ASM_CMT("This is another comment");&lt;br/&gt;&lt;br/&gt;   return 0;&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Produced asm:&lt;br/&gt;&lt;br/&gt;.file    "asm_cmt.c"&lt;br/&gt;    .text&lt;br/&gt;    .align    2&lt;br/&gt;    .global    main&lt;br/&gt;    .type    main, %function&lt;br/&gt;main:&lt;br/&gt;    @ args = 0, pretend = 0, frame = 8&lt;br/&gt;    @ frame_needed = 1, uses_anonymous_args = 0&lt;br/&gt;    mov    ip, sp&lt;br/&gt;    stmfd    sp!, {fp, ip, lr, pc}&lt;br/&gt;    sub    fp, ip, #4&lt;br/&gt;    sub    sp, sp, #8&lt;br/&gt;    mov    r3, #5&lt;br/&gt;    str    r3, [fp, #-20]&lt;br/&gt;    mov    r3, #0&lt;br/&gt;    str    r3, [fp, #-16]&lt;br/&gt;#APP&lt;br/&gt;    @ This is a comment!&lt;br/&gt;    mov    r3, #0&lt;br/&gt;    str    r3, [fp, #-20]&lt;br/&gt;    b    .L2&lt;br/&gt;.L3:&lt;br/&gt;    ldr    r3, [fp, #-20]&lt;br/&gt;    add    r3, r3, #1&lt;br/&gt;    str    r3, [fp, #-16]&lt;br/&gt;    ldr    r3, [fp, #-20]&lt;br/&gt;    add    r3, r3, #1&lt;br/&gt;    str    r3, [fp, #-20]&lt;br/&gt;.L2:&lt;br/&gt;    ldr    r3, [fp, #-20]&lt;br/&gt;    cmp    r3, #9&lt;br/&gt;    ble    .L3&lt;br/&gt;#APP&lt;br/&gt;    @ This is another comment&lt;br/&gt;    mov    r3, #0&lt;br/&gt;    mov    r0, r3&lt;br/&gt;    sub    sp, fp, #12&lt;br/&gt;    ldmfd    sp, {fp, sp, pc}&lt;br/&gt;    .size    main, .-main&lt;br/&gt;    .ident    "GCC: (GNU) 4.2.4"&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-7545994794831310476?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/7545994794831310476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=7545994794831310476' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/7545994794831310476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/7545994794831310476'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2008/12/asmcmt-macro-for-creating-comments-in.html' title='ASM_CMT macro for creating comments in asm produced from C'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-8871822559402566038</id><published>2008-12-12T04:38:00.000-08:00</published><updated>2008-12-12T04:42:29.324-08:00</updated><title type='text'>gcc differences between .s and .S assembly file name suffix</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;br/&gt;Although the assembler can be invoked directly, assembly files are more typically passed through gcc. The case of the assembly&lt;br/&gt;file’s suffix (.s versus .S) is important. If gcc is invoked with an uppercase assembly file suffix (.S) it is passed first to the&lt;br/&gt;preprocessor whereas a lowercase file suffix (.s) passes goes directly to the assembler.&lt;br/&gt;&lt;br/&gt;---&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Please note that GCC treats files with the suffixes ".s" and ".S"&lt;br/&gt;differently: the preprocessor is run on files with the ".S" (capital s)&lt;br/&gt;suffix, not on the ones with the ".s" suffix.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;---&lt;br/&gt;&lt;br/&gt;&lt;dl&gt;&lt;dt&gt;&lt;var&gt;file&lt;/var&gt;&lt;code&gt;.s&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;&lt;br /&gt;Assembler code.  Apple's version of GCC runs the preprocessor&lt;br /&gt;on these files as well as those ending in `&lt;samp&gt;&lt;span class='samp'&gt;.S&lt;/span&gt;&lt;/samp&gt;'. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;     &lt;br/&gt;&lt;/dd&gt;&lt;dt&gt;&lt;var&gt;file&lt;/var&gt;&lt;code&gt;.S&lt;/code&gt;&lt;/dt&gt;&lt;dd&gt;Assembler code which must be preprocessed.&lt;br /&gt;&lt;br /&gt;     &lt;/dd&gt;&lt;dt&gt;&lt;br/&gt;&lt;/dt&gt;&lt;/dl&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-8871822559402566038?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/8871822559402566038/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=8871822559402566038' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/8871822559402566038'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/8871822559402566038'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2008/12/gcc-differences-between-s-and-s.html' title='gcc differences between .s and .S assembly file name suffix'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-9018080600790754332</id><published>2008-12-12T02:29:00.000-08:00</published><updated>2008-12-12T02:30:19.426-08:00</updated><title type='text'>About gdb target sim</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Some mail from some mailing list:&lt;br/&gt;&lt;p style='margin-bottom: 0in;'&gt;I've built crossgcc for target&lt;br /&gt;arm-linux and gdb for target arm-elf. (couldn't match the two targets&lt;br /&gt;for some reasons but i thought it wouldn't matter. I couldn't find&lt;br /&gt;any difference between them. Is there any difference?) &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;I tried a simple example for debugging&lt;br /&gt;with gdb target as simulator and gdb ignores the breakpoints as&lt;br /&gt;follows. I'll appreciate any kind of advice. Thanks in advance. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;$ arm-linux-gcc -g foo.c -o foo &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;$ arm-elf-gdb &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;GNU gdb 4.18 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Copyright 1998 Free Software&lt;br /&gt;Foundation, Inc. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;GDB is free software, covered by the&lt;br /&gt;GNU General Public License, and you are &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;welcome to change it and/or distribute&lt;br /&gt;copies of it under certain conditions. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Type "show copying" to see&lt;br /&gt;the conditions. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;There is absolutely no warranty for&lt;br /&gt;GDB. Type "show warranty" for details. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;This GDB was configured as&lt;br /&gt;"--host=i686-pc-linux-gnu --target=arm-elf". &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;(gdb) file foo &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Reading symbols from foo...done. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;(gdb) target sim &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Connected to the simulator. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;(gdb) load foo &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .interp, size 0x27 vma&lt;br /&gt;0x20000f4 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .note.ABI-tag, size&lt;br /&gt;0x20 vma 0x2000120 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .hash, size 0x24 vma&lt;br /&gt;0x2000140 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .dynsym, size 0x40 vma&lt;br /&gt;0x2000164 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .dynstr, size 0x3c vma&lt;br /&gt;0x20001a4 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .gnu.version, size 0x8&lt;br /&gt;vma 0x20001e0 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .gnu.version_r, size&lt;br /&gt;0x20 vma 0x20001e8 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .rel.plt, size 0x10 vma&lt;br /&gt;0x2000208 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .init, size 0x18 vma&lt;br /&gt;0x2000218 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .plt, size 0x30 vma&lt;br /&gt;0x2000230 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .text, size 0x350 vma&lt;br /&gt;0x2000260 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .fini, size 0x14 vma&lt;br /&gt;0x20005b0 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .rodata, size 0x4 vma&lt;br /&gt;0x20005c4 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .data, size 0xc vma&lt;br /&gt;0x20085c8 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .ctors, size 0x8 vma&lt;br /&gt;0x20085d4 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .dtors, size 0x8 vma&lt;br /&gt;0x20085dc &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .got, size 0x14 vma&lt;br /&gt;0x20085e4 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Loading section .dynamic, size 0x88 vma&lt;br /&gt;0x20085f8 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Start address 0x2000260 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Transfer rate: 11320 bits in &amp;lt;1 sec.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;(gdb) list main &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;1 int main() &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;2 { &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;3 int a=27; &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;4 int b=4; &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;5 int c; &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;6 c=a*b; &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;(gdb) &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;7 c=a%b; &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;8 c=a/b; &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;9 } &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;(gdb) br 7 &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Breakpoint 1 at 0x200036c: file foo.c,&lt;br /&gt;line 7. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;(gdb) run &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Starting program:&lt;br /&gt;/home/totohero/test/foo &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;Program exited with code 074. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p style='margin-bottom: 0in;'&gt;(gdb) quit&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br/&gt;&lt;br/&gt;From gdb manual:&lt;/p&gt;&lt;br /&gt;&lt;h3&gt;&lt;a target='_blank' name='11e2abb492a87c6d_SEC137' href='http://www.sunsite.ualberta.ca/Documentation/Gnu/gdb-4.18/html_node/gdb_toc.html#TOC137'&gt;13.4.10&lt;br /&gt;Simulated CPU target&lt;/a&gt;&lt;/h3&gt;&lt;br /&gt;&lt;p&gt;&lt;a name='11e2abb492a87c6d_IDX638'/&gt;&lt;a name='11e2abb492a87c6d_IDX639'/&gt;&lt;a name='11e2abb492a87c6d_IDX640'/&gt;&lt;a name='11e2abb492a87c6d_IDX641'/&gt;&lt;a name='11e2abb492a87c6d_IDX642'/&gt;&lt;a name='11e2abb492a87c6d_IDX643'/&gt;&lt;a name='11e2abb492a87c6d_IDX644'/&gt;&lt;a name='11e2abb492a87c6d_IDX645'/&gt;&lt;br /&gt;For some configurations, GDB includes a CPU simulator that you can&lt;br /&gt;use instead of a hardware CPU to debug your programs. Currently,&lt;br /&gt;simulators are available for ARM, D10V, D30V, FR30, H8/300, H8/500,&lt;br /&gt;i960, M32R, MIPS, MN10200, MN10300, PowerPC, SH, Sparc, V850, W65,&lt;br /&gt;and Z8000. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;For the Z8000 family, &lt;samp&gt;`target sim'&lt;/samp&gt; simulates either&lt;br /&gt;the Z8002 (the unsegmented variant of the Z8000 architecture) or the&lt;br /&gt;Z8001 (the segmented variant). The simulator recognizes which&lt;br /&gt;architecture is appropriate by inspecting the object code. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;dl&gt;&lt;dt&gt;&lt;code&gt;target sim &lt;/code&gt;&lt;var&gt;args&lt;/var&gt; &lt;br /&gt;	&lt;/dt&gt;&lt;dd style='margin-bottom: 0.2in;'&gt;&lt;br /&gt;	&lt;a name='11e2abb492a87c6d_IDX646'/&gt;&lt;a name='11e2abb492a87c6d_IDX647'/&gt;Debug programs on a&lt;br /&gt;	simulated CPU. If the simulator supports setup options, specify them&lt;br /&gt;	via &lt;var&gt;args&lt;/var&gt;. &lt;br /&gt;	&lt;/dd&gt;&lt;/dl&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;After specifying this target, you can debug programs for the&lt;br /&gt;simulated CPU in the same style as programs for your host computer;&lt;br /&gt;use the &lt;code&gt;file&lt;/code&gt; command to load a new program image, the&lt;br /&gt;&lt;code&gt;run&lt;/code&gt; command to run your program, and so on. &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;As well as making available all the usual machine registers (see&lt;br /&gt;&lt;code&gt;info reg&lt;/code&gt;), the Z8000 simulator provides three additional&lt;br /&gt;items of information as specially named registers: &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;dl&gt;&lt;dt&gt;&lt;code&gt;cycles&lt;/code&gt; &lt;br /&gt;	&lt;/dt&gt;&lt;dd&gt;&lt;br /&gt;	Counts clock-ticks in the simulator. &lt;br /&gt;	&lt;/dd&gt;&lt;dt&gt;&lt;br /&gt;	&lt;code&gt;insts&lt;/code&gt; &lt;br /&gt;	&lt;/dt&gt;&lt;dd&gt;&lt;br /&gt;	Counts instructions run in the simulator. &lt;br /&gt;	&lt;/dd&gt;&lt;dt&gt;&lt;br /&gt;	&lt;code&gt;time&lt;/code&gt; &lt;br /&gt;	&lt;/dt&gt;&lt;dd style='margin-bottom: 0.2in;'&gt;&lt;br /&gt;	Execution time in 60ths of a second. &lt;br /&gt;	&lt;/dd&gt;&lt;/dl&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;You can refer to these values in GDB expressions with the usual&lt;br /&gt;conventions; for example, &lt;samp&gt;`b fputc if $cycles&amp;gt;5000'&lt;/samp&gt;&lt;br /&gt;sets a conditional breakpoint that suspends only after at least 5000&lt;br /&gt;simulated clock ticks. &lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-9018080600790754332?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/9018080600790754332/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=9018080600790754332' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/9018080600790754332'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/9018080600790754332'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2008/12/about-gdb-target-sim.html' title='About gdb target sim'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-756203623876535513</id><published>2008-11-22T06:44:00.000-08:00</published><updated>2008-11-22T06:49:51.234-08:00</updated><title type='text'>Getting a nice penguin during boot (in qemu)</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;This is about enabling support in the kernal for nicer boot up screen.&lt;br/&gt;&lt;br/&gt;Recompile kernel with following enabled in menuconfig:&lt;br/&gt;Device Drivers -&amp;gt; Graphics support -&amp;gt; Framebuffer devices, and bellow will appear Bootup Logo - so, select it and recompile.&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-756203623876535513?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/756203623876535513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=756203623876535513' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/756203623876535513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/756203623876535513'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2008/11/getting-nice-penguin-during-boot-in.html' title='Getting a nice penguin during boot (in qemu)'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-1793075727627910389</id><published>2008-11-22T06:25:00.000-08:00</published><updated>2008-11-22T06:49:19.295-08:00</updated><title type='text'>Checking qemu init</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Here is a little tip I found on Busybox FAQ:&lt;br/&gt;&lt;br/&gt;-----------&lt;br/&gt;&lt;h2&gt;&lt;small&gt;&lt;a name='init'&gt;Busybox init isn't working!&lt;/a&gt;&lt;/small&gt;&lt;/h2&gt;&lt;p&gt;    Init is the first program that runs, so it might be that no programs are&lt;br/&gt;    working on your new system because of a problem with your cross-compiler,&lt;br/&gt;    kernel, console settings, shared libraries, root filesystem...  To rule all&lt;br/&gt;    that out, first build a statically linked version of the following "hello&lt;br/&gt;    world" program with your cross compiler toolchain:&lt;/p&gt;&lt;p&gt;#include &amp;lt;stdio.h&amp;gt;&lt;br/&gt;&lt;br/&gt;int main(int argc, char *argv)&lt;br/&gt;{&lt;br/&gt;  printf("Hello world!\n");&lt;br/&gt;  sleep(999999999);&lt;br/&gt;}&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;    Now try to boot your device with an "init=" argument pointing to your&lt;br/&gt;    hello world program.  Did you see the hello world message?  Until you&lt;br/&gt;    do, don't bother messing with busybox init.&lt;br/&gt;&lt;/p&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;&lt;br/&gt;    Once you've got it working statically linked, try getting it to work&lt;br/&gt;    dynamically linked.  Then read the FAQ entry &lt;a href='http://www.busybox.net/FAQ.html#build_system'&gt;How&lt;br/&gt;    do I build a BusyBox-based system?&lt;/a&gt;, and the&lt;br/&gt;    &lt;a href='http://www.busybox.net/downloads/BusyBox.html#item_init'&gt;documentation for BusyBox&lt;br/&gt;    init&lt;/a&gt;.&lt;br/&gt;&lt;/p&gt;----------&lt;br/&gt;&lt;br/&gt;I compiled it and placed it on the /hello_world in my newly filesystem image, rootfs.img, prepared for qemu (this position on fs is not so important, as long as you pass correct path to qemu):&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;qemu -hda rootfs.img -kernel bzImage -append "root=/dev/hda init=hello_world"&lt;br/&gt;&lt;br/&gt;or &lt;br/&gt;&lt;br/&gt;qemu -hda rootfs.img -kernel bzImage -append "root=/dev/hda init=/hello_world"&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;in my case would be the same thing, and it did the job. That way we can observe that root fs was correctly mounted, that init was called and executed correctly, and boot will here stuck because of sleep() call in hello_world.c&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-1793075727627910389?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/1793075727627910389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=1793075727627910389' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/1793075727627910389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/1793075727627910389'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2008/11/checking-qemu-init.html' title='Checking qemu init'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-466269068672170301</id><published>2008-11-22T06:12:00.000-08:00</published><updated>2008-11-22T11:05:00.296-08:00</updated><title type='text'>Capturing output of qemu</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;In order to capture output of qemu, it is needed to issue command like this:&lt;br/&gt;&lt;br/&gt;qemu -hda rootfs.img -kernel bzImage -append "root=/dev/hda console=ttyS0" -serial stdio&lt;br/&gt;&lt;br/&gt;This way boot messages will be redirected to host vga console, and can be  copy/pasted fot googleing and debugging.&lt;br/&gt;&lt;br/&gt;For thia to work, virtual console in kernel must be enebled (which by default is the case). Look under device drivers -&amp;gt; charcter devices -&amp;gt; virtual terminal, or grep .config for CONSOLE.&lt;br/&gt;&lt;br/&gt;One more note, from Remote Serial Console HOWTO:&lt;br/&gt;&lt;br/&gt;----------------------------&lt;br/&gt;&lt;p&gt;The &lt;span class='SYSTEMITEM'&gt;Linux&lt;/span&gt; kernel is&lt;br/&gt;  configured to select the console by passing it the&lt;br/&gt;  &lt;tt class='LITERAL'&gt;console&lt;/tt&gt; parameter.  The&lt;br/&gt;  &lt;tt class='LITERAL'&gt;console&lt;/tt&gt; parameter can be given repeatedly, but&lt;br/&gt;  the parameter can only be given once for each console technology.&lt;br/&gt;  So &lt;tt class='LITERAL'&gt;console=tty0 console=lp0 console=ttyS0&lt;/tt&gt; is&lt;br/&gt;  acceptable but &lt;tt class='LITERAL'&gt;console=ttyS0 console=ttyS1&lt;/tt&gt; will&lt;br/&gt;  not work.&lt;/p&gt;&lt;p&gt;When multiple consoles are listed output is sent to all&lt;br/&gt;  consoles and input is taken from the last listed console.  The last&lt;br/&gt;  &lt;tt class='LITERAL'&gt;console&lt;/tt&gt; is the one Linux uses as the &lt;tt class='FILENAME'&gt;/dev/console&lt;/tt&gt; device.&lt;/p&gt;&lt;p&gt;The syntax of the &lt;tt class='LITERAL'&gt;console&lt;/tt&gt; parameter is&lt;br/&gt;  given in &lt;a href='http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html#CONFIGURE-KERNEL-SYNTAX'&gt;Figure 5-1&lt;/a&gt;.&lt;/p&gt;&lt;div class='FIGURE'&gt;&lt;a name='CONFIGURE-KERNEL-SYNTAX'/&gt;&lt;p&gt;&lt;a name='CONFIGURE-KERNEL-SYNTAX'&gt;&lt;b&gt;Figure 5-1. Kernel &lt;tt class='LITERAL'&gt;console&lt;/tt&gt; syntax, in EBNF&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class='LITERALLAYOUT'&gt;&lt;a name='CONFIGURE-KERNEL-SYNTAX'&gt;&lt;tt class='LITERAL'&gt;console=ttyS&lt;/tt&gt;&lt;tt class='REPLACEABLE'&gt;&lt;i&gt;&lt;serial_port/&gt;&lt;/i&gt;&lt;/tt&gt;[&lt;tt class='LITERAL'&gt;,&lt;/tt&gt;&lt;tt class='REPLACEABLE'&gt;&lt;i&gt;&lt;mode/&gt;&lt;/i&gt;&lt;/tt&gt;]&lt;br/&gt;&lt;br/&gt;&lt;tt class='LITERAL'&gt;console=tty&lt;/tt&gt;&lt;tt class='REPLACEABLE'&gt;&lt;i&gt;&lt;virtual_terminal/&gt;&lt;/i&gt;&lt;/tt&gt;&lt;br/&gt;&lt;br/&gt;&lt;tt class='LITERAL'&gt;console=lp&lt;/tt&gt;&lt;tt class='REPLACEABLE'&gt;&lt;i&gt;&lt;parallel_port/&gt;&lt;/i&gt;&lt;/tt&gt;&lt;br/&gt;&lt;br/&gt;&lt;tt class='LITERAL'&gt;console=ttyUSB&lt;/tt&gt;[&lt;tt class='REPLACEABLE'&gt;&lt;i&gt;&lt;usb_port/&gt;&lt;/i&gt;&lt;/tt&gt;[&lt;tt class='LITERAL'&gt;,&lt;/tt&gt;&lt;tt class='REPLACEABLE'&gt;&lt;i&gt;&lt;mode/&gt;&lt;/i&gt;&lt;/tt&gt;]&lt;/a&gt;&lt;/p&gt;&lt;a name='CONFIGURE-KERNEL-SYNTAX'&gt;-----------------------------&lt;br/&gt;&lt;br/&gt;That means that giving command:&lt;br/&gt;&lt;br/&gt;qemu -hda rootfs.img -kernel bzImage -append "root=/dev/hda console=tty0 console=ttyS0" -serial stdio&lt;br/&gt;&lt;br/&gt;This will give output in both host console (ttyS0), but also in qemu vindow (tty0).&lt;br/&gt;However, there is another note for this command in  form mentioned howto:&lt;br/&gt;&lt;br/&gt;&lt;i&gt;Kernel messages will appear on both the first virtual terminal  and the serial port.  Messages from the  &lt;span class='APPLICATION'&gt;init&lt;/span&gt; system and the system logger will  appear only on the first serial port.  This can be slightly  confusing when looking at the attached monitor: the machine will  appear to boot and then hang.  Don't panic, the  &lt;span class='APPLICATION'&gt;init&lt;/span&gt; system has started but is now  printing messages to the serial port but is printing nothing to the  screen.  If a &lt;span class='APPLICATION'&gt;getty&lt;/span&gt; has been configured  then a &lt;tt class='COMPUTEROUTPUT'&gt;login:&lt;/tt&gt; prompt will  eventually appear on the attached monitor&lt;/i&gt;.&lt;br/&gt;&lt;br/&gt;&lt;/a&gt;&lt;/div&gt;&lt;a name='CONFIGURE-KERNEL-SYNTAX'&gt;&lt;br/&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-466269068672170301?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/466269068672170301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=466269068672170301' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/466269068672170301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/466269068672170301'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2008/11/capturing-output-of-qemu.html' title='Capturing output of qemu'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-4662080221180874617</id><published>2008-11-20T14:59:00.000-08:00</published><updated>2008-11-22T06:18:55.735-08:00</updated><title type='text'>Problems with booting vanilla image in qemu</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;I built vanilla bzImage with intention to run it in qemu, using command:&lt;br/&gt;&lt;br/&gt;&lt;small&gt;&lt;font face='Courier New'&gt;qemu -hda rootfs.img -kernel bzImage -append "root=/dev/hda"&lt;/font&gt;&lt;/small&gt;&lt;br/&gt;&lt;br/&gt;instead of previous:&lt;br/&gt;&lt;br/&gt;&lt;small&gt;&lt;font face='Courier New'&gt;qemu -hda rootfs.img -kernel vmlinuz-2.6.18-4-k7 -initrd initrd.img-2.6.18-4-k7 -append "root=/dev/hda"&lt;br/&gt;&lt;br/&gt;&lt;font face='sans-serif'&gt;where&lt;br/&gt;I used prebuild Debian kernel (ths already patched), provided as a&lt;br/&gt;binary with the distro. Note here that initrd image is provided also&lt;br/&gt;and had to be used with the Debian kernel which I wanted to avoid (by&lt;br/&gt;building my own vanilla).&lt;br/&gt;&lt;br/&gt;rootfs.img I used was created using Busybox:&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;/small&gt;&lt;ol&gt;&lt;li&gt;&lt;small&gt;&lt;font face='sans-serif'&gt;make menuconfig&lt;/font&gt;&lt;/small&gt;&lt;/li&gt;&lt;li&gt;&lt;small&gt;&lt;font face='sans-serif'&gt;make&lt;/font&gt;&lt;/small&gt;&lt;/li&gt;&lt;li&gt;&lt;small&gt;&lt;font face='sans-serif'&gt;make install&lt;/font&gt;&lt;/small&gt;&lt;/li&gt;&lt;/ol&gt;&lt;small&gt;&lt;font face='sans-serif'&gt;Find the files under busybox/_install:&lt;br/&gt;&lt;font face='Courier New'&gt;&lt;br/&gt;drasko@Lenin:~/lddTutorial$ ls busybox-1.12.1&lt;br/&gt;applets                 debianutils  LICENSE          runit&lt;br/&gt;arch                    docs         loginutils       scripts&lt;br/&gt;archival                e2fsprogs    Makefile         selinux&lt;br/&gt;AUTHORS                 editors      Makefile.custom  shell&lt;br/&gt;busybox                 examples     Makefile.flags   sysklogd&lt;br/&gt;busybox.links           findutils    Makefile.help    testsuite&lt;br/&gt;busybox_unstripped      include      miscutils        TODO&lt;br/&gt;busybox_unstripped.map  init         modutils         TODO_config_nommu&lt;br/&gt;busybox_unstripped.out  _install     networking       util-linux&lt;br/&gt;Config.in               INSTALL      printutils&lt;br/&gt;console-tools           libbb        procps&lt;br/&gt;coreutils               libpwdgrp    README&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;drasko@Lenin:~/lddTutorial$ ls busybox-1.12.1/_install/&lt;br/&gt;bin  linuxrc  sbin  usr&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;After that, rsync _install from busybox with rootfs.img file, formated to ext2:&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/small&gt;&lt;br/&gt;&lt;ol&gt;&lt;li&gt;&lt;small&gt;&lt;font face='Courier New'&gt;dd if=/dev/zero of=rootfs.img bs=10000k count=1&lt;/font&gt;&lt;/small&gt;&lt;/li&gt;&lt;li&gt;&lt;small&gt;&lt;font face='Courier New'&gt;mkfs.ext2 -F rootfs.img&lt;/font&gt;&lt;/small&gt;&lt;/li&gt;&lt;li&gt;&lt;small&gt;&lt;font face='Courier New'&gt;mkdir /mnt/rootfs&lt;/font&gt;&lt;/small&gt;&lt;/li&gt;&lt;li&gt;&lt;small&gt;&lt;font face='Courier New'&gt;mount -o loop rootfs.img /mnt/rootfs&lt;/font&gt;&lt;/small&gt;&lt;/li&gt;&lt;li&gt;&lt;small&gt;&lt;font face='Courier New'&gt;rsync -a busybox/_install/ /mnt/rootfs/&lt;/font&gt;&lt;/small&gt;&lt;/li&gt;&lt;li&gt;&lt;small&gt;&lt;font face='Courier New'&gt;chown -R root:root /mnt/rootfs/&lt;/font&gt;&lt;/small&gt;&lt;/li&gt;&lt;li&gt;&lt;small&gt;&lt;font face='Courier New'&gt;sync&lt;/font&gt;&lt;/small&gt;&lt;/li&gt;&lt;/ol&gt;&lt;br/&gt;&lt;small&gt;&lt;font face='sans-serif'&gt;Cool, now we have root FS on our file. We can now boot with:&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/font&gt;&lt;/small&gt;&lt;small&gt;&lt;font face='Courier New'&gt;qemu -hda rootfs.img -kernel bzImage -append "root=/dev/hda"&lt;/font&gt;&lt;/small&gt;&lt;br/&gt;&lt;br/&gt;&lt;small&gt;&lt;font face='sans-serif'&gt;&lt;br/&gt;&lt;br/&gt;So, I built vanilla kernel bzImage, but wanted minimal size - i started with:&lt;br/&gt;&lt;br/&gt;make allnoconfig&lt;br/&gt;&lt;br/&gt;and turn on one by one. &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;First error - I missed support for IDE drive - device drivers not&lt;br/&gt;selected in make menuconfig prevented the kernel to recognize /dev/hda&lt;br/&gt;given to qemu as a hard disk partition. It gave kernel panic something&lt;br/&gt;like:&lt;br/&gt;&lt;br/&gt;Undefined block(0,0).&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;Back to the make menuconfig, turn on block devices, and under Device Drivers find IDE sections. Make.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;That worked, but here comes new kernel panic:&lt;br/&gt;&lt;font face='Courier New'&gt;Kernel panic - not syncing: No init found.  Try passing init= option to kernel.&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;Obviously, there is init missing, and that is most because there is no console on the newly created rootfs.img.&lt;br/&gt;&lt;br/&gt;The&lt;br/&gt;thing is that /dev directory is dynamically created by kernel, but&lt;br/&gt;kernel has no means in creating console. It has to be created manually.&lt;br/&gt;&lt;br/&gt;Well,&lt;br/&gt;why did not previous run complained, the one with Debian kernel?&lt;br/&gt;Because of initrd. This image has udev, which can dynamically make&lt;br/&gt;console using hotplug, when enabled in kernel (which probably is the&lt;br/&gt;case of Debian pre-build kernel).&lt;br/&gt;&lt;br/&gt;---&lt;br/&gt;As a digression:&lt;br/&gt;&lt;br/&gt;Following the Debian Kernel Handbook, initrd.img can be unpacked:&lt;br/&gt;&lt;/font&gt;&lt;/small&gt;&lt;small&gt;&lt;font face='sans-serif'&gt;&lt;br/&gt;&lt;br/&gt;&lt;font face='Courier New'&gt;$ zcat  /boot/initrd.img-2.6.18-4-k7 | cpio -i&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;After unpacking we can inspect contents of initrd directory:&lt;br/&gt;&lt;/font&gt;&lt;/small&gt;&lt;small&gt;&lt;font face='sans-serif'&gt;&lt;font face='Courier New'&gt;&lt;br/&gt;drasko@Lenin:~/dmel/initrd$ pwd&lt;br/&gt;/home/drasko/dmel/initrd&lt;br/&gt;&lt;br/&gt;drasko@Lenin:~/dmel/initrd$ ls&lt;br/&gt;bin  conf  etc  init  initrd.img-2.6.18-4-k7  lib  sbin  scripts&lt;br/&gt;&lt;br/&gt;drasko@Lenin:~/dmel/initrd$ ls sbin/&lt;br/&gt;depmod  modprobe  rmmod  udevd  udevsettle  udevtrigger&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;---&lt;br/&gt;&lt;br/&gt;In our vanilla kernel we do not have initrd, we tried to skip this step&lt;br/&gt;by simplifying kernal and static build of all needed stuff.&lt;br/&gt;&lt;br/&gt;That's why we have to create /dev/console manually in our filesystem (rootfs.img).&lt;br/&gt;&lt;br/&gt;Creating device files when programs complain:&lt;br/&gt;&lt;/font&gt;&lt;/small&gt;&lt;ol&gt;&lt;li&gt;&lt;font face='Courier New'&gt;&lt;small&gt;mkdir /mnt/rootfs/dev&lt;/small&gt;&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font face='Courier New'&gt;&lt;small&gt;mknod /mnt/rootfs/dev/console c 5 1&lt;/small&gt;&lt;/font&gt;&lt;/li&gt;&lt;li&gt;&lt;font face='Courier New'&gt;&lt;small&gt;mknod /mnt/rootfs/dev/null c 1 3&lt;/small&gt;&lt;/font&gt;&lt;/li&gt;&lt;/ol&gt;&lt;small&gt;&lt;font face='sans-serif'&gt;Taking the GNU/Linux host as an example to find correct&lt;br/&gt;major and minor numbers:&lt;br/&gt;&lt;font face='Courier New'&gt;ls -l /dev/console&lt;br/&gt;ls -l /dev/null&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;-----------------------&lt;br/&gt;&lt;br/&gt;Final note: Trying with kernel 2.6.27, I saw that init is working correctly, even for the minimal configuration. So - avoid 2.6.23 - it is buggy. Not only that it can not be build with gcc-4.3, but also loop.o gives compilation error whenn loop block device support is selected in kernel. And, yes, init is dead...&lt;br/&gt;&lt;br/&gt;-----------------------&lt;br/&gt;&lt;/font&gt;&lt;/font&gt;&lt;/small&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-4662080221180874617?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/4662080221180874617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=4662080221180874617' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/4662080221180874617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/4662080221180874617'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2008/11/problems-with-booting-vanilla-image-in_3567.html' title='Problems with booting vanilla image in qemu'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-2771862675822650632</id><published>2008-11-20T12:42:00.000-08:00</published><updated>2008-11-20T12:43:06.900-08:00</updated><title type='text'>Select text from qemu</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;I found it difficult to copy/paste boot messages from qemu. THat is because qemu is using SDL for display.&lt;br/&gt;&lt;br/&gt;I tried adding "console=/dev/ttyS0" in the -append section, which should output messages from the guest kernel though serial connection onto the host console. For working (Debian) kernel, this starts booting in quemu window, but whe a kernel is uncompressed, then starts writing on the host console the rest of the boot process. If -nographic switch to qemu is added, than it will not even start booting in separate window, but go to the console right away. The -nographic switch actually gives -serial stdio switch internaly to qemu in ordet to send everything to host stdio. &lt;br/&gt;&lt;br/&gt; But - for my vanilla compiled kernel this does not work, it just stucks, probablybecause I did not enable this support in menuconfig.&lt;br/&gt;&lt;br/&gt;My help was to use -curses switch, which boots qemu in ncurses environment, where we can copy/paste in the usual way.&lt;br/&gt;&lt;br/&gt;Also, to switch to the monitor console in -curses use Alt+2, or ESC and then press 2. There you can write quit to quit qemu.&lt;br/&gt;To go back to guest main console press Alt+1.&lt;br/&gt;&lt;br/&gt;This is different from the SDL qemu environment, where you tooggle this with Ctl+Alt+1 or Ctl+Alt+2.&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-2771862675822650632?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/2771862675822650632/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=2771862675822650632' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/2771862675822650632'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/2771862675822650632'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2008/11/select-text-from-qemu.html' title='Select text from qemu'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-4479950283545440535</id><published>2008-11-02T08:23:00.000-08:00</published><updated>2008-11-03T05:27:21.419-08:00</updated><title type='text'>Taking Notes</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;I found that nice ways to collect related information are:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;This blog&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Virtual notebook&lt;/li&gt;&lt;/ol&gt;For editing thia blog I use Firefox plugin (&lt;a href="http://www.scribefire.com/"&gt;http://www.scribefire.com/&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;For virtual notebook I use Google notebok, Firefox plugin (&lt;a href="http://www.google.com/notebook/download"&gt;http://www.google.com/notebook/download&lt;/a&gt;).&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-4479950283545440535?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/4479950283545440535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=4479950283545440535' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/4479950283545440535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/4479950283545440535'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2008/11/taking-notes.html' title='Taking Notes'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-2018638555501811993</id><published>2008-11-01T20:16:00.000-07:00</published><updated>2008-11-02T05:34:22.668-08:00</updated><title type='text'>Vim as a C IDE</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;Ingredients:&lt;br/&gt;&lt;br/&gt;&lt;b&gt;&lt;u&gt;TAGLIST&lt;/u&gt;&lt;/b&gt;&lt;br/&gt;Nice plugin for jumping on tags within currently opened C module. More info on &lt;a href='http://vim-taglist.sourceforge.net/'&gt;http://vim-taglist.sourceforge.net/&lt;/a&gt; and &lt;a href='http://vim.sourceforge.net/scripts/script.php?script_id=273'&gt;http://vim.sourceforge.net/scripts/script.php?script_id=273&lt;/a&gt;.&lt;br/&gt;&lt;br/&gt;Requires Exuberant CTAGS (&lt;a href='http://ctags.sourceforge.net/'&gt;http://ctags.sourceforge.net/&lt;/a&gt;).&lt;br/&gt;&lt;br/&gt;Few nice settings in .vimrc:&lt;br/&gt;&lt;br/&gt;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&lt;br/&gt;" CTags&lt;br/&gt;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&lt;br/&gt;"let Tlist_Ctags_Cmd = $VIM.'\ctags.exe'     " Location of ctags&lt;br/&gt;let Tlist_Sort_Type = "name"                         " order by&lt;br/&gt;let Tlist_Use_Right_Window = 1                   " split to the right side of the screen&lt;br/&gt;let Tlist_Compart_Format = 1                       " show small meny&lt;br/&gt;let Tlist_Exist_OnlyWindow = 1                    " if you are the last, kill yourself&lt;br/&gt;"let Tlist_File_Fold_Auto_Close = 0             " Do not close tags for other files&lt;br/&gt;"let Tlist_Enable_Fold_Column = 0               " Do not show folding tree&lt;br/&gt;let Tlist_Auto_Open = 1                               " Automatically open the taglist window on Vim startup&lt;br/&gt;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;u&gt;&lt;b&gt;NERDTree&lt;/b&gt;&lt;/u&gt;&lt;br/&gt;&lt;br/&gt;Nice file explorer. Here is the link: &lt;a href='http://www.vim.org/scripts/script.php?script_id=1658'&gt;http://www.vim.org/scripts/script.php?script_id=1658&lt;/a&gt;.&lt;br/&gt;To keep it open on start of every file (* glob in the following Vim's autocomand means everyfile),&lt;br/&gt;put this line in your .vimrc:&lt;br/&gt;&lt;br/&gt;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&lt;br/&gt;" Autocommands&lt;br/&gt;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&lt;br/&gt;au vimenter * nerdtree    " fire up NERDTree on entering vim&lt;br/&gt;&lt;u&gt;&lt;b&gt;&lt;br/&gt;minibufexpl&lt;/b&gt;&lt;/u&gt;&lt;br/&gt;From the site (&lt;a href='http://www.vim.org/scripts/script.php?script_id=159'&gt;http://www.vim.org/scripts/script.php?script_id=159&lt;/a&gt;): &lt;span class='txth1'&gt;Elegant buffer explorer - takes very little screen space&lt;/span&gt;. This give &lt;br/&gt;Vim "tabbing" for files opened from NERDExplorer on doubleclick, which will start to open in the central window, but in a different buffer. Minibufexpl gives opportunity to easy switch between the buffers.&lt;br/&gt;&lt;br/&gt;Here is my .vimrc extract:&lt;br/&gt;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&lt;br/&gt;" Minibuf&lt;br/&gt;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&lt;br/&gt;let g:miniBufExplTabWrap = 1                 " make tabs show complete (no broken on two lines)&lt;br/&gt;"let g:miniBufExplModSelTarget = 1&lt;br/&gt;let g:miniBufExplSplitToEdge = 0&lt;br/&gt;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""&lt;br/&gt;Buffers from MBE window are delted by pressing "d" when cursor is on the tab.&lt;br/&gt;&lt;br/&gt;&lt;u&gt;&lt;b&gt;Other Utilities&lt;/b&gt;&lt;/u&gt;&lt;br/&gt;Except from Exuberant CTAGS, mentioned before I recommend also:&lt;br/&gt;&lt;ol&gt;&lt;li&gt;cscope (&lt;a href='http://cscope.sourceforge.net/'&gt;http://cscope.sourceforge.net/&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;&lt;span class='txth1'&gt;Color Scheme Sampler Pack &lt;/span&gt;(&lt;a href='http://www.vim.org/scripts/script.php?script_id=625'&gt;http://www.vim.org/scripts/script.php?script_id=625&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;&lt;span class='txth1'&gt;c.vim (&lt;a href='http://www.vim.org/scripts/script.php?script_id=213'&gt;http://www.vim.org/scripts/script.php?script_id=213&lt;/a&gt;)&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span class='txth1'&gt;CRefVim &lt;/span&gt;&lt;span class='txth1'&gt;(&lt;a href='http://www.vim.org/scripts/script.php?script_id=614'&gt;http://www.vim.org/scripts/script.php?script_id=614&lt;/a&gt;)&lt;br/&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;All are straigtforward to install. Additional notes for CRefVim:&lt;br/&gt;&lt;ul&gt;&lt;li&gt;copy all, ecpecially docs to .vim folder&lt;/li&gt;&lt;li&gt;run :helptags ~/.vim/doc   (or :helptags c:\vimfiles\doc for Windows)&lt;/li&gt;&lt;li&gt;\cr normal mode:  get help for word under cursor&lt;/li&gt;&lt;/ul&gt;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-2018638555501811993?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/2018638555501811993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=2018638555501811993' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/2018638555501811993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/2018638555501811993'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2008/11/vim-as-c-ide_2239.html' title='Vim as a C IDE'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-7004403369427468943</id><published>2008-11-01T19:20:00.000-07:00</published><updated>2008-11-01T19:51:46.498-07:00</updated><title type='text'>Code Syntax Highlighting on Blogger</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Here &lt;a href="http://bc-squared.blogspot.com/2008/07/syntax-highlighting-and-code-snippets.html"&gt;&lt;/a&gt;is what I found &lt;a href="http://morten.lyhr.dk/2007/12/how-to-get-syntax-highlighting-in.html"&gt;here&lt;/a&gt; and especially &lt;a href="http://bc-squared.blogspot.com/2008/07/syntax-highlighting-and-code-snippets.html"&gt;here&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;Syntaxhighlighter is a cool JS library for syntax highlighting on a web page.&lt;ol&gt;&lt;li&gt;   Download the latest version&lt;/li&gt;&lt;li&gt;   Unrar to a temp folder. ex: c:\temp\syntaxhighlighter&lt;/li&gt;&lt;li&gt;   Transfer the folders (Scripts and Styles) to a web server. I used googlepages to host my files (just use menu on the right side to upload all the files. Remeber, not all shBrush.js have to be uploaded, but only the ones you will use).&lt;/li&gt;&lt;li&gt;   Open blogger.com and sign in.&lt;/li&gt;&lt;li&gt;   Goto "Template" and choose "Classic" layout. (This is not needed with new wersion of Syntaxhighlighter. To do this anyway go to the EditHTML, and then in the left bottom of the page under HTML editing window find a link "Revert to the classic template" - of course, supposed that you have been using some more advanced template and not the classic one)&lt;/li&gt;&lt;li&gt;   Goto Edit Html.&lt;/li&gt;&lt;li&gt;Right after &amp;lt;head&amp;gt; html tag of the template code insert the something like:&lt;/li&gt;&lt;/ol&gt;&lt;pre name="code" class="jscript"&gt;&amp;lt;link href="http://drasko.draskovic.googlepages.com/SyntaxHighlighter.css" type="text/css" rel="stylesheet" /&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="http://drasko.draskovic.googlepages.com/shCore.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="http://drasko.draskovic.googlepages.com/shBrushCpp.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="http://drasko.draskovic.googlepages.com/shBrushPhp.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="http://drasko.draskovic.googlepages.com/shBrushPython.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="http://drasko.draskovic.googlepages.com/shBrushVb.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="http://drasko.draskovic.googlepages.com/shBrushJava.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="http://drasko.draskovic.googlepages.com/shBrushCSharp.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="http://drasko.draskovic.googlepages.com/shBrushRuby.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="http://drasko.draskovic.googlepages.com/shBrushXml.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="http://drasko.draskovic.googlepages.com/shBrushCss.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="http://drasko.draskovic.googlepages.com/shBrushJScript.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script language="javascript" src="http://drasko.draskovic.googlepages.com/shBrushSql.js"&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;p&amp;gt;&amp;lt;/p&amp;gt;p&amp;gt;&lt;/pre&gt;Do not forget to change lines like http://&lt;span style="font-weight: bold;"&gt;drasko.draskovic&lt;/span&gt;.googlepages.com/shCore.js&lt;br /&gt;to&lt;br /&gt;http://&lt;span style="font-weight: bold;"&gt;youraccount&lt;/span&gt;.googlepages.com/shCore.jsGood.&lt;br /&gt;&lt;br /&gt;One more step left - just before the closing tag insert:&lt;br /&gt;&lt;pre class="jscript" name="code"&gt;&lt;br /&gt;&amp;lt;script language='javascript'&amp;gt;  dp.SyntaxHighlighter.ClipboardSwf =    'http://drasko.draskovic.googlepages.com/clipboard.swf';&lt;br /&gt;dp.SyntaxHighlighter.BloggerMode();&lt;br /&gt;dp.SyntaxHighlighter.HighlightAll('code');&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/pre&gt;Good. Now you are ready to use it - just embrace your code with &amp;lt;pre&amp;gt; xml tags, like here:&lt;br /&gt;&lt;pre class="xml" name="code"&gt;&lt;br /&gt;&amp;lt;pre name="code" class="java"&amp;gt;&lt;br /&gt;...some code in here...&lt;br /&gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-7004403369427468943?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/7004403369427468943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=7004403369427468943' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/7004403369427468943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/7004403369427468943'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2008/11/code-syntax-highlighting-on-blogger_8307.html' title='Code Syntax Highlighting on Blogger'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-523863966695375239</id><published>2007-12-07T13:35:00.000-08:00</published><updated>2008-11-01T19:20:22.876-07:00</updated><title type='text'>DASH</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;font face='arial'&gt;Here is what Wikipedia says:&lt;br/&gt;&lt;/font&gt;&lt;p&gt;&lt;b style='font-style: italic;'&gt;D&lt;/b&gt;&lt;font style='font-style: italic;'&gt;ebian &lt;/font&gt;&lt;b style='font-style: italic;'&gt;A&lt;/b&gt;&lt;font style='font-style: italic;'&gt;lmquist &lt;/font&gt;&lt;b style='font-style: italic;'&gt;sh&lt;/b&gt;&lt;font style='font-style: italic;'&gt;ell (&lt;/font&gt;&lt;b style='font-style: italic;'&gt;dash&lt;/b&gt;&lt;font style='font-style: italic;'&gt;) is a &lt;/font&gt;&lt;a title='POSIX' href='http://en.wikipedia.org/wiki/POSIX' style='font-style: italic; font-weight: bold;'&gt;POSIX&lt;/a&gt;&lt;font style='font-style: italic;'&gt;-compliant &lt;/font&gt;&lt;a title='Unix shell' href='http://en.wikipedia.org/wiki/Unix_shell' style='font-style: italic;'&gt;Unix shell&lt;/a&gt;&lt;font style='font-style: italic;'&gt;, much smaller than &lt;/font&gt;&lt;a title='Bash' href='http://en.wikipedia.org/wiki/Bash' style='font-style: italic;'&gt;bash&lt;/a&gt;&lt;font style='font-style: italic;'&gt;. It requires less disk space but is also less feature rich. dash is a direct descendant of the NetBSD version of the &lt;/font&gt;&lt;a title='Almquist Shell' href='http://en.wikipedia.org/wiki/Almquist_Shell' style='font-style: italic;'&gt;Almquist Shell (ash)&lt;/a&gt;&lt;br/&gt;&lt;/p&gt;&lt;font face='arial'&gt;From BASH to DASH:&lt;/font&gt;&lt;font face='monospace'&gt;&lt;br/&gt;&lt;/font&gt;sudo dpkg-reconfigure dash&lt;br/&gt;and say 'yes' to switch /bin/sh link to point to DASH.&lt;br/&gt;&lt;br/&gt;From DASH to BASH you can just run the following command:&lt;br/&gt;sudo dpkg-reconfigure dash&lt;br/&gt;Choose 'no' when it asks if you want to make sh symbolically link to dash. The same command can be used if you ever want to switch back to dash.&lt;br/&gt;&lt;br/&gt;&lt;font face='arial'&gt;Well, Ubuntu switched to it for a default shell:&lt;/font&gt;&lt;br/&gt;https://wiki.ubuntu.com/DashAsBinSh&lt;br/&gt;&lt;br/&gt;&lt;font face='arial' style='font-style: italic;'&gt;The major reason to switch the default shell was efficiency. bash is an excellent full-featured shell appropriate for interactive use; indeed, it is still the default login shell. However, it is rather large and slow to start up and operate by comparison with dash.&lt;/font&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2392320021887275263-523863966695375239?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/523863966695375239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=523863966695375239' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/523863966695375239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/523863966695375239'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2007/12/dash_07.html' title='DASH'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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-2392320021887275263.post-8663710790209775578</id><published>2007-11-18T09:41:00.000-08:00</published><updated>2007-11-18T10:26:32.092-08:00</updated><title type='text'>Debian Can Be ARM Dev Environment</title><content type='html'>&lt;span style="font-family:arial;"&gt;Well, I had troubles last few days correctly installing ARM &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;toolchain&lt;/span&gt; and needed stuff to make my development under Debian. But, it is suppose to be easy :).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;First, I had troubles with apt-get. It is because my /etc/&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;souces&lt;/span&gt;.list grew when I added unstable &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;repos&lt;/span&gt;. Consequently, apt-get complained about missing room for it's info.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;dpkg&lt;/span&gt; wants you to know: Getting "E: Dynamic &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;MMap&lt;/span&gt; ran out of room" when using apt-get? Put the following line into your /etc/apt/apt.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;conf&lt;/span&gt;: 'APT::Cache-Limit 12582912;' . If you still get the same error, increase the value. If that file doesn't exist, add it, or put that line in a file in /etc/apt/apt.conf.d/  You can also possibly get rid of this error by deleting entries from your sources.list that you don't actually need.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:arial;"&gt;After putting 16M (16777216) instead of these 12M, problem was solved.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Another problem with apt is that it was stacking at 99% while doing &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;" &gt;apt-get update. &lt;/span&gt;&lt;span style="font-family:arial;"&gt;Solution is:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;#&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;cd&lt;/span&gt; /var/lib/apt/lists&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;#rm *_Packages *.&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;gpg&lt;/span&gt; *_Release *&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;IndexDiff&lt;/span&gt; *Sources&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Well, this helped, partially. At one point i had to move (move, please don't delete) the whole /var/lib/apt/lists &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;dir&lt;/span&gt; and create new one. Next apt-get complained that it misses folder /var/lib/apt/lists/Partial, so I brought this one back to my newly created and fresh &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;dir&lt;/span&gt;. And it worked, but for how long I don't know.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Anyway, after adding unstable &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;repos&lt;/span&gt;, it would be good to do apt pinning in order to take packages mainly from the testing branch, and hit unstable branch only when testing package is not found. Good tutorial can be found here: http://wiki.debian.org/AptPinning, but I'll copy some of the stuff:&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:78%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;h4 id="head-08dc9242aa10b00a54f856ed1e4cacd4c33011c6"  style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;/etc/apt/sources.list&lt;/span&gt;&lt;/h4&gt;   &lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt; # official &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;debian&lt;/span&gt; sites&lt;br /&gt;#### testing  #########&lt;br /&gt;deb http://http.us.debian.org/debian testing main &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;contrib&lt;/span&gt; non-free&lt;br /&gt;deb http://non-us.debian.org/debian-non-US testing/non-US main &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;contrib&lt;/span&gt; non-free&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt; #### unstable #########&lt;br /&gt;deb http://ftp.us.debian.org/debian unstable main non-free &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;contrib&lt;/span&gt;&lt;br /&gt;deb http://non-us.debian.org/debian-non-US unstable/non-US main &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;contrib&lt;/span&gt; non-free&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt; &lt;p  style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;In this example, we're pulling from &lt;em&gt;testing&lt;/em&gt; and &lt;em&gt;unstable&lt;/em&gt;.  You could, of course, modify this to pull from &lt;em&gt;stable&lt;/em&gt; as well. &lt;/span&gt;&lt;/p&gt;  &lt;h4 id="head-bb6f4deec550e7aa57e87d8ee1c5c8bef6ff7ac7"  style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;/etc/apt/preferences&lt;/span&gt;&lt;/h4&gt;  &lt;p  style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;The 'preferences' file is where the actual &lt;em&gt;pinning&lt;/em&gt; takes place.  Here's an example:  &lt;/span&gt;&lt;/p&gt; &lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;Package: *&lt;br /&gt;Pin: release a=testing&lt;br /&gt;Pin-Priority: 900&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;  &lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;Package: *&lt;br /&gt;Pin: release a=unstable&lt;br /&gt;Pin-Priority: 800&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt; &lt;p  style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;&lt;strong&gt;Package&lt;/strong&gt; defaults to any, as specified by the asterisk.  &lt;strong&gt;Pin&lt;/strong&gt; specifies the release (&lt;em&gt;testing&lt;/em&gt; and &lt;em&gt;unstable&lt;/em&gt;).  &lt;strong&gt;Pin-Priority&lt;/strong&gt; specifies the priority level. 'apt-get' defaults to something along the lines of "highest package version wins". The above restructures this priority so that packages in &lt;em&gt;testing&lt;/em&gt; are given a higher priority. &lt;/span&gt;&lt;/p&gt; &lt;p  style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;You should also refer to the apt_preferences(5) &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;manpage&lt;/span&gt;. &lt;/span&gt;&lt;/p&gt;  &lt;h4 id="head-09beb9c8563ba8c14a87dfd9e8d09f74fde199bc"  style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;Installing from unstable&lt;/span&gt;&lt;/h4&gt;  &lt;p  style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;Let's assume that we're running &lt;em&gt;testing&lt;/em&gt; and we want to try enlightenment from &lt;em&gt;unstable&lt;/em&gt;.  There are basically two methods for installing:  &lt;/span&gt;&lt;/p&gt; &lt;pre  style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;# apt-get install enlightenment/unstable&lt;br /&gt;# apt-get -t unstable install enlightenment&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt; &lt;p  style="font-family:courier new;"&gt;&lt;span style="font-size:78%;"&gt;The first will not attempt to upgrade any packages on your system, so if specific dependencies are not met, the install will fail. The second method &lt;strong&gt;will&lt;/strong&gt; attempt to install/upgrade any dependencies.  Of course, given the above example, 'apt-get' will ask you before proceeding.&lt;/span&gt; &lt;/p&gt;Surprisingly, that will work good. So, now it is time to install cross-compiler and friends. The whole hassle with unstable and pinning was done because we need &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;emdebian&lt;/span&gt;-tools, and these are found in unstable (but we wonted just these packages from unstable, and not some other system packages, so we did the apt-pinning).&lt;br /&gt;From here, follow the instructions on: http://wiki.debian.org/EmdebianQuickStart&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;#apt-get install &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;emdebian&lt;/span&gt;-tools&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Cool, this got us close. Now back to simple user (stop being root):&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;$ apt-cross --update&lt;br /&gt;$ &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;emsetup&lt;/span&gt; -v&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Basically, you need 4 most important packages:&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;ol&gt;&lt;li&gt;arm-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;linux&lt;/span&gt;-gnu-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;gcc&lt;/span&gt;  -  ARM cross-compiler&lt;/li&gt;&lt;li&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;binutils&lt;/span&gt;-arm-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;linux&lt;/span&gt;-gnu&lt;/li&gt;&lt;li&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;libc&lt;/span&gt;6-arm-cross  -  shared libs&lt;/li&gt;&lt;li&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;libc&lt;/span&gt;6-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;dev&lt;/span&gt;-arm-cross  -  development headers&lt;/li&gt;&lt;/ol&gt;Good, so we &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_31"&gt;could&lt;/span&gt; now test the environment. Here is my loved &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;helloWorld&lt;/span&gt;.c:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;#include &lt;stdio.h&gt;&lt;/stdio.h&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;int main()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;printf&lt;/span&gt;("Hello cross-compiling world!\n");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    return 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Compile it like:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;drasko@Lenin:~/arm_projects$ arm-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;linux&lt;/span&gt;-gnu-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;gcc&lt;/span&gt; -o &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;helloWorld&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;helloWorld&lt;/span&gt;.c&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And test it with &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;qemu&lt;/span&gt;:&lt;br /&gt;drasko@Lenin:~/arm_projects$ &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;qemu&lt;/span&gt;-arm -L /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;usr&lt;/span&gt;/arm-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;linux&lt;/span&gt;-gnu/ &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_42"&gt;helloWorld&lt;/span&gt;&lt;br /&gt;Hello cross-compiling world!&lt;br /&gt;&lt;br /&gt;The switch -L /&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_43"&gt;usr&lt;/span&gt;/arm-&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_44"&gt;linux&lt;/span&gt;-gnu/ for &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_45"&gt;qemu&lt;/span&gt; is necessary, otherwise it will complain how it can not find interpreter (&lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_46"&gt;similarly&lt;/span&gt; is done on Win, when &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_47"&gt;qemu&lt;/span&gt; complains about bios it can not find - point &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_48"&gt;qemu&lt;/span&gt; to  this file with -L switch).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&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/2392320021887275263-8663710790209775578?l=draskovblog.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://draskovblog.blogspot.com/feeds/8663710790209775578/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=2392320021887275263&amp;postID=8663710790209775578' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/8663710790209775578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2392320021887275263/posts/default/8663710790209775578'/><link rel='alternate' type='text/html' href='http://draskovblog.blogspot.com/2007/11/debbian-can-be-arm-dev-environment.html' title='Debian Can Be ARM Dev Environment'/><author><name>Drasko Draskovic</name><uri>http://www.blogger.com/profile/05185812944276316808</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></feed>
