Archive

Posts Tagged ‘open source’

gnuProload : Or how I stopped asking for the sources and wrote my own software.

September 14th, 2008

This incident happened about 2 months back. But I felt it was worth sharing for all those Open Source advocates.

I am an embedded hobbyist and in my free time, like to create small stuff, like digital clocks and room temperature indicators etc. (Yeah, I shall post my creations here too, in a while).

I use an AT89S52 for most of my projects, which is based on the popular Intel 8051 core, introduced more than 25 years ago. To program my micro I purchased a small low cost development board along with an ISP(In-System-Programmer) board from Sunrom Technologies(www.sunrom.com).

The ISP board connects to the micro in the development board at one end and at the other end, it connects to my PC serial port. Sunrom also provided a windows based software called Proload which could ‘talk’ the same language as the ISP board could understand and using Proload I used to ‘Burn’ my programs into the micro for my projects.

So far so good. The problem came when I yearned for good ol’ Linux. The problem was, there was no alternative to Proload on Linux for me. Although there were alternatives for the compiler/assembler suite (http://sf.net/projects/sdcc), but as far as the ‘Burning’ software was concerned, it appeared as though I was stuck with windows for eternity.

I contacted the Sunrom representatives asking for the source code to their Proload software but they too did not respond to my email. It was then that I decided to take the matter into my own hands and realized that enough was enough.

So first thing I did, was post in various forums to see if someone had already created what I wanted to create. After all, I was more inclined to use a ready-made piece of software rather than spend hours trying to duplicate someone else’s effort. But to my disappointment, I found none. In fact, I was also chided in one of the forums saying I should have thought about Linux when I purchased my development board. But I explained that when I purchased my board, Linux was not my priority. I needed a development platform with as little investment as possible.
Anyway, so after that, I set out to create my Linux clone of Proload. But how to decipher the secret protocol that it spoke? It was then that the idea of using a Serial port sniffer dawned upon me.

I got myself a trial version of this sniffer software and after a few snooping sessions, I had my data and from it I was able to reconstruct the ’secret’ language of Proload. After that it took another hacking weekend to come up with my own version of Proload, that ran on Linux. So in true open source spirit, I called it gnuProload. It was text based but it was able to do its job. Yippee! I finally did it ! I was now able to do all my embedded development over Linux!

But that was not the end of the story. I am sure you will be intrigued with what I am going to write below.

I decided to share my creation with the rest of the world. That meant two things. First, I would have to create a GUI version of gnuProload (to appeal to a wider audience) and secondly, I would have to take permission from Sunrom to allow me to release the Linux version of Proload. For the first one, I learnt GTK+(www.gtk.org) and started working towards creating the GUI for gnuProload. For the second one, I got hold of the representative who sold me the development board and the ISP board and explained him the situation over phone. I didn’t tell him though that I had already managed to crack open Proload and see it guts for obvious reasons ;-). So very plainly I asked him to give me the sources and also very sincerely offered to sign a non-disclosure agreement to not to share their windows based Proload with anyone else.

Well, needless to say, my request to have a look at their source code was denied, but what the representative told me next surprised me even more.

He told me that, even Proload was not their IP entirely. It seems that Proload was based on the protocol which was developed by a Prof. in a Thailand University, Mr. Wichit Sirichote.(http://www.kmitl.ac.th/~kswichit%20/howeasy2work/howeasy2work.html). So it turned out, Prof. Sirichote was the right person to approach for permission to port his stuff into Linux. And he gladly agreed! And moreover, his protocol was never ported to Linux before, so my effort to port Proload into Linux was not wasted after all.

And so it turned out, I had not reverse engineered a windows software, (in the strictest sense, I agree though it was reverse engineering ). I had rather discovered the true origins of Proload, which lay in some obscure lab in Thailand. In my opinion, trying to reverse engineer a piece of software which uses an openly published protocol does not and should not count as ‘true’ reverse engineering.

So, with my conscience happy, (that I did not do anything illegal) I was finally able to come up with gnuProloadV2.0(V1.0 was the original command line version). I posted this in sourceforge and as of now, it is available for free download to anyone: www.sf.net/projects/gnuproload .

So, this is the story of how I stopped asking for the sources and wrote my own software. And today, I am happily hacking on 8051 code over my Linux box and creating stuff. Here is a nice looking screenshot of gnuProload in action ;-)

gnuProload in action over Linux.

gnuProload in action over Linux.

Hope you enjoyed reading my eventful post. If you have (or even if you haven’t) do leave in a comment.
See you around!

~Seemanta

admin Embedded Hobbyist, My Creations, Tech , , ,