Month: March 2006

Cross compiling

Have you ever tried to build a cross compiler under cygwin? Today I tried to do exactly this. Well I quite underestimate the complexity. After all many Unix programs can be happily compiled without much effort under cygwin, why gcc should be different?A cross-compiler is somewhat convoluted, in fact you have first to build a bootstrapping version of the compiler in order to compile the standard C library. Before compiling the compiler you need the binary tools compiled for the intended target. The library needs some information from the operating system. Since my goal was to produce a cross compiler for embedded Linux running on ARM 9, I had to do something with the Linux kernel.
When you successfully compiled the compiler and the library, you have to compile the final compiler.
Luckily today there is internet and google ready to help you. I found many pages and advices, but I haven’t yet achieved my goal. Moreover it is not clear to me whether the cross compiler supports by default all instruction mode that an ARM920 makes available – native, thumb and jazelle. More on this in the next days.

Misc fixes

Here you are some fixes to the blog. First the mail address available in the left panel is always correct. Previously some parts of the site yielded the “%MAILURL%” mail address rather than a valid one.Next comments can now be added to the book reviews even when you access the review from the review index (now renamed in “book reviews” more clear than the previous “readings”).
Aside, I’m changing job, I’ll write soon about the new experience.

The perfect Step class

What are the elements that make a step class perfect? Your mileage may vary, but here is my recipe:

  • music: 20%
  • challenge: 20%
  • duration: 10%
  • trainer motivation: 20%
  • innovation/fantasy: 20%
  • other trainee feedback: 10%

Music must give you the right mood. I love dance music, mostly 80s and 90s disco. Once remixed and rearranged it’s perfect fuel.
Every session must have some elements of challenge. Be they new moves or combos, difficult changes and the like. The challenge has to be proportional. If the goal is to far the challenge easily turns into frustration.
The duration of the session has its importance, too. If it is too short (I heard of a 20′ step class) there is no time to master the choreography, if it is too long (over 60′ of continuous high impact) the strain prevents you to concentrate on the moves.
The trainer motivation plays an important part in the mix. An unmotivated trainer is likely to be unwilling to create interesting challenges and to propose an interesting choreography. Moreover he/she won’t be able to create the right mood in the class.
The session should present the right balance of new and old. Innovation is required both to stimulate and create interest in the choreography. Every trainer has his/her own style on which could create the continuity. Innovation and fantasy differs from challenge. A challenge could be having longer sequence of well known choreography, or playing them at a faster pace.
Last it is a bad feeling finding yourself in a class where other people are not committed to give their best.
Yesterday step class had been nearly perfect :-).

La testa degli italiani

Being an Italian is not an easy job. Italy is world renowned for contradictions (beside fashion, food and Ferrari) and living here is something that needs a life to become used to. Italy has also a wealth of problem mostly deriving from the (bad) attitudes of its inhabitants. A book on the Italian attitudes and custom looks very attractive to my curiosity inclined nature. The writer is an authority in this field. He worked several years abroad and wrote a couple of books on other country people and their customs as opposed to Italian way of behave and doing things.
For all these reasons the book by Severgnini (the title could be translated as “Italian’s minds”) was a welcome one and I get hooked from the very first pages telling about an Italian airport.

Unfortunately the interest fades while the reading progressed. At about one third, it becomes clear that a plot is missing. The idea of presenting Italy to foreigners by a 10 days travel is clearly an excuse, but the lack of a plot and the lack of overall glue make it so evidently a pretext that nearly hurts. The book turns out to be just a collection of memories, observations, some statistics and comments about Italian customs more and more uninspired and repetitive as the reader approaches to the end.
Not that this is too bad, but after the first half it gets somewhat boring. This book could have been improved by halving it, removing pointless parts and sticking with the funnier. About fun, Severgnini knows his art. When he is inspired he writes pleasantly deep considerations with a brilliant humor.

I am legend

his booklet has been a pleasant surprise. The idea is intriguing – the main character is the last human surviving on earth where the rest of mankind has been turned into vampires.He discovers to be somewhat immune to their bytes, nonetheless he has to defend himself against vampire hordes hungry of flesh and blood. During the day he is quite free to go around and take what he needs from the deserted city. Moreover during the day he turns in the hunter trying to kill (forever) the undead breed.
The man fortifies his home, sets up an engine power supply to have light and electricity. But this is not the story of a modern Robinson Crusoe; this is a story about fighting. Fighting against the failure and loneliness first, fighting against alcoholic addiction, fighting against the vampire disease with the scientific method weapons, and last fighting against the purposeless survival instinct when he understand that he’s obsolete.
This is the sad conclusion, understanding that normality is just what most people consider to be normal, therefore it is relative and not absolute, thus finding himself belonging to the past, on the way to take the role of deviant and anomalous.

Once upon a time vampires were rare and they had to stay hidden because of their diversity, fearing the outside world full of normal people ready to kill them. For this reason they were placed in an imaginary existence, they were deemed legends. Now its time for revenge: he is going to be the anomaly; he’s going to be considered legend.
I like to think that there is another reading for the title. The main character is so great and powerful in its way of fighting and winning that it cannot be considered legendary.

Wifi – why not?

