Thursday, June 9, 2011

Reverse Engineering: Developing a device driver for Linux

Reverse engineering is the most used way to develop a device driver for Linux. If you are interested to write a program to support your unknown driver in Linux, at least you need an average programming capability in C language.

Some useful links:

Introduction to Reverse Engineering Software
www.acm.uiuc.edu/sigmil/RevEng

Learning how to reverse engineer a Windows USB driver
www.jespersaur.com/drupal/book/export/html/21


Processing: Web-cam capturing in Linux

Processing is an open source and cross-platform programming language and integrated development environment (IDE). It is especially used for teaching the basics of computer programming.
Website:
http://processing.org

To capture a web-cam with processing there is a standard video library.
However it requires pre-installation of Quicktime and WinVDIG.

It seemed quite difficult for me to run this way video capturing in Linux.
Finaly I found an additional library GSVideo.
Website:
http://gsvideo.sourceforge.net

It works very similar to the standard video library. Plus it does not require pre-installation of Quicktime & WinVDIG, and works in Linux platform as well.

Below simple example shows the differences of standard video library and GSVideo library.



// Capturing web-cam with standard video library.
// It requires pre-installation of QuickTime and WinVDIG.
// Hard to use in Linux platform.

import processing.video.*;
Capture camera;

void setup(){
size(320, 240);
camera = new Capture(this, 320, 240, 12);
}

void draw(){
image(camera, 0, 0);
}

void captureEvent(Capture camera){
camera.read();
}



// Capturing with GSVideo library works cross-platform.
// It only requires additional GSVideo library as below directory order;
// <processing>/sketchbook/libraries/GSVideo
// Visit gsvideo.sourceforge.net for reference information.

import codeanticode.gsvideo.*;
GSCapture camera;

void setup(){
size(320, 240);
camera = new GSCapture(this, 320, 240);
camera.play();
}

void draw(){
image(camera, 0, 0);
}

void captureEvent(GSCapture camera){
camera.read();
}



It worked very well for me.
Hope this post helps someone else in similar case :)


Friday, June 3, 2011

Display or print Japanese fonts within a pdf file in Ubuntu/Linux Distribution

I had a problem to display/print Japanese fonts in a pdf file in my Ubuntu 10.04 distro. Evince did not display nor print the Japanese fonts. Adobe Reader displayed correctly however it did not print the Japanese fonts.

Installing the package poppler-data fixed those problems. It is available in Ubuntu package manager.

Prior of installing the package poppler-data, I realized that Foxit PDF reader was already rendering the Japanese fonts very well. Therefore I also recommend installing Foxit PDF Reader.

Foxit Reader for Linux:
http://www.foxitsoftware.com/pdf/desklinux/download.html