Sunday, September 05, 2010

Debugging the Linux kernel with JTAG

My new article about debugging the Linux kernel with JTAG in Embedded Systems Design magazine
Debugging the Linux kernel with JTAG

Thursday, April 29, 2010

FemtoLinux

My new initiative - low latency embedded Linux web site is up and running at www.femtolinux.com.

Our goal is to reduce Linux interrupt-to-application latency (that's correct, not just interrupt latency) to the same numbers that RTOS such as VxWorks deliver, i.e. 10μs.

Labels: ,

Saturday, December 19, 2009

Dr. Dobb's | Selenium: Cross-browser Website Testing

My new article about Selenium web application testing framework at Dr. Dobb's Journal.

Selenium Remote Control (RC), a tool that lets you programmatically simulate user behavior, launch a browser, open a URL, type some text, click on a button, wait for the web site response and check the browser state. Although implemented in Java and Javascript, Selenium RC supports a variety of languages for test programming, including Java, C#, Perl, Python, and PHP. And last but not least, Selenium is a free open source project with a large and active community of developers and website testers.

Sunday, September 20, 2009

Using Java Robot to type text strings

The Java Robot class is very useful for automating various tasks that normally require user interaction. However, it lacks a rather simple but useful feature - it cannot type a string of text, just a single key code. I had to implement this when I worked on one of my projects and to my surprise an extensive googling session showed that quite a lot of people are looking for such functionality.

The SmartRobot class below extends the standard Java Robot class adding to "type(String text)" and a few other useful methods:
import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;

public class SmartRobot extends Robot {

public SmartRobot() throws AWTException {
super();
}

public void keyType(int keyCode) {
keyPress(keyCode);
delay(50);
keyRelease(keyCode);
}

public void keyType(int keyCode, int keyCodeModifier) {
keyPress(keyCodeModifier);
keyPress(keyCode);
delay(50);
keyRelease(keyCode);
keyRelease(keyCodeModifier);
}


public void type(String text) {
String textUpper = text.toUpperCase();

for (int i=0; i<text.length(); ++i) {
typeChar(textUpper.charAt(i));
}
}

private void typeChar(char c) {
boolean shift = true;
int keyCode;

switch (c) {
case '~':
keyCode = (int)'`';
break;
case '!':
keyCode = (int)'1';
break;
case '@':
keyCode = (int)'2';
break;
case '#':
keyCode = (int)'3';
break;
case '$':
keyCode = (int)'4';
break;
case '%':
keyCode = (int)'5';
break;
case '^':
keyCode = (int)'6';
break;
case '&':
keyCode = (int)'7';
break;
case '*':
keyCode = (int)'8';
break;
case '(':
keyCode = (int)'9';
break;
case ')':
keyCode = (int)'0';
break;
case ':':
keyCode = (int)';';
break;
case '_':
keyCode = (int)'-';
break;
case '+':
keyCode = (int)'=';
break;
case '|':
keyCode = (int)'\\';
break;
// case '"':

// keyCode = (int)'\'';

// break;

case '?':
keyCode = (int)'/';
break;
case '{':
keyCode = (int)'[';
break;
case '}':
keyCode = (int)']';
break;
case '<':
keyCode = (int)',';
break;
case '>':
keyCode = (int)'.';
break;
default:
keyCode = (int)c;
shift = false;
}
if (shift)
keyType(keyCode, KeyEvent.VK_SHIFT);
else
keyType(keyCode);
}

private int charToKeyCode(char c) {
switch (c) {
case ':':
return ';';
}
return (int)c;
}
}


The code can be downloaded here

Labels: , , , , , ,

Wednesday, October 15, 2008

Hebrew for Motorola RAZR2 V8

RAZR2 V8 is not sold officially in Israel and according to Motorola it has no Hebrew support. Fortunately, as it often happens, they (Motorola) don't really know what they are talking about. Although there is no LP0033 (Language Pack 0033) which usually includes Hebrew support, LP0034A which can be downloaded here includes, among other languages, Hebrew fonts!

Enjoy.

Update 0:
It appears that LP0034A does not include full Hebrew language support, just the Hebrew fonts (which is enough to read Hebrew text messages).

Update 1:
If you do not know how to transfer the language pack to your phone google for RSD Lite utility.

Labels: , , ,

Saturday, September 06, 2008

Never use DriveImage XML for backup

DriveImage XML looks very nice - it's free, has a simple and easy-to-use menu, supports all the features that you would normally need to backup your system:

  • Can backup drive that it (and Windows) is running from
  • Available as Bart PE module and can be easily integrated into Bart PE bootable CD or USB flash drive
  • And more


It's a charming piece of software, until you actually have to use it to restore you backup. Then you suddenly discover that it is almost impossible to restore you backup!

First, it does not really support multiple CD/DVD media. This is especially frustrating, as during backup it creates multiple image chunks of 650MB size, which makes you think that it will be able to restore the drive from multiple CD media. Bummer! When you try to do so, you get “error reading from Compressed stream” message.

Second, it can restore to existing partition only, however during the restore process it destroys that partition and if the restore fails - you have to recreate this partition using some other software.

And, when and if you somehow manage to restore the image you discover that it's not bootable. But this is easy to fix with fdisk (just make the restore partition active), provided you have a bootable CD/USB with relevant utilities.

To summarize, if your backup does not fit into a single DVD media, you can only use DriveImage XML to restore from network drive (or physically connect you faulty drive to another PC).

OR better yet, use a different backup software.

Actually, this is an interesting marketing strategy - most people use backup software to backup only, restores are rare. So it pays off to invest in backup features and neglect almost entirely restore functionality.

Labels: , ,

Wednesday, September 03, 2008

How to boot Windows XP from USB flash drive

This stuff is not exactly new, but nevertheless quite useful, as it appears that there are lots of contradictory and quite complex guides on the subject.

The truth is that it is quite simple to make bootable WinXP USB drive (at least it worked like a charm for me and it would be interesting to learn about other people's experiences on different hardware).

Prerequisite:


Instructions:

  • Download and install BartPE bulder and PeToUSB
  • Run BartPE, follow the instructions to create Windows PE installation
  • Run PeToUSB, follow the instructions to format the USB drive and copy Windows PE files


That's it!

Labels: , , , , ,