Jan 272012
 
Rooting your Milestone 2

Without any good reason and no actual need and more for because-I-am-curious, I rooted my Milestone 2 (v2.3.4).

Instructions came mostly from here which pointed me into the right direction:

The actual commands I used were:
  1. Turn on the USB debugging on the Milestone: Settings/Applications/Development/USB Debugging must be checked
  2. Connect Milestone 2 via USB to my Linux machine
  3. Run “adb devices” as root. This starts the adb local server which connects to the phone via USB.
  4. adb push Exploit/zergRush /data/local/tmp
  5. adb shell
  6. cd /data/local/tmp
  7. chmod 777 zergRush
  8. ./zergRush
It’s fun to watch and in the end it said it has done its deed, and it closes the adb shell.
Back on the Linux machine:
  1. adb kill-server
  2. adb devices
  3. adb shell
and I had the # prompt in front of me. It’s that easy.
Now making it permanent:
  1. See what block device is used via: cat /proc/mounts
  2. In my case /system is mounted from /dev/block/mmcblk1p21
  3. mount -o remount,rw /dev/block/mmcblk1p21 /system
  4. exit
  5. adb push Dependencies/busybox /system/bin/busybox
  6. adb push Root/su-v2 /system/bin/su
  7. adb install Root/Superuser.apk
  8. adb shell
  9. chmod 4755 /system/bin/busybox
  10. chmod 4755 /system/bin/su
  11. mount -o remount,ro /dev/block/mmcblk1p21 /system
  12. exit
  13. adb reboot

The phone reboots here and it’s done. Next time I log in via “adb shell” I simply type “su” and I am root.

 

Jan 152012
 
Programming AVRs - Part 2

I used to use the FT245R chip to program my AVRs but I was looking for something more comfortable. Like the Bus Pirate. Works great. No special configuration needed for avrdude. Simply say it’s using now a Bus Pirate and which USB port it shows at.

 

Update: It’s too slow, so I flashed the STK500v2 firmware, which means I tell avrdude I got an STK500v2. While it loses all the features of the real Bus Pirate, it’s magnitudes faster (and I have the AVR extended patches and updated the Bus Pirate firmware to 6.1, but it was still too slow for larger programs).

Jan 072012
 
CrashPlan - Another attempt to do proper backups

As I wrote here I am using Wuala. I mostly like it. I don’t like not be anymore able to give away some storage space for others and in return be able to use other people’s storage space. It was a neat point of Wuala, but that was “fixed” last year, and then it’s either pay or stop using it (beside the small initial space everyone gets).

Welcome to CrashPlan. It’s quite similar compared to Wuala but with 2 differences which I like a lot:

  1. You can back up to your own disks or friends disks
  2. If you pay, it’s unlimited data and deleted files are kept

That sounds like a good deal, but with prices for 2TB disks (even after the disaster in Thailand) at about US$150, it probably works out fine for them.

I’ll have to test this a bit more, but so far, it looks like a good backup method. Time to upgrade our ADSL line…

PS: Picture taken from the Italian Wikipedia.

 

 Posted by at 21:58  Tagged with:
Jan 032012
 
More 16 Segment LED Fun

I continued to look for a 16 Segment Font, alas, there seems to be none. The best I found are two videos on YouTube. So I finally made my own one, and for the benefit of the world, here the code for all printable 96 ASCII characters:

#include <avr/pgmspace.h>

// Segment bit order is (MSB) A1 A2 B C D1 D2 E F G1 G2 H I J K L M (LSB)
const uint16_t uiCharacterMap[96] PROGMEM =
{
 // SPACE ! " # $ % & '
 0x0000, 0x0300, 0x0110, 0x0fd2, 0xddd2, 0x95db, 0x8eb4, 0x0010,
 // ( ) * + , - . /
 0x000c, 0x0021, 0x00ff, 0x00d2, 0x0001, 0x00c0, 0x0004, 0x0009,
 // 0 1 2 3 4 5 6 7
 0xff09, 0x3008, 0xec41, 0xdc48, 0x01d2, 0xcd84, 0x1fc0, 0xc00a,
 // 8 9 : ; < = > ?
 0xffc0, 0xf1c0, 0x8080, 0x8081, 0x0c09, 0xc0c0, 0x0c24, 0xe142,
 // @ A B C D E F G
 0xfe83, 0x3049, 0xfc52, 0xcf00, 0xfc12, 0xcfc0, 0xc3c0, 0xdf40,
 // H I J K L M N O
 0x33c0, 0xcc12, 0x3e00, 0x038c, 0x0f00, 0x3328, 0x3324, 0xff00,
 // P Q R S T U V W
 0xe3c0, 0xff04, 0xe3c4, 0xddc0, 0xc012, 0x3f00, 0x0309, 0x3305,
 // X Y Z [ | ] ^ _
 0x002d, 0x002a, 0xcc09, 0x8b00, 0x0024, 0x7400, 0x0120, 0x0c00,
 // ` a b c d e f g
 0x0020, 0x8e92, 0x0b82, 0x0a80, 0x0e92, 0x0a81, 0x40d2, 0x8992,
 // h i j k l m n o
 0x0382, 0x0a00, 0x0812, 0x001e, 0x0412, 0x12c2, 0x0282, 0x0a82,
 // p q r s t u v w
 0x8390, 0x8192, 0x0280, 0x0444, 0x04d2, 0x0e02, 0x0201, 0x1e02,
 // x y z { | } ~ DEL
 0x002d, 0x3450, 0x0881, 0x4492, 0x0012, 0x8852, 0x0128, 0x00ff
 };

Note the PROGMEM extra attribute which is helpful on a Harvard CPU like the ATmega are. Without it, the table will be copied and used in RAM. 192 Byte in total does not sound too bad, unless you use an ATmega168 which has only 1 kByte. To access this type of special memory, you need the include file and to access the array, a special function is needed:

a=pgm_read_word_near(&(uiCharacterMap[i]));

It’s all documented here. On a normal CPU (more RAM, no Harvard architecture) you would not bother.

I thought about adding “spinning things”, but those are trivial to make and I thus leave those as an exercise to the reader.