Additional Raspberry Pi VM Information
I was informed yesterday that there seems to be a problem following my VM setup instructions when using Ubuntu 11.10. I spent about 5 hours and 3 Ubuntu 11.10 installs checking this and it certainly seems to be the case that without an awful lot of fiddiling and complications that are just not worth the bother. So for the time being the recommended guest os's for building your own VM are Ubuntu 10.04LTS, Fedora16 or Debian (I haven't built the VM on Debian for a long time so i'm not sure exactly which version to recommend but I can't imagine that Debian will be much of a problem with any recent versions. If anyone has a problem with Debian please let me know.)
Once again if you are using my instructions to build the Raspberry Pi development VM (or a VM for any development using Scratchbox2 and/or qemu) i'd recommend (in no particular order) currently using
- Ubuntu 10.04LTS
- Fedora
- Debian
Now a tip when porting x86 code to ARM using gcc. If you get a lot of warnings when trying to build software originally written in C for x86 for ARM especially things like "comparison is always true/false due to limited range of data type" the chances are that you aree being bitten by the fact that x86 compilers usually default to signed chars if not specified by the variable declaration while ARM compilers usually default to unsigned chars. If you are using gcc (which you are if you are using my VM or your own installation of Scratchbox2 then the fix is to use the
-fsigned-char
gcc option. e.g.
gcc hello.c -o hello -fsigned-char
Another thing that might prove useful when you have access to the real Raspberry Pi hardware and the standardized distro is that by default the codesourcery toolchain included in the VM by default builds for generic ARMv5. On the whole this really shouldn't matter as ARMv6 can run ARMv5 instructions but there maybe times when you are doing something that needs to use an ARMv6 specific instruction or you are including assembler in the C code or something else where a generic ARM version binary just won't cut it. In that case using the gcc option
-mcpu=arm1176jzf-s
which specifies that gcc emits the correct instructions for the specific ARM core that the Raspberry Pi uses might be helpful.
e.g.
gcc -mcpu=arm1176jzf-s hello.c -o hello