Wednesday, June 27, 2007

Running "user" QEMU emulation on Fedora Core 5

I have few boxes around with different OSes/distros and try to use them in reasonable manner. For a some time I contemplated setting up continuous integration for OpenEmbedded, and the box suiting that purpose runs FC5 here.

Well, soon after running a test build on it, I hit issue that OE's binary locale generation, done by running target localedef under QEMU "user" emulation (qemu-arm) errors out there, and on closer inspection, just segfaults. Taking some time to run it thru gdb and strace, I found that it happens after mmap2() syscall, and in seemingly random places in code. More close look at the stuff showed that address parameter to faulty mmap() kind of correlates with VDSO location reported by gdb. Gotcha! So, somehow guest process manages to overwrite VDSO as used on FC5 system.

Now it took some time to figure out what's happening, but it turned out that FC5 applies whole bunch of patches (mostly labelled "execshield" and "xen") affecting VDSO handling to 2.6.15 kernel, when final set of VDSO randomization patches, etc. was not yet in mainline. In other words, FC developer took their own try on solving VDSO issues, with the outcome described above.

Well, it took only couple hours more to rebuild kernel without those patches and teaching it to pickup original initrd (maybe I should have rebuilt it instead, I just didn't do that before). And now I have pristine and full-feature OE builds on FC5 system, voila! ;-)

Tuesday, June 26, 2007

Porting "Industrial" PDA?

On weekend on local second hand hardware resale board I spotted offer for an industrial PDA with a builtin barcode scanner. Second-hand PDA prices are generally crazy in this part of the world, but this was barely reasonably priced, and it included bare WinCE 4 OS (not PocketPC or Windows Mobile), which made it rather useless in hands of layman, and thus offered some room for bargain.

Being a big fun of "scientific organization of life", I contemplated getting a barcode scanner for quite some time, but anything besides pop supermarket "gun model" USB/RS232 is rather pricy/unavailable here. So, after all, I went with buying the piece. It was announced as PXA255, I checked that fact on vendor site, and didn't bother to check it during hand-off, but soon caught the fact that it's merely a StrongArm. Checking vendor's site closer, I understood that sloppy guys had a StrongArm device, which they later upgraded to PXA, added "-foo" to the name of model, and killed old one from the site. Lart such vendors, what can I say... Either way, the winner is PD-264 from Italian vendor EIA. I even wanted to call a guy to return it back, but then reconciled it as a good opportunity to revamp SA support in kernel. And unlike h3600 which I had before, PD-264 offers such opportunity in comfort - it has CF & SD slots, plus 64Mb RAM and 32Mb ROM. It lacks any networking interfaces though, and UART is taken by the scanner, so it's not that cool in the end, and debugging may be hard actually. Still, I got a barcode scanner with a whole PDA builtin cheaper than my previous favorites in shopping list, FLIC Bluetooth scanner, or Baracoda Pencil.

Now, this would be my first PDA I port from scratch (vs picking up existing port for maintenance), and I'm going to blog the process here, as it was raised many times that there should be a howto for newcomer porters. (Though I checked Michael Opdenacker's presentation, and it's [still] quite good, keeping in mind that it's presentation, not howto).

Monday, June 25, 2007

Power management for GPIOs

I just committed to kernel CVS Roman Moravcik's patch for improved power management for rx3000, and among other things, he took care to setup currently unused input GPIOs as outputs, which is known trick to cut unneeded current drain on them. That's something what all other ports should be reviewed for.

Sunday, June 24, 2007

Defconfigman support for S3C24xx ports

Thanks to Michal Panczyk, support for S3C24xx CPU and ports (Eten G500, iPaqs rx1950 & rx3000) added to Defconfigman. Corresponding static_defconfig's already in kernel CVS, will go to OpenEmbedded soon. (They need more review/cleanup though.)

First Angstrom LiveRamdisk

LiveRamdisk is a pun at LiveCD, hinting that it must be something which allows users to try Linux easily without much preparation and that entire distro will be loaded from RAM.

For PocketPC case, it is a single big .exe file which when being started from normal WinCE environment, loads initrd (or a something alike) and kernel into memory and boots the latter.

I wanted to do something like that for a long time, and rejoiced when Kevin O'Connor, another HaRET maintainer, added ability to create single-exe bundle to HaRET 0.4 this winter. Unfortunately, nobody picked up this possibility, so I decided to give it a try, finally. Alas, it turned out to be not so easy when came to loading realistic (~20Mb) images. So, bunch of hacking was needed both on HaRET and Linux side.

But finally, first LiveRamdisk, an Angstrom X11 snaphost for hx4700, was released two days ago. Besides announcing it on Angstrom mailing lists, I also did some cheap PR on local forums. Well, two days later, the reaction is rather mild - there were only 3 downloads. At the same time, I was pretty surprised that my unofficial Familair 0.8.4 release for h4000 was downloaded 900 times in total. So, time will tell ;-)

Blog start and older news

I always treated blogs (and generally diaries) skeptically, but well, all tools have their uses. So, I'm going to start blogging on my Embedded Linux (well, probably not only embedded) endeavors.

And first of all, older news, which I kept in my wiki page.

  • 2005-11-13: Subscribed to the h4100-port mailing list.
  • 2005-11-29: Confirmed by bisecting that PXA suspend/resume broke in 2.6.13 comparing to 2.6.12. Turned out ot was fixed in 2.6.15
  • 2005-11-29: Subscribed to the kernel-discuss mailing list.
  • 2006-02-03: Proposal for asic3_mmc cross-machine refactor.
  • 2006-02-05: Faced strange issue with ASIC3 suspend/resume, took few months to resolve ;-)
  • 2006-05-30: Posted patch for h4000 ASIC3 suspend/resume problem, turned out to be as "simple" as initializing MSCx PXA registers after resume, what Linux kernel doesn't do (leaving that to bootloader). Anyway, this was second big issue I solved, and after that I felt "force" ;-).
  • 2006-06-03: Started to work on final version asic3_mmc cross-machine refactor, based on the previous experiments.
  • 2006-06-19: Final version of asic3_mmc cross-machine refactor posted.
  • 2006-06-21: Granted write access to ! Kernel CVS repository.
  • 2006-08-20: Posted RFC for common button map for all PDA-type machines.
  • 2006-08-24: Granted write access to OpenEmbedded Monotone repository.
  • 2006-09-20: Unofficial Familiar 0.8.4 release for h4000.
  • 2006-10-03: Received donation of h3900 device to support elaboration of 2.6 kernel port for it and advance userspace/distrubutions support. Contributor: Mr. Alex Deucher. Thank you!
  • 2006-10-11: Posted patch for common button map for all PDA-type machines.
  • 2006-10-18: Received donation of hx4700 device to support elaboration of 2.6 kernel port for it and advance userspace/distrubutions support. Contributor: preferred to stay anonymous, but many thanks!
  • 2006-11-09: Upgraded kernel CVS to 2.6.18.
  • 2006-11-14: Finished implementation of asic3_keys driver and making sure it works well with gpio_keys.
  • 2006-11-21: With having common linux-handhelds-2.6_*.bb and consistent names for all iPaq machines, first phase of cleaning up HH.orh-maintained machines in is complete.
  • 2006-12-02: Upgraded kernel CVS to 2.6.19.
  • 2006-12-19: Angstrom upgraded to 2.6.16-hh8 kernel with common buttonmap support.
  • 2006-12-22: h3900 reached full "C" status, with partial "B" status, in other words, basic PDA functionality works!
  • 2006-12-28: h3900 2.6 port added to, requested support by Angstrom.
  • 2007-01-04: Initial release of [ defconfigman]
  • 2007-01-10: Started to revamp OPIE support in, starting with cleaning up qte patchset.
  • 2007-01-18: Received new contribution: h3600 and palmtt2 devices. Thanks! Now I have access to PXA250, PXA255, PXA270, StrongArm, OMAP devices.
  • 2007-01-20: asus620 port updated in CVS. Thanks to Vincent Benony, asus620 maintainer.
  • 2007-01-21: defconfigman kernel's sound tested to work with GPE. Both h3900 and h4000 in now have defconfigs generated by defconfigman. h4000 updated to use modules for sound.
  • 2007-02-16: Upgraded kernel CVS to 2.6.20.
  • 2007-03-05: Continuous Integration system for kernel tree set up,
  • 2007-03-17: Proposal to use Defconfigman-generated configs for kernel CVS, to improve consistency and CI coverage.
  • 2007-04-11: GPIODEV API RFC posted to LKML/LAKML
  • 2007-04-26: All 30 ports in CVS are buildable now (for 2.6.20)!
  • 2007-05-01: SoC base drivers RFC posted to LKML.
  • 2007-05-07: Upgraded kernel CVS to 2.6.21.
  • 2007-05-11: ipkg speedup patches committed to
  • 2007-05-15: Mystery of PCMCIA ACX is solved, first WiFi ping on h4000!