<?xml version='1.0' encoding='utf-8' ?>
<!--  If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/  -->
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:media='http://search.yahoo.com/mrss/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>Psychedelic GNU diary</title>
  <link>http://watashi-metan.livejournal.com/</link>
  <description>Psychedelic GNU diary - LiveJournal.com</description>
  <lastBuildDate>Fri, 06 Nov 2009 02:53:07 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>watashi_metan</lj:journal>
  <lj:journalid>15893709</lj:journalid>
  <lj:journaltype>personal</lj:journaltype>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/5633.html</guid>
  <pubDate>Fri, 06 Nov 2009 02:53:07 GMT</pubDate>
  <title>Haxor&apos;s guide to perfect code</title>
  <link>http://watashi-metan.livejournal.com/5633.html</link>
  <description>I&apos;m trying to learn how to write readable and maintainable code for some time (but often have to deal with very broken one) and here is what I want to highlight for everybody whose code I might be reading in future.&lt;br /&gt;&lt;br /&gt;Most of the people think that programming is a process where you sit in front of computer and type the code. For a most of the cases this is not true. There are sure situations when you sit and write, but most of the time, you need to think first. So the work starts a little bit earlier, usually when you are walking in the park, cooking dinner or taking a shower. When you are sitting in front of the computer you should at least have a general idea.&lt;br /&gt;&lt;br /&gt;Do not create overcomplicated solutions. There are more and less complex problems to be solved, complex problems calls for complex solutions but still they should be clear and understandable. Make the code as simple as possible but not simpler.&lt;br /&gt;&lt;br /&gt;Be consistent. The code you write should be consistent, especially when you are creating library interface. There is nothing more confusing that library with inconsistent interface. When you start using same naming convention, use it in whole project. For example when one data structure has method Delete, similar ones should name it same way.&lt;br /&gt;&lt;br /&gt;Break complicated things into small parts. It&apos;s a good practice to build complicated functionality from small parts with well defined functionality. This is called encapsulation. This way you could think of parts of a code as they are black boxes that does something and the good part is that you don&apos;t need to focus on how it&apos;s done. However sometimes it&apos;s hard to find optimal cuts. In General you should optimize cuts so that your functions are not too long and have small number of parameters. Individual test for every black box is also good idea.&lt;br /&gt;&lt;br /&gt;Avoid meaningless comments in code. Commenting code is good habit indeed but don&apos;t get overexcited, don&apos;t forget that you are writing code not poem. Also quite number of comments comes from silly named functions/variables. It&apos;s always better to name variable as iter_cnt instead of naming it g with comment /* this variable holds number of backwards iterations */. But beware names like my_little_iteration_counter, stay descriptive and short.&lt;br /&gt;&lt;br /&gt;Found a dead end? Sometimes programmer finds out, in the middle of writing code, that one of the assumptions made on start is not correct anymore or wasn&apos;t correct at all, in that case don&apos;t be afraid to use delete key. But beware that delete is a powerful servant but a bad master.&lt;br /&gt;&lt;br /&gt;When speed is not critical it&apos;s sometimes better to optimize for code readability and shortness than for speed. Typical example are initialization runtines that are called once at the start they could be a little bit slower, but on the other hand you should never write code that is way too slow if there is possibility to write it fast enough.&lt;br /&gt;&lt;br /&gt;Okay that&apos;s all for today. May be more to come in the future.</description>
  <comments>http://watashi-metan.livejournal.com/5633.html</comments>
  <category>programming</category>
  <lj:security>public</lj:security>
  <lj:reply-count>4</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/5425.html</guid>
  <pubDate>Wed, 04 Nov 2009 23:40:29 GMT</pubDate>
  <title>lm2576 stepdown and PCB prototyping</title>
  <link>http://watashi-metan.livejournal.com/5425.html</link>
  <description>I&apos;ve finally had some time to write down some electronic howtos, see &lt;a href=&apos;http://metan.ucw.cz/?page=electronics&apos; rel=&apos;nofollow&apos;&gt;http://metan.ucw.cz/?page=electronics&lt;/a&gt;, more to come.</description>
  <comments>http://watashi-metan.livejournal.com/5425.html</comments>
  <category>electronics</category>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/5298.html</guid>
  <pubDate>Tue, 06 Oct 2009 10:59:50 GMT</pubDate>
  <title>Debuggin programs in C</title>
  <link>http://watashi-metan.livejournal.com/5298.html</link>
  <description>Well, I&apos;ve never used to use all the shiny and colorful debuggers. Instead of that using simple printf() was enough in most of the cases. However sometimes the code doesn&apos;t have stdout to print to, or stdout is too bloated with meaningless messages. For that purpose I&apos;ve been using simple library that could redirect debug messages either to file or socket. Lately I&apos;ve been asked by a friend of mine for that functionality. So I&apos;ve put the code on the internet. Follow &lt;a href=&quot;http://metan.ucw.cz/~metan/?page=swhacks&amp;amp;spage=c_prog&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt; to download the library. Note that this is just my internal library and is released as it is but at least it&apos;s a nice example how to use C99 macros with variable number of parameters and va_list.</description>
  <comments>http://watashi-metan.livejournal.com/5298.html</comments>
  <category>c_programming</category>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/4895.html</guid>
  <pubDate>Mon, 14 Sep 2009 17:19:58 GMT</pubDate>
  <title>Widgets for C</title>
  <link>http://watashi-metan.livejournal.com/4895.html</link>
  <description>Lately I&apos;ve been trying to create quite simply application to test evfilter library. For that some drawing into single window with several text boxes is needed, however if you stick to plain C, there are just two possibilities. Either learn GTK+ with all that comes in the way or use SDL and SDL_gfx to draw lines and print text.&lt;br /&gt;&lt;br /&gt;GTK+ GDK and friends are good when you need simple window with button, but is not that easy to create window to draw to. At least there is not too much documentation and the api looks bloated. But I&apos;ve been told about &lt;b&gt;devhelp&lt;/b&gt; and &lt;b&gt;cairo&lt;/b&gt; now.&lt;br /&gt;&lt;br /&gt;SDL is nice for graphics, but there are some issues too. It&apos;s currently limited to single window and SDL_gfx (that&apos;s needed when you are not willing to write functions for drawing lines yourself) has several problems. The most problematic one is that colors are not exchangeable with SDL itself. Just because SDL_gfx has fixed order of colors (RGBA) and SDL just uses the same order as SDL_Surface so on my pretty standard PC there are two different values for the same color accordingly to which library the function comes from. Also naming for functions is not consistent enough and there is no nice namespace as in SDL. Anyway you don&apos;t have all that widget functionality (like in GTK), however in such a simple case it&apos;s rather advantage than disadvantage.</description>
  <comments>http://watashi-metan.livejournal.com/4895.html</comments>
  <category>c_programming</category>
  <category>linux</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/4735.html</guid>
  <pubDate>Mon, 14 Sep 2009 16:49:28 GMT</pubDate>
  <title>lftp now usable alternative to scp</title>
  <link>http://watashi-metan.livejournal.com/4735.html</link>
  <description>Lftp is great command line software to handle ftp functionality. It can handle automatic retry, background jobs and supports ftp, http, ftps, https...&lt;br /&gt;&lt;br /&gt;This week I&apos;ve been told by a friend that lftp supports file exchange over ssh. This could be done either using &lt;b&gt;fish&lt;/b&gt; or by &lt;b&gt;sftp&lt;/b&gt; ssh based subsystem implemented in lftp. To try it just type &lt;i&gt;lftp&amp;nbsp;fish://user@machine&lt;/i&gt; or &lt;i&gt;lftp&amp;nbsp;sftp://user@machine&lt;/i&gt; and you will be prompted for password.</description>
  <comments>http://watashi-metan.livejournal.com/4735.html</comments>
  <category>linux</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/4396.html</guid>
  <pubDate>Mon, 07 Sep 2009 13:01:47 GMT</pubDate>
  <title>evfilter library</title>
  <link>http://watashi-metan.livejournal.com/4396.html</link>
  <description>Good news everyone, evfilter library, that I was working on for a long time, has it&apos;s git repository and documentation.&lt;br /&gt;&lt;br /&gt;Basically it&apos;s library that extends linux input intefrace on the userspace side and makes it easy to develop any application using input devices.&lt;br /&gt;&lt;br /&gt;It also creates filter interface so that events from hardware can be modified/filtered accordingly to configuration.&lt;br /&gt;&lt;br /&gt;For any further information follow: &lt;a href=&apos;http://metan.ucw.cz/evfilter/&apos; rel=&apos;nofollow&apos;&gt;http://metan.ucw.cz/evfilter/&lt;/a&gt;</description>
  <comments>http://watashi-metan.livejournal.com/4396.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/4106.html</guid>
  <pubDate>Fri, 05 Jun 2009 19:55:08 GMT</pubDate>
  <title>pcb_utils on gedasymbols.org</title>
  <link>http://watashi-metan.livejournal.com/4106.html</link>
  <description>My library for generating footprints for pcb is now officially on gedasymbols.org. &lt;a href=&quot;http://gedasymbols.org/user/cyril_hrubis/&quot; rel=&quot;nofollow&quot;&gt;Check it out!&lt;a&gt;&lt;/a&gt;&lt;/a&gt;</description>
  <comments>http://watashi-metan.livejournal.com/4106.html</comments>
  <category>pcb gschem</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/3987.html</guid>
  <pubDate>Sat, 03 Jan 2009 00:43:19 GMT</pubDate>
  <title>pdb2txt</title>
  <link>http://watashi-metan.livejournal.com/3987.html</link>
  <description>I&apos;ve created a set of simple and clean utils for dumping data and content from pdb text document files. The tarball consists of the pdb-reading library and tools &apos;pdbdump&apos; and &apos;pdb2txt&apos;. Pdbdump allows you to see every part of the file or header in human readable format and it&apos;s also an example how to use the library. Pdb2txt is pdb to plaintext decompressor with a lot of sanity checks. Download GPLv2 code here &lt;a href=&quot;http://atrey.karlin.mff.cuni.cz/~metan/?page=swhacks&amp;amp;spage=c_prog&quot; rel=&quot;nofollow&quot;&gt;pdb2txt.tar.bz2&lt;/a&gt;. The code is not finished yet but reading files works pretty well. Compression and ability to save changes are on my long term todo.</description>
  <comments>http://watashi-metan.livejournal.com/3987.html</comments>
  <category>c_programming</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/3621.html</guid>
  <pubDate>Tue, 28 Oct 2008 20:49:57 GMT</pubDate>
  <title>crossdev -t avr</title>
  <link>http://watashi-metan.livejournal.com/3621.html</link>
  <description>Okay here is my struggle with avr-gcc on gentoo. After reading several bugreports you should do:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt; &lt;li&gt;Edit /usr/sbin/crossdev and change &lt;b&gt;line 334&lt;/b&gt; to &lt;b&gt;WITH_DEF_HEADERS=&quot;no&quot;&lt;/b&gt;&lt;/li&gt;&lt;br /&gt; &lt;li&gt;Select version of binutils and gcc (as default ones doesn&apos;t compile) for example  &lt;b&gt;crossdev -t avr --b 2.18.50.0.9 --g 4.1.2 &lt;/b&gt;&lt;/li&gt;&lt;br /&gt; &lt;li&gt; Create symlink for linker scripts on x86_64 use &lt;b&gt;ln -s /usr/x86_64-pc-linux-gnu/avr/lib/ldscripts/ /usr/libexec/gcc/avr/ldscripts&lt;/b&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;</description>
  <comments>http://watashi-metan.livejournal.com/3621.html</comments>
  <category>bugs</category>
  <category>gentoo</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/3337.html</guid>
  <pubDate>Tue, 14 Oct 2008 12:19:43 GMT</pubDate>
  <title>Kexec in debian armel</title>
  <link>http://watashi-metan.livejournal.com/3337.html</link>
  <description>I need kexec to test new kernels (because flashing is too lazy) but there is no kexec-tools for debian armel. So I&apos;ve had no choice but build it myself. I&apos;ve taken debian sid source package and use apt-get to build it, however this fails because file kexec/arch/arm/kexec-zImage-arm.c is using deprecated include asm/page.h. Just changing this to unistd.h works and the compilation could be done after this change. To build this package you need to tweak kexec-tools-20080324/debian/control to include armel architecture. &lt;br /&gt;&lt;br /&gt;Anyway package for sid armel is &lt;a href=&quot;http://atrey.karlin.mff.cuni.cz/~metan/outgoing/kexec-tools_armel.deb&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;See bug &lt;a href=&quot;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=489175&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;.</description>
  <comments>http://watashi-metan.livejournal.com/3337.html</comments>
  <category>spitz</category>
  <category>debian</category>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/3285.html</guid>
  <pubDate>Wed, 08 Oct 2008 19:30:08 GMT</pubDate>
  <title>cheap LCD usb displays III</title>
  <link>http://watashi-metan.livejournal.com/3285.html</link>
  <description>After afternoon of playing with st2205 library code I&apos;ve cleaned the code and more importantly fixed some nasty typos that prevented libst2205 from compiling and working on x86_64 and ppc. Patch against 1.4pre1 is on their wiki in section &lt;a href=&quot;http://picframe.spritesserver.nl/wiki/index.php/Phackv1.4&quot; rel=&quot;nofollow&quot;&gt;download&lt;/a&gt;. Enjoy!</description>
  <comments>http://watashi-metan.livejournal.com/3285.html</comments>
  <category>hardware</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/2955.html</guid>
  <pubDate>Wed, 08 Oct 2008 19:22:57 GMT</pubDate>
  <title>debian on spitz IV: zaurusd</title>
  <link>http://watashi-metan.livejournal.com/2955.html</link>
  <description>This time I wrote small daemon that changes backlight when you press appropriate buttons. Another task will be battery handling, I would like to have some kind of warning when battery is reaching critical level. I quite like idea of flashing with charge LED as my phone does. Anyway here is very small and quite hackish source, but it does what it should and could be easy cleaned. &lt;a href=&quot;http://atrey.karlin.mff.cuni.cz/~metan/outgoing/zaurusd.tar.bz2&quot; rel=&quot;nofollow&quot;&gt;zaurusd source&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Another problems are spitz touchscreen and keyboard. Touchscreen data are noisy (yes I already wrote this) and pressure is clearly reversed. And the code corgi_ts.c looks more or less compatible with ads7846.c which looks much cleaner. I&apos;ll try to merge this two or at least fix corgi_ts.c. Codes the driver assigns to the function keys look more or less random to me and everybody is fixing this by loading keymap in userspace, it would be very nice to fix this.</description>
  <comments>http://watashi-metan.livejournal.com/2955.html</comments>
  <category>spitz</category>
  <category>debian</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/2654.html</guid>
  <pubDate>Wed, 08 Oct 2008 18:55:25 GMT</pubDate>
  <title>/etc/mtab should be obsolete on linux</title>
  <link>http://watashi-metan.livejournal.com/2654.html</link>
  <description>I&apos;ve been wondering why df and friends was showing clearly bogus information in some situations. Imagine you are about to copy some files to usb flash disc for your friend. You insert it into computer, copy files and do unmount or &quot;safe remove&quot;. From this time on, the filesystem doesn&apos;t exist anymore in the kernel, but it&apos;s still in mtab (till caches are flushed and umount returns from unmount() call) Running df will end up (as it uses stafs()) showing informations about another filesystem (most likely /). And there is /proc/mounts for some time providing the same and all the time correct informations. In my opinion applications on linux should be patched to use /proc/mounts instead.</description>
  <comments>http://watashi-metan.livejournal.com/2654.html</comments>
  <category>bugs</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/2512.html</guid>
  <pubDate>Wed, 08 Oct 2008 15:56:55 GMT</pubDate>
  <title>gpim</title>
  <link>http://watashi-metan.livejournal.com/2512.html</link>
  <description>As you know I&apos;ve been playing with touchscreen and console, after some time spending with search for all the possibilities I&apos;ve had a talk with Vojtech (who designed input layer in linux kernel) and after this discussion rewriting gpm from scratch seems to be the most sane decision. So I&apos;ve started to work on this. Here is pre alpha &lt;a href=&quot;http://atrey.karlin.mff.cuni.cz/~metan/outgoing/gpim.tar.bz2&quot; rel=&quot;nofollow&quot;&gt;tarball&lt;/a&gt;. Most of the work is done, now it just needs to add some small features and code cleanup. Project pages will be available soon.</description>
  <comments>http://watashi-metan.livejournal.com/2512.html</comments>
  <category>spitz</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/2116.html</guid>
  <pubDate>Tue, 02 Sep 2008 12:29:11 GMT</pubDate>
  <title>debian on spitz III: tslib &amp; gpm &amp; nano-X</title>
  <link>http://watashi-metan.livejournal.com/2116.html</link>
  <description>I&apos;ve been playing with tslib today. Now X server mouse (configured to use tslib) behaves quite well, sadly code to emulate mouse clicks is not included in my version of xf86-input-tslib. And it looks like Kdrive used in OE uses tslib too. I&apos;m wondering why there is no tslib filter to emulate buttons (and thus this code is duplicated in higher layers), looking into source internal data structures are not supposed to support this. I&apos;ll ask on tslib mailing list if they would be happy with patch.&lt;br /&gt;&lt;br /&gt;Also I would like to have gpm working with tslib, quick googling shows one ugly patch to do this. May be this needs some effort to clean and put into mainstream.&lt;br /&gt;&lt;br /&gt;I&apos;ve successfully build nano-X on spitz, there are some problem with keyboard and mouse (TODO: look for tslib driver for nano-X). However nano-X seems to be stable and fast on this machine, maybe this is way to go. Open problem is xrandr like display rotatiton, I&apos;ll ask on nano-X mailing list.</description>
  <comments>http://watashi-metan.livejournal.com/2116.html</comments>
  <category>spitz</category>
  <category>debian</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/1926.html</guid>
  <pubDate>Mon, 11 Aug 2008 12:17:07 GMT</pubDate>
  <title>cheap LCD usb displays II</title>
  <link>http://watashi-metan.livejournal.com/1926.html</link>
  <description>I&apos;ve bought some Coby dp151 photo frames on Amazone and played a bit with them. Whole communication works trough USB storage driver as reading and writing to the raw device. Software consist of library and command line tools (and patches for mplayer and lcd4linux), compiling didn&apos;t go well because for some reasons -fPIC wasn&apos;t passed while library was compiled (also it&apos;s in Makefile, so it looks like typo but I haven&apos;t time to investigate). After this small fix/hack compilation goes well. Frame was detected with phack. After successful attempt to load modified firmware (there is small typo in the script that&apos;s mentioned on the wiki talk page) I&apos;m still able to communicate to the device, but loading images into the frame is not working, setpic tool segfaults somewhere in the library (Possibly because I&apos;m using 64 bit system). Another problem is that after plugging into the usb port, the device must be manually switched to update mode, so it&apos;s not useable for diagnostic displays. There are some attempts to fix this in the firmware (and it should be quite easy). Just another TODO are buttons, they are not working yet, also I&apos;ve seen some addresses that should be read to check buttons on wiki but as it&apos;s not designed to communicate with PC, it will probably require some polling.</description>
  <comments>http://watashi-metan.livejournal.com/1926.html</comments>
  <category>hardware</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/1590.html</guid>
  <pubDate>Mon, 11 Aug 2008 10:56:44 GMT</pubDate>
  <title>Velleman pocket oscilloscope</title>
  <link>http://watashi-metan.livejournal.com/1590.html</link>
  <description>Some time ago I&apos;ve bought pps10, it&apos;s a small battery powered scope with serial data output to PC. It&apos;s pity you are not able to operate the scope from the PC (and it would be easy task for the manufacturer) but it&apos;s just not possible. Anyway I would like to use it at least as data logger, so I started to write small app that reads data from the scope. I&apos;ve spent some time looking at the data from the scope and realized it looked more like random noise. According to serial cable it looks like optocouplers are powered from the serial port and for some reasons most of the modern serial ports don&apos;t have enough power and because of this some &apos;1&apos; bits are being lost in the communication. It&apos;s very close to working fine just with small (about 4.7uF) capacitor attached to the serial cable (on quite old dell desktop with generic serial ports) and works flawlessly with external power source (even on crappy USB&amp;lt;-&amp;gt;serial converters). Next step is to build USB power cable in order to use pps10 with my notebook. Anyway if you are interested in unix opensource software for velleman scopes, I&apos;m close to finish first version for pps10. I&apos;ll post here link to the project pages soon.</description>
  <comments>http://watashi-metan.livejournal.com/1590.html</comments>
  <category>hardware</category>
  <lj:security>public</lj:security>
  <lj:reply-count>3</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/1332.html</guid>
  <pubDate>Fri, 27 Jun 2008 11:49:13 GMT</pubDate>
  <title>debian on spitz II</title>
  <link>http://watashi-metan.livejournal.com/1332.html</link>
  <description>A quite long time ago I&apos;ve decided to exchange HDD in spitz with CF card. As CF cards are quite cheap, bigger and consume less power it&apos;s IMHO much beter solution. So I made tar of MMC card with debian installed and then untar it into 8GB CF card. The exchange goes cleanly, after removing 6 screws on the back side (two of them are under battery cover) and then removing black back cower I got to the insides. there are four more screws that are holding board with all the chips. They are even marked with arrows on the PCB so that you don&apos;t mount them into holes for the black ones that holds back cower. After removing these screws main PCB can be taken out, there are three cables for touchscreen, keyboard and display that are connected into connectors but if you are skillful hardware hacker, you don&apos;t need to disconnect them, because they all are connected on one side of PCB. On the other side of PCB there is HDD that I wanted to exchange, but before this I needed to remove MMC/SD card slot. It&apos;s clipped on the main PCB with four small plastic pads. All I needed to do was to bend two of them slightly out and remove it. From now on it was all of this in reversed order. Comparing this to changing HDD in iBook it&apos;s piece of cake, I don&apos;t needed three types of screwdriver, no magnetic traps, etc...&lt;br /&gt;&lt;br&gt;&lt;br /&gt;After completing back the machine I&apos;ve pressed the On/Off button and it booted into debian. But as there are no OE scripts anymore keymap was missing. To fix that I&apos;ve did:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;
