NANOPC-T3 Development Board Kernel application compilation and operation (using the ADB method upload)

Source: Internet
Author: User

Writing the simplest application

#include <stdio.h>


void Main (int argc, char *argv[])
{
int i = 0,j = 0;
for (i=0;i<10;i++)
{
printf ("Hello world..............\r\n");
for (j=0;j<100000;j++)
{};
}
}

and then compile

Arm-linux-gcc-o TST Tst.c-static

Generate TST files and copy them to the ADB folder on the PC side


Then open the ADB and connect to the Android Development Board

Using commands

ADB push tst/system/

The TST file will be uploaded to the system folder of the Linux kernel, if it appears

Failed to copy ' TST ' to '/system/': Read-only file system

First exit the ADB, then remount, namely

ADB remount

After seeing Remount succeeded

Then execute ADB push tst/system/to succeed


Through the Serial printing window into the kernel of the system folder, you can see the TST file, chmod 777 TST Modify Permissions

And then run./tst

You can see the print

Hello world ... .......
Hello world ... .......
Hello world ... .......
Hello world ... .......
Hello world ... .......
Hello world ... .......
Hello world ... .......
Hello world ... .......
Hello world ... .......
Hello world ... .......

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.