Embedded Systems Software, Computer Networking and Geeky Fun

nerd1951.com

March 30, 2008

Examples, Tutorials, and How-to’s; Oh my!

Filed under: Tools, Rants, Programming — Harvey @ 5:09 pm

The Web is a wonderful place to find software documentation; how-to’s, tutorials, and user’s manuals. The problem is like most resources on the Web, you need to sift through a lot of stuff to find what you’re looking for – or what actually works.

I’m working on a project right now where I need to develop a GUI for a Linux application. In the past I would have used Java Swing but it’s been so long since I’ve done this kind of work that it’s like starting from scratch. So, I decided to learn a GUI programming library and development tool that I could use from C/C++ as well as a scripting language or Java. I decided on GTK+ and Glade after doing some research. GTK+ is the GIMP Tool Kit used to develop the GUI for GIMP, the GNU Image Manipulation Program. It’s kind of like Photoshop without the price tag. GTK+ has a C API but a library, libgtkmm, provides C++ wrappers for GTK+. Glade is a graphical GUI development tool. It allows you to build up a GUI by dragging and dropping the graphical objects you need to build up you GUI.  Finally, a library, libglademm, hooks up the output from Glade to libgtkmm.

The next step was to find some documentation, tutorials, and examples on the Web. I found some easy “Hello World” examples that didn’t really help much. I also found some very complete documentation but the author was really intent on me learning autoconfig, automake, and libtool. Now I’m sure learning these tools would be good for me in the long run but right now I’m on a deadline. Researching these tools I found a bunch of outdated examples that wouldn’t work on my up-to-date Linux environment. I finally found a quick how-to that was complex enough to be useful but didn’t require me to learn a bunch of other tools: A simple libglademm application. The example application is a simple calculator. It demonstrates the basics of building a GUI using Glade and then writing the C++ code behind it that makes it work.

I ran into some other outdated how-to’s this weekend. I was helping a friend set up Embedded Linux on an ARM evaluation board. The manufacturer actually provided a very complete build of GNU tools for their processor and Linux 2.6 build source for their development board. The problem was that there were too many how-to’s on the site – mostly outdated. Some of the older ones were just plain wrong or referred to links on their web site that no longer exist. The most up-to-date and correct documentation was buried in their file downloads and you had to hunt around to find everything. Once we found the right downloads and documentation, the build went smoothly with the exception of one minor glitch.

By the way, this is not to say that commercial software is better. Commercial software is often worse with even harder to find documentation and even more outdated material. Often you need to buy a book to make up for the lack of documentation that comes with the product.

So here’s my message to all of you great people who provide open source software: please delete your obsolete documentation, and to paraphrase Einstein; “Keep it a simple as possible but no simpler.”

Finally, I have to say, that I think Glade, Gtk+, libglademm, and gtkmm are great!

• • •
 

March 25, 2008

More car-free insanity

Filed under: News, Geeky Fun, Rants — harvey.sugar @ 3:05 pm

It’s hard to believe that I’ve been pursuing a car-free lifestyle for almost two years now. I need to explain that a car-free lifestyle doesn’t mean that you never drive anywhere. Some places really are difficult to reach without a car and if you need to move something heavy any distance, you need some kind of vehicle. To me, living car-free means not using a car for your every day trips, primarily commuting to work and shopping.

Living car-free became more of a challenge when I moved at the end of January. The distance to work changed from six miles to twenty five miles. On a good day I could drive this in about 35 to 45 minutes. If there’s an accident or the weather is bad, it could be much longer.

Using the subway and bus, it takes me a little more than an hour and a half. But I use most of that hour and a half. Being stuck in a subway or on a bus with nothing to read but Stroustup’s The C++ Programming Language has motivated me to read it from cover-to-cover. Something I would never have done otherwise. I’ve always just read bits and pieces for reference. Reading the entire book, I uncovered many nuggets of C++ wisdom that have paid off in my work daily. I’ve also been able to do quite a bit of writing while riding to work.

I can also bike part of the way to work and bus the rest. This is still the same hour and a half commute but I get a good 15 or 16 miles of biking in, mostly on hiker-biker trails away from the traffic.

