Wednesday, November 18, 2009

Gnome and Fedora-12 on ARM

Here are some screenshots of my kirkwood DB (1.2 GHz and 512 MB RAM, Matrox G550 graphics card) running Gnome. Pretty neat!
I am going to try XFCE desktop over the weekend. Lets see how that goes...

Here is a picture of my setup (taken 6 months ago)
(click to enlarge)






Another awesome Fedora release!

Fedora-ARM 12 is available!

Fedora-ARM 12 is now available.

The RFS is available at:
http://ftp.linux.org.uk/pub/linux/arm/fedora/rootfs/rootfs-f12.tar.bz2

The following package groups are available: Base, Core, Base-X, GNOME-Desktop, XFCE-Desktop, Java, Java-Development, Admin-Tools, System-Tools, Web Server, and commonly used embedded packages.

As usual it is built for ARMv5 EABI, soft-float, little endian.

For more details head to:
http://fedoraproject.org/wiki/Architectures/ARM

Tuesday, November 3, 2009

kernel and Fedora-ARM

Handling the kernel package on ARM is different than other architectures. Our kernel package typically provides only the kernel-headers. This is because, there are hundreds of ARM boards out there and everyone will use their own optimised and stripped down kernels anyway!

The side-effect of this choice is that there is no kernel package in the rpm database and hence, the packages that Require kernel (about 15 of them) won't have their dependencies satisfied. (Some examples would be, fuse, xorg-x11-drv-ati, pulseaudio, libdrm, etc) Currently, we work around this by changing the Requires on the kernel by Conflicts. Here is a sample patch. (It is obviously not a very elegant solution and any suggestions are welcome)

Now, this isn't much of a problem for packages that just Require kernel. But, now xorg-x11-drv-nouveau Requires kernel-drm-nouveau. It is rare for any ARM kernel to be compiled with nouveau support, so it makes less sense to change this Requires to Conflicts. Ofcourse, we can assume that whoever is trying to use a nVidia card with an ARM board knows what the hell he's doing, but the solution doesn't seem right anyway.

Any suggestions on how this can be handled?

Fedora-ARM: alignment errors

Alignment Errors:
We usually come across a lot of alignment error problems while building packages for Fedora-ARM.

Here is a quick example of the problem:


#define SIZE 20
#define CHARVAL 'a'
#define INTVAL 0x0a0b0c0d
main()
{
char buffer[SIZE] = { 0, };
char *p = buffer, c;

printf("c value = 0x%x\n", CHARVAL);
printf("i value = 0x%.8x %d\n", INTVAL, INTVAL);

/* Ok, lets write them in the buffer one after the other */
*p = CHARVAL;
p++;
*(int *)p = INTVAL;

/* So the buffer should be 0x610d0c0b0a */
print_hex_string(buffer);

}


The output of this program on x86 machine:

c value = 0x61
i value = 0x0a0b0c0d 168496141
0x610d0c0b0a000000000000000000000000000000
^^^^----------------here

As expected :-)

And on ARM?

c value = 0x61
i value = 0x0a0b0c0d 168496141
0x0d0c0b0a00000000000000000000000000000000
^^^^----------------here
And there goes your value of "c" stored in the array.

These alignment errors are often seen on the ARM architecture. Basically it expects a word to be on a word boundary (last 2 bits should be zero). And if it isn't, well expect the unexpected. As can be seen above the value of c has been completely over-written.

The same goes for pointers as well.

/proc/cpu/aligment:
This file displays the list of alignment errors that have been encountered thus far.

You can echo various flags in this file to change the kernel's behavior when an alignment error is encountered.
  • 0: ignore
  • 1: warn (/var/log/messages)
  • 2: fixup
  • 3: signal (core dump for analysis)
For a detailed overview: http://lecs.cs.ucla.edu/wiki/index.php/XScale_alignment