Monday, September 30, 2013

HelloWorld on OLinuXino (ArchLinux ARM) using C

So assuming you have an iMX233-OLinuXino-MAXI and are running ArchLinux on it, here is how you you would go about running a HelloWorld application on it:
  1. Gain access to OLinuXino's console over serial port and login using the credentials (login: root & password:root)
  2. Issue the command to OLinuXino for performing a full system upgrade, make sure the board is connected to your WiFi router using an Ethernet cable as it will use the internet to fetch the latest packages:
    pacman -Syu
  3. Reboot the board by issuing the command:
    reboot
  4. Install the compiler and other basic development tools onto OLinuXino (When asked, press enter to keep all options at default):
    pacman -S base-devel
  5. Reboot the board.
  6. Use the nano text editor to write a helloworld program:
    nano hello.c
  7. Type the code:

    #include <stdio.h>
    #include <stdlib.h>
    int main(void) {
            puts("!!!Hello World!!!");
            exit(EXIT_SUCCESS);
    }




  • Press Control+O to save the file and Control+X to exit.
  • Compile the file:
    gcc hello.c
  • Run the compiled executable and observe the output:
    ./a.out



  • In case you want to now try compiling kernel modules, look here.

    0 comments:

    Post a Comment