install kbd
cp /OE/etc/keymap-2.6.map /tmp/
cd /tmp/
gzip keymap-2.6.map
mv keymap-2.6.map /etc/console/boottime.kmap.bz2
/etc/init.d/keymap.sh start
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This fixes the keymap on all for all subsequent boots. This can be also fixed with &quot;loadkeys keymap-2.6.map&quot; temporarily.&lt;br /&gt;&lt;br&gt;&lt;br /&gt;Now here comes history about struggle with various flavors of Xserver. I&apos;ve tried to hack xserver more and here are the results. Mouse still not usable, I had no time for touchscreen hacking, however external usb mouse works fine. I&apos;ve managed to rotate display with Option &quot;Rotate&quot; &quot;CW&quot; parameter to fbdev driver, it worked, but all the drawing is now terribly slow, looks like there is a glitch either in sa1100 framebuffer code or in xserver fbdev driver. And it looks like fbdev doesn&apos;t support xrandr, so no rotation on running X server. That&apos;s bad :(. Keymap is wrong, and xmodmaping suspicious files from OE like slcXXX.xmodmap didn&apos;t really help.&lt;br /&gt;&lt;br&gt;&lt;br /&gt;So I&apos;ve decided to give a try to Kdrive xserver, in debian experimental it&apos;s listed as xserver-fbdev, but only compiled for arm (not armel), ouch. Okay used aptitude to compile these package:&lt;br /&gt;&lt;pre&gt;
#get packages needed for building
apt-get build-dep xserver-xfbdev
#build package
apt-get -b source xserver-xfbdev
&lt;/pre&gt;&lt;br /&gt;And after the night xserver-xfbdev_1.4.99.902-1_armel.deb was build. But It doesn&apos;t work either. All I got from It is:&lt;br /&gt;&lt;pre&gt;
_XSERVTransSocketOpenCOTSServer: Unable to open socket for inet6
_XSERVTransOpen: transport open failed for inet6/haruka-chan:0
_XSERVTransMakeAllCOTSServerListeners: failed to open listener for inet6
Warning: mode not found, using default
error: Invalid argument

Fatal server error:
no screens found
&lt;/pre&gt;&lt;br /&gt;Which doesn&apos;t make any sense to me, just any general error and no logs. However Xfbdev from OE starts well debian with:&lt;br /&gt;&lt;pre&gt;
LD_LIBRARY_PATH=&quot;/mnt/OE/usr/lib/&quot; /mnt/OE/usr/bin/Xfbdev
&lt;/pre&gt;&lt;br /&gt;Looks like the debian package wasn&apos;t compiled the right way. And now I&apos;m wondering if it&apos;s easier to make Xfbdev working or to dive to framebuffer code in xserver and kernel.</description>
  <comments>http://watashi-metan.livejournal.com/1332.html</comments>
  <category>spitz</category>
  <category>debian</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/1124.html</guid>
  <pubDate>Thu, 19 Jun 2008 18:32:29 GMT</pubDate>
  <title>debian on spitz</title>
  <link>http://watashi-metan.livejournal.com/1124.html</link>
  <description>I played recently a bit with Debian and spitz as this machine is in fact faster than my first PC with debian it&apos;s not so silly to try it. I&apos;ve installed Debian on 1GB mmc card via debootstrap, as OE is compiled with new arm binary ABI, architecture must be armel (in case you want to use OE kernel). Then I copied /lib/modules/ from OE to debian, and symlinked /sbin/init to /sbin/init.sysvinit (to be compatible with altboot). Next step was reboot and choosing boot form SD in altboot. Nice it booted well. Network via USB cable worked after modprobing g_ether.&amp;nbsp; Then there was a place for second stage for debootstrap and filling all the basic files like /etc/hostname and /etc/fstab.&lt;br /&gt;&lt;br /&gt;First impression was &quot;wow this works faster that OE with GPE&quot;, running vim in virtual console does not require about 3 seconds to load. Sound works nice, fine, mplayer works too. Xserver works with &quot;fbdev&quot;, modprobing input modules to emulate /dev/mice works but touchscreen seems to be as noisy as it was in collie, i bet it&apos;s the same broken code for ucb12xx/ucb13xx and the coordinates are flipped, so mouse is useless. I need to look again at the ubc1xxx related code, because this is third device where the touchscreen driver is broken. The last time I&apos;ve played with this I changed this code to use interrupts instead of polling and in the end it worked on collie preciselly without any filtering in userspace.</description>
  <comments>http://watashi-metan.livejournal.com/1124.html</comments>
  <category>spitz</category>
  <category>debian</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/951.html</guid>
  <pubDate>Thu, 19 Jun 2008 08:29:09 GMT</pubDate>
  <title>cheap usb LCD displays</title>
  <link>http://watashi-metan.livejournal.com/951.html</link>
  <description>Good news everyone, people started to hack photo frames to act as cheap USB external displays. Currently a few of small ones is supported (&lt;a href=&apos;http://picframe.spritesserver.nl/wiki/index.php/Devices&apos; rel=&apos;nofollow&apos;&gt;http://picframe.spritesserver.nl/wiki/index.php/Devices&lt;/a&gt;). I really would like to have some of the big ones working. I can imagine 9&apos; photo frame as external display for PDA or mounted with tape to ASUS wlan router, there is just to many possibilities.</description>
  <comments>http://watashi-metan.livejournal.com/951.html</comments>
  <category>hardware</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://watashi-metan.livejournal.com/571.html</guid>
  <pubDate>Wed, 18 Jun 2008 12:53:52 GMT</pubDate>
  <title>why I hate blogging</title>
  <link>http://watashi-metan.livejournal.com/571.html</link>
  <description>This is my first attempt to create blog. I don&apos;t like much the ideas about blogging and telling people you don&apos;t know things they don&apos;t wont to hear... However in my opinion there are some valuable (mostly bad) experiences with software and hardware that are not easy to obtain and could save some time if you don&apos;t need to track them down by yourself. I know there is Google and you can get most of them by googling, but Google index these pages too. And as I work as QA for Linux, I get in touch with really scary bugs every day. So lets begin to scare people muhehehe.</description>
  <comments>http://watashi-metan.livejournal.com/571.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
</channel>
</rss>
