C Programming for the RS MediaPosted by Nocturnal on Tuesday, 11 March 2008
This is great news, and not just because Freescale pulled the BSP from their website towards the end of last year. Previously if you wanted to write some C programs for use with the RS Media you needed a linux box, and a fair bit of effort to set it up. Even though this makes it pretty easy to compile C programs for the RS Media, I still wouldn't recommend trying this to anyone who doesn't have at least a little knowledge about Linux, and some experience programing in C.
VMWare, for those of you who don't know, is a company that makes software that emulates another computer inside your computer. With the Linux image from Freescale and the free VMPlayer from VMWare, you can be up and running in no time, regardless of if you are using Windows, Mac or Linux.
First you will need the VMPlayer software for your computer, which you can download here, get the one appropriate for your OS. The Windows version is about 170 meg. Then you will need the Linux image from Freescale, which you can get here , its about 520 meg, and contains a complete Linux OS along with the tools required to compile C programs for the RS Media.
Once you have installed the player, and unzipped the Linux image, fire up the player and load the Linux image. After a few minutes booting you should have a login prompt. There are two users, vm_user (password vm_user) and root (password vm_root), you should only really need the vm_user account. Since the Linux image is setup for a different processor, you should really change the kernel source that things are being compiled against. First you need to extract the correct kernel source, so log in as vm_user and issue the following commands.
tar -zxf Kernel.tgz
mv Source linux
For the last part, you will need to be logged in as root, so log out by pressing Ctrl-D and login back in as root.
ln -s /home/vm_user/BSP/MX1/mx1_rel_0.3.8/Kernel/Source/linux linux
You may be wondering how to get files in and out of the Linux image, fortunately the Linux image has file shares enabled, so fire up windows explorer and type the following into the address bar.
I've never really been too big a fan of the traditional "Hello World!" programs (though if you are, you can find one in tutorials/application), I prefer something a little more flashy. This file (click here to view), when compiled and run, will make your RS Media's LCD screen show a bunch of pretty colours. Transfer the file to the Linux image as described above, and then compile it with the following command.
Good luck, and happy compiling.