Where I live now, I’m only a mile from restaurants, supermarkets, movie theatres and all kinds of stores. Almost everything I need is within walking or biking distance. If I want to down town DC, I’m only a half mile from the Metro station.

So, while I call this car-free insanity, as I watch the price of gas creeping closer to four bucks a gallon, it doesn’t seem so crazy.

• • •
 

March 24, 2008

Building GCC Cross-Compilers on Ubuntu Linux

Filed under: News, Tools, Programming — harvey.sugar @ 7:46 am

I’ve been using Ubuntu Linux for about a year now and have been quite happy with it. I use to use Fedora but I have had problems with the recent releases running on new hardware. Ubuntu seems to have better hardware support. The other big difference is that Ubuntu takes a minimalist approach in their distribution, providing the minimum useful system on the distribution CD. All the optional packages you may want are provided on Ubuntu and Debian Linux web sites. Ubuntu provides a software package manager that takes care of downloading and installing what ever software packages you may select.

The one problem that I have had with Ubuntu is that I could not successfully build GCC cross-compilers on the latest release, Ubuntu 7.10. I use and excellent script called crosstool to build cross-compilers. Crosstool has always worked fine before for me, even on earlier releases of Ubuntu. Finally, in desperation, I checked the crossgcc mailing list (reminder to self: RTFM!). The answer was there and was quite simple. It seems that on Ubuntu 7.10, /bin/sh is linked to /bin/dash. I didn’t realize that there were so many shell programs out there. I simply linked /bin/sh to /bin/bash and crosstool worked perfectly, allowing me to build cross compilers for the ARM and PowerPC processors.

• • •
 

March 19, 2008

Another How-to

Filed under: News — Harvey @ 7:11 pm

I published another how-to: Ubuntu Ethernet Aliasing How-to. It’s pretty simple once you figure it out but I could find no help on the Internet so I thought I’d post it.

• • •
 

The line between software and hardware gets even fuzzier

Filed under: News, Rants — Harvey @ 7:08 pm

Faster logic and processors have had a huge impact on implementation technologies over the last couple of decades. Nowhere is this more apparent than in signal processing. Functions that were the sole domain of linear circuits have been taken over by digital technologies. But what digital technologies should you use? That answer can be complicated.

Late last year, I was developing control and monitoring software for a mobile satellite networks central earth station. One of the boards my software was controlling was a sophisticated demodulator. An expert in signal processing had developed mathematical models for the demodulator and two vendors were chosen to convert the models into a working demodulator in order to reduce risk. One vendor used programmable logic and the other used a software approach running on multiple CPU’s to obtain the required performance. In the end, both implementations worked but one had slightly better performance and the other used more power. In this case the decision was easy because we had two working implementations and could measure their performance. In most projects however, the hardware/software trade off analysis must be done at the start of a project.

Last week I spent at a vendor’s site integrating the modem for the mobile satellite terminals. I had a chance to see the process of implementing a design from a mathematical model close up. The model was captured using a mathematical model and simulation tool. The engineers could then simulate the modem and tweak the model as needed to improve performance. Once they were satisfied with the model, another tool was used to convert the model directly into a logic design language. The design was then programmed into an FPGA in the mobile satellite terminal.

To test the demodulator, they used a signal generator that could generate modulated waveforms using the same models that they had developed to implement the modem. Seeing this process close up was an eye opener. Software, logic design and even test equipment driven by mathematical models made me realize just how irrelevant the underlying implementation technology has become. The real intellectual property was in the mathematical models and the C source code or VHDL are just bookkeeping.

• • •
 

March 18, 2008

RIP Arthur C. Clark

Filed under: Geeky Fun, Rants — Harvey @ 9:09 pm

Arthur C. Clark was one of the giants in science fiction.  Most people only think of him as the author of 2001 A Space Odessy.  Read Childhood’s End for something completely different.  Like many scifi authors of his time he had a background in science, with a degree in physics and mathematics.

I enjoyed reading his stories at a time when space travel was still a dream.  His generation of scifi authors helped us imagine what space travel would be like.  Remember, 2001 was released before Apollo landed on the moon.

Arthur C. Clark also developed the idea of communications satellites in a technical paper in 1945, years before there were any rockets capable of reaching earth orbit.

• • •