Eventually, even my infinite patience is over. My laptop has a Centrino chipset and comes with the Intel Pro Wireless 2200 (ipw2200) network adapter. Some months ago I installed Fedora Core 4 and had quite a troubled time in making the card work. At the first kernel update the wifi ceased to work. Last week it was the third kernel update since when everything worked fine and the wifi was still dead.
I decided that there’s no sense in keeping using old kernel and it was time to fix the issue once for all.
First some history.
After the installation of Fedora Core 4 (FC4) you find that there no way how hard you try, your ipw2200 is not going to work. That’s odd – despite that kernel modules are available and the network wizard even succeeds (sometimes) in finding and configuring the adapter, root is unable to ‘ifup’ the wifi.
Searching around the internet you find that FC4 supports ipw2200, but the firmware for this device is not included in the distribution. They could have saved me some time (and some headaches) by stating somewhere, during the installation, that I had to complete the setup manually.
The firmware is a set of files (available here) that you have to download (uncompressed) and store in the ‘/lib/firmware’ directory.
After this operation the network wizard reliably finds and configures the adapter. Well the wizard is quite rough since it is not able to show a list of wi-fi network you can connect to, but this is a minor annoyance (at least if you know the SSID of the network).
As I said, my joy quit after the first kernel update. Well it could be a kernel problem I said to myself and stuck with the old kernel while waiting for the next update. Three kernel updates later still with a useless wi-fi device I decided that something had to be done.
The first doubt I had was that there was something in the firmware directory that was linked to some specific kernel directory. ‘find’ing in /etc, /lib, /lib/firmware, /boot yield no results.
Time for internet again.
The answer came quite quickly. The firmware on the site had been updated twice. I had v2.2 and version 3.0 was available. I tried first the latest version (3.0) but got no results. Of course the right one is the last you try. So version 2.4 proved to be fine with the latest kernel (kernel-2.6.15-1.1833).
The evening wasn’t over yet, so I gave another try to the Toshiba_acpi module. My laptop is a Toshiba. Linux kernel has specific acpi extensions to access the acpi functions of the Toshiba computer. Despite having the proper kernel module I got an error while attempting to load the module.
Googling for the obvious keywords I arrived at the toshiba acpi driver site where it is clearly stated that not all Toshiba laptops are supported and that the error I got was an indication that my system wasn’t supported.

When the times get tough…

…the tough get going. Yesterday, after a long kill-every-moving-thing-alien-or-not session I finished Serious Sam for XBox.Ehy that’s a great game. It’s not technically outstanding, surely not by today standards, but it has real genius in the gameplay and the character. It is continuously joking over the shoot-em-up genre and the tough hero stereotype.
The story is pretentious – some aliens from Sirio are invading the Earth. You, as Serious Sam, have to defeat them. It not that you are under-numbered in the quest, after all they are all alone, but you have to collect some artifacts here and there in the humanity (o alienity) history, going back and forth the timeline, bringing your wealth of destruction and pain from ancient Egypt to Mayan, to middle age civilizations.
The game is, first of all, humorous. Starting from your weapon set, where you find the usual guns, grenade and rocket launchers, the less usual flame-thrower and chainsaw, the quite exotic cannon (yes one cannon you could find on a pirate galleon) and the exotic serious bomb – a comic-like spherical bomb that causes a pocket nuclear explosion. It is humorous in the gameplay with jokes and clever stuff everywhere. Hardly forgettable is the bouncing room where everyone (you and your enemies) keep bouncing.
It is humorous in odd things you find around. It is impossible to not laugh when you find the Secret Santa Claus.
Despite of this the gameplay is solid, somewhat cathartic in the shooting, never frustrating thanks to the nearly total lack of puzzle to solve and the big yellow flashing arrows clearly indicating what you ought to take or to do before advancing to the next level.
Well done Croteam.

90% of Research

According to a recent tv-ad 90% of research is funded by pharmaceutical corporations. Maybe this data is a little overestimated, nonetheless it is still astonishing. In other words the research for health and cure is privately founded. I wonder to which extent this is good. I mean the logic driving the research for health preservation and recovering is the logic of the Return of Investment, the dividend and share logic. The same logic that led one of the German pharmaceutical giant during the WWII to produce (and sell to the government) the infamous zyklon-B gas used to kill millions of people in concentration camps.
If you google around in internet for these terms you’ll find more than one reason to be concerned. Even if trusting the human nature, it is not possible to not doubt whether such research could find inexpensive treatments for any disease. What if something could be simply let pass, or just a spoonful of water and sugar is fine?
Leaving aside these gloomy thoughts, the link of the day is to Sibling Rivalry: C and C++ a pdf paper from B. Stroustrup detailing the source of incompatibilities between C99 and C++89 and the parallel evolution of these languages that aimed to be one.


The news of the day is that I implemented the comment preview. So before leaving a comment, you have a chance to reread it and make corrections if needed. I trust that this won’t reduce the number of comments just because you have more chances to change your mind in the process 🙂 Also, let me know if anything’s wrong with the new version.

The link of the day is The Development of the C Language. This is a document written by Dennis M. Ritchie about the birth and evolution of the C language. Dating back to the days of the PDP-7 and Multics. The document explains the genesis of the C language and many of its quirks. If you (like me before reading this) believe that the “++” operator was introduced because it mapped on a specific assembly instruction you should read it.

Ok, you have no time, so the answer is – the PDP-7 had no pre/post increment/decrement assembly instruction. Instead, it had just 8k of 18 bits word of memory. So keeping things small was an urgent need. And x++ saves a bunch of bits with respect to x=x+1.

What makes a blog interesting…

…is both the content and how often it is updated. I must keep this in mind.The good news is that those spamming bastards seem to have been defeated by a minor change to the verification code handling.
Basically now the code is re-generated every time it is checked unrelated to the check success. I consider the verification code daunting enough for my readers and I don’t want impose more restrictions. Anyway time will tell.
Exercising a bit my divination skill (crystal ball handy) I could tell that the next good news will be the editing and preview for blog comments.
The link of the day is about ZX80 and ZX81. I think that a proof of how much my daddy loved me when I was younger is that I’m still alive after all the begging for a ZX81 back in the 80s dawn.