Helper2416 Development Board compiler compile helloworld run by Xiaomi box (android)

Source: Internet
Author: User

Helper2416 Development Board compiler compile helloworld run by Xiaomi box (android)
Generally, the program is developed mainly for the helper2416 Development Board. The chip is Samsung's 2416, which belongs to ARM9. the cross compiler is a self-transplanted compiler for the helper2416 Development Board. It supports the armv5te instruction set.
I recently had an android Xiaomi box and thought about the arm platform. The Instruction Set version of the Development Board is not high, can I use the cross compiler of the Development Board to compile a helloworld C language program to run on the Xiaomi box.
Process:
Program:

 
 
  1. #include <stdio.h>
  2. #include <stdlib.h>

  3. int main()
  4. {
  5. printf( "hello world!\n" );
  6. return 0;
  7. }
The arm cross compiler of the Development Board must be compiled with a static link. Otherwise, the system prompts "sh:./helloworld: No such file or directory"
Arm-linux-gcc main. c-o helloworld-static
First, adb first connects to the box (Step omitted) and then transmits the program to the Xiaomi box. The directory/sdcard/may not be uploaded to other directories.
Adb push./helloworld/sdcard/helloworld
465 KB/s (584721 bytes in 1.227 s)

Enter Xiaomi box
Adb shell
Escalate to root permission (make sure the box is already root)
$ Su
Go to the/sdcard directory
$ Cd/sdcard/
Copy to the/mnt/asec/directory. Otherwise, the program cannot be modified as executable.
Root @ android:/sdcard # cp helloworld/mnt/asec/
Root @ android:/sdcard # cd/mnt/asec/
Give the program executable permissions
Root @ android:/mnt/asec # chmod 777 helloworld
Run
Root @ android:/mnt/asec #./helloworld
Input
Hello world!
Succeeded
Author: handsome, dare not go out, programmer group: 31843264

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.