tag:blogger.com,1999:blog-62738186848314543062024-03-18T11:48:25.542+02:00cat **/*Akshaalhttp://www.blogger.com/profile/05677582369584740657noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-6273818684831454306.post-20849940761418588312009-03-14T20:36:00.004+02:002009-03-14T21:22:42.397+02:00Linux Kernel for Fujitsu-Siemens Loox N560/C550 with support for CPLD and builtin ledsI've implemented support for CPLD and leds. htc-gpio driver is used with a custom list of CPLD registers/resources for Fujitsu-Siemens Loox 5XX (N560/C550). Now CPLD interface is available for all other drivers (existing and planned) of the linux/android kernel.<br /><br />It is interesting how CPLD is implemented in the linux kernel. Actually CPLD is a chip that supports very simple custom logic (and that is the reason why it is much faster than CPU). CPLD chip has a set of input pins and output pins. All these pins are mapped to a region of memory address space. The most important work with CPLD is that modifying values of pins to control devices. This is done setting a value to 0 or 1. In fact, programming of GPIO (general purpose input/output of CPU) is done in the same way: a programmer writes code that sets a GPIO pin to either 0 or 1. Linux kernel already has support for GPIO which provides a set of functions for platform drivers. In addition, GPIO driver provides a way to map any virtual GPIO pin to some custom code that is responsible for handling of setters and getters for the mapped pins. And indeed, that is how htc-egpio driver does the job. The driver leverages gpiolib mapping CPLD registers to GPIO pins. Thanks to this approach, no addition functions are required to work with CPLD. It is enough to use gpio_set_value/.. methods.<ad2></ad2><br />After the CPLD driver had been implemented, it was possible to implement a driver for the leds of Loox N560/C550. The leds driver, I implemented, exports a set of functions that other drivers (wifi, gps, bluetooth, pm, ...) are supposed to use to control the leds. Also, the leds driver makes it possible to control the leds from userspace (shell scripts, java program, ...) using files under sysfs filesystem.<br /><br />The following is the list of files exported by the leds driver and the possible content values for the each file:<br /><b>/sys/devices/platform/loox5xx-leds.1/keyboard</b>: on, off, any<br />- backlight for keyboard<br /><br /><b>/sys/devices/platform/loox5xx-leds.1/left_green</b>: on, off, any<br />- green led on the left side. WM5 indicates WiFi activity with this led<br /><br /><b>/sys/devices/platform/loox5xx-leds.1/left_blue</b>: on, off, any<br />- blue led on the left side. WM5 indicates Bluetooth activity with this led<br /><br /><b>/sys/devices/platform/loox5xx-leds.1/left_orange</b>: on, off, any<br />- orange led on the left side. WM5 indicates GPS activity with this led on Loox N560<br /><br /><b>/sys/devices/platform/loox5xx-leds.1/right_green</b>: on, off, any<br />- green led on the right side. WM5 allows programs to control this led using winapi.<br /><br /><b>/sys/devices/platform/loox5xx-leds.1/right_orange</b>: on, off, blink, any<br />- orange led on the left side. WM5 indicates charging activity with this led<br /><br />Where:<br /><b>on</b> - the led is on regardless of the kernel activity,<br /><b>off</b> - the led is off regardless of the kernel activity,<br /><b>blink</b> - the led is blinking regardless of the kernel activity,<br /><b>any</b> - the led is controlled by the kernel.<br /><br />For instance, if the content of the right_orange file is set to 'on', then the orange led (on right side of PDA) will be on no matter what you do: plug or unplug your device to/from a cradle. The driver will hold on the state of the led until, you write 'any' into the file right_orange. With 'any' value in file, the first 'power' event will change state of the led. The interface of the driver makes it possible to implement any notification (low battery, new mail..) effects you can imagine involving all leds of the device. The following script demonstrates how to blink with the keyboard backlight led:<pre><br />while true;<br /> do echo on > /sys/devices/platform/loox5xx-leds.1/keyboard;<br /> sleep 0.1;<br /> echo off > /sys/devices/platform/loox5xx-leds.1/keyboard;<br /> sleep 0.1;<br /> # Condition for break...<br />done<br />echo any > /sys/devices/platform/loox5xx-leds.1/keyboard;</pre><br />The current patch for the android cupcake kernel is located <a href="http://downloads.akshaal.info/linux-n560-c550/c550-android-kernel-2009-03-14.patch.gz?attredirects=0">here</a>.<br /><ad></ad>Akshaalhttp://www.blogger.com/profile/05677582369584740657noreply@blogger.com1tag:blogger.com,1999:blog-6273818684831454306.post-82714583204525958002009-03-08T12:56:00.004+02:002009-03-08T13:29:41.873+02:00Linux Kernel for Fujitsu-Siemens Loox N560/C550 with usbnet workingAfter 3 days of struggle I am finally able to build a linux kernel for my PDA Fujitsu-Siemens Loox N560. The kernel has been downloaded from <a href="http://www.asm32.ru">http://www.asm32.ru</a> and patched (pxa27x_udc.c) to support for usbnet (host-to-PDA networking through a usb coard). Also I've made a diff file with differences between the current cupcake kernel and the kernel (by date 02-mar-2009) from asm32.ru site. That will be useful later when I need to apply support for Loox to a new upstream cupcake kernel. <a href="http://downloads.akshaal.info/linux-n560-c550/c550-android-kernel-2009-03-07.patch.gz?attredirects=0">Here is the patch</a> which also includes support for usbnet on Loox C550/N560. The patch already contains a kernel configuration file (.config), but usbnet support is not enabled there. <a href="http://downloads.akshaal.info/linux-n560-c550/linux-config-2009-03-07?attredirects=0">Here is the other .config file</a> which is differ from that included in the patch by supporting usbnet, having power management switched off and configuration for larger fonts in console.<br /><br />It is possible to build the kernel with any toolchain for arm of your choice. I've tried crosstool-ng, emdebian and the one that is included in the android repo. I have decided to leverage emdebian toolchain for I use debian on my PC. The following is the command to build the kernel using emdebian toolchain:<pre>make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-</pre>Of course you have to have emdebian toolchain installed. You can install emdebian something like it is shown below:<pre><br />apt-get install emdebian-tool<br />emsetup --arch arm</pre>Then add:<pre><br />deb http://www.emdebian.org/debian/ unstable main</pre><br />into your /etc/apt/sources.list and run:<br /><pre>apt-get install linux-kernel-headers-arm-cross gcc-4.2-arm-linux-gnu</pre><br />When the kernel is built and ready you can copy it on an SD card and run it with haret with the following default.txt:<pre><br />set MTYPE 1454<br />set KERNEL zImage<br />set CMDLINE "root=179:2 mem=60M rootdelay=3 boot_delay=0 init=/init console=tty0 fbcon=rotate:0 androidboot.console=tty0 android.checkjni=1"<br />set RAMADDR 0xA0200000<br />bootlinux</pre><ad></ad>That is important! When you've placed zImage on an SD card, you will insert the card in your PDA. And then you must reboot your PDA! And only after you have rebooted your PDA with the SD card inside, you should ask haret to boot linux. That is very important because a linux kernel will not be loaded correctly (or it will but with only 10% chances) if one of the following conditions is true:<br />1. PDA has fallen asleep or suspended.<br />2. You have just inserted an SD card in your PDA and not rebooted it yet.<br />It looks like it is a bug in wince...<br /><br />P.S. There you can download cupcake kernel <a href="http://source.android.com/download"> http://source.android.com/download</a><br /><br />P.P.S. When you build kernel with usbnet, don't set CONFIG_USB_ETH_RNDIS to 'y'! Or your PC kernel (2.6.x) will not find your PDA... neither cdc_ether nor cdc_subset will claim your PDA.Akshaalhttp://www.blogger.com/profile/05677582369584740657noreply@blogger.com5tag:blogger.com,1999:blog-6273818684831454306.post-34041073821500199512007-05-26T17:58:00.003+03:002009-02-22T17:27:43.683+02:00Recovering of Encfs PasswordWhew. I've found all forgotten passwords for encfs with a help of the perl script:<br /><br /><pre><br />#!/usr/bin/perl<br /><br />use strict;<br />use warnings;<br /><br /># these words are used as password components<br />my @words = (<br /> "example", " ", "word", "123", "666", "pwd", "part1"<br /> );<br /><br />my @l = ();<br /><br />sub mindex {<br /> my $x = shift;<br /><br /> for (my $i = 0; $i <= $#words; $i++) {<br /> if ($words[$i] eq $x) {<br /> return $i;<br /> }<br /> }<br /><br /> return -1;<br />};<br /><br />sub inc {<br /> my $p = shift;<br /> my $v = $l[$p];<br /><br /> unless (defined $v) {<br /> $l[$p] = $words[0];<br /> } else {<br /> my $i = mindex ($v);<br /> if ($i == $#words) {<br /> $l[$p] = $words[0];<br /> inc ($p+1);<br /> } else {<br /> $l[$p] = $words[$i+1];<br /> }<br /> }<br />};<br /><br />while (1) {<br /> inc (0);<br /> my @ll = reverse @l;<br /> my $pwd = join '', @ll;<br /><br /> open F, ">/tmp/1233";<br /> print F "pwd\n";<br /> close F;<br /><br /> print "$pwd\n";<br /> system "encfs -S /tmp/encfsdir /tmp/mountpoint < /tmp/1233";<br />}</pre><br /><ad></ad><br />You may use it if you still know a vague shape of password you have lost.Akshaalhttp://www.blogger.com/profile/05677582369584740657noreply@blogger.com1tag:blogger.com,1999:blog-6273818684831454306.post-46402603789179128632007-04-18T19:49:00.001+03:002009-02-22T17:28:40.130+02:00Sat UndergroundIndeed, there is a sad situation. If you want to watch Pay-TV you are going either to buy smart-card or to find a way to hack it. But you can't just hack it yourself. It is so much sophisticated, you need expensive equipment (card reader at least and card itself) and a HUGE amount of time. On one hand, it is obvious, if information concerning protocols/encryptions has been made public, soon it will be used by geeks to watch TV for free (if they have time for it at all). The number of geeks is vanishingly small and this amount of freebie-junkies doesn't affect a compony's income. Yet on other hand, it reveals ability for people to make illigal-cards and sell them. But it is still hard-core business. So what have we actually? Sadness and grief, that is what we have actually. Groups of commercial hackers fight each other for place under the sun. When one group has made enough money, it publishes algorithm and an EMU. EMUs are made as easy as everybody could use it! It hurts a cash of TV providers and they changes algorithm of encryptions as soon as possible... What can one do alone? The one can start from scratch inventing all wheels along a way of hacking. Or the one can join one of hacker-groups, having his worthy proved. I want to digg inside a new TPS algo, but I don't want to invent old wheels, spending my time :(. Money is evil!<ad2></ad2>Akshaalhttp://www.blogger.com/profile/05677582369584740657noreply@blogger.com0