Hello world native app for ChromeOS

209 views
Skip to first unread message

Xie, William

unread,
Mar 27, 2015, 3:52:33 AM3/27/15
to chromium-os-dev

Hi,

I would like to write some native tools (command line based) for Chrome OS for my test.

How should I start them?

 

For example, I would like to write the “Hello world” app for ChromeOS?

1: How can I write the Makefile (is it .ebuild?)

2: how can I compile it? (is it emerge?)

 

More details are welcomed.

 

William

 

 

Daniel Erat

unread,
Mar 27, 2015, 8:49:12 AM3/27/15
to Xie, William, chromium-os-dev
You can model your new package after the ones in src/platform2/. I think that the broad strokes are:

1. Create a new directory under platform2 with your code in it.
2. Write a GYP file that generates an executable from your source files. 
3. Put a new .ebuild file in a subdirectory under src/third_party/chromiumos_overlay/chromeos-base/.
4. Use emerge-<board> in the chroot to build your package.

You can probably find more details about each of these steps at https://www.chromium.org/chromium-os. I don't know if we have a basic "how to create a hello world package for Chrome OS" document, although we probably should.

Dylan Reid

unread,
Mar 27, 2015, 11:18:12 AM3/27/15
to Daniel Erat, Xie, William, chromium-os-dev
Wasn't there a method of building and deploying a binary as part of an
auto test? If that's still possible it might be easier and keep to
code with the test it supports.

>
> --
> --
> Chromium OS Developers mailing list: chromiu...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-os-dev?hl=en
>

David Sharp

unread,
Mar 27, 2015, 5:35:29 PM3/27/15
to Dylan Reid, Daniel Erat, Xie, William, chromium-os-dev
iirc, the Autotest ebuild will run the setup() phase of all the
autotests, which is where one generally should compile any test
programs. Then the tests get packaged and installed on the machine. At
least I think that's how it works.

You can look at a test I wrote that uses a tiny C program. See
hardware_PerfCounterVerification. There are others, too.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages