Native Client is a sandbox for running compiled C and C++ code in the browser efficiently and securely, independent of the user’s operating system. Portable Native Client extends that technology with architecture independence, letting developers compile their code once to run in any website and on any architecture with ahead-of-time (AOT) translation. In short, Native Client brings the performance and low-level control
of native code to modern web browsers, without sacrificing the security and
portability of the web.
Native Client comes in two flavors -
Portable Native Client (PNaCl): Pronounced ‘pinnacle’, PNaCl runs single, portable (pexe) executables and is available in most implementations of Chrome. A translator built into Chrome translates the pexe into native code for the client hardware. The entire module is translated before any code is executed rather than as the code is executed. PNaCl modules can be hosted from any web server.
Native Client (NaCl): Traditional or non-portable Native Client, NaCl runs architecture-dependent (nexe) modules, which are packaged into an application. At runtime, the browser decides which nexe to load based on the architecture of the client machine. Apps and Extensions installed via the Chrome Web Store (CWS) can use NaCl modules without additional prompting. NaCl apps can also be installed from chrome://extensions or the command-line during development, however, this is not a recommended distribution mechanism.
Everything you see on Chrome OS is Chrome browser, Login window, all the bells and whistles. With regular Chrome there's "parent" process which manages the browser processes. In the Chrome OS case it's extended a bit and manages the whole OS. The only way to run native code on regular ChromeOS is via (P)NaCl (or JavaScript). NaCl is only allowed to use Pepper API to communicate with the browser. As a Chrome OS application developer, you have access to the Chrome Apps API and the Pepper API. You cannot directly call any operating system libraries, because your (P)NaCl code runs in a sandbox. Also, the resources you have access to with the Pepper API are virtualized containers scoped to your "origin" (roughly, this is the hostname for webpages and the extension id for chrome apps/extensions).
Even Android Apps could run on ChromeOS. These Apps in fact run on top of NaCl and PPAPI(Pepper Plugin API). They have some additional permissions, though (not much, though: currently they could execute native code without NaCl limitations, but still could only call the outside world via PPAPI).
Webports is collection of open source libraries and applications that have been ported to Native Client.
ref:
Chrome User-Groups - native-client-discuss@googlegroups.com, chromium-extensions@chromium.org
Chromium OS Overview - http://dev.chromium.org/chromium-os
Chromium Native Client - https://www.chromium.org/nativeclient
Chromium Native Client development basics - https://www.chromium.org/nativeclient/getting-started/getting-started-background-and-basics
Chrome OS Native Client Development - https://developer.chrome.com/native-client
Chrome Pepper API(C/C++) reference - https://developer.chrome.com/native-client/pepper_dev
Chrome OS C++ Tutorials -
Porting Chrome* Apps to Mobile Using Crosswalk and Apache Cordova - https://software.intel.com/en-us/blogs/2015/06/15/porting-chrome-apps-to-mobile-using-crosswalk-and-apache-cordova
Chrome Extensions - https://developer.chrome.com/extensions
Chrome Apps - https://developer.chrome.com/apps
Building Chrome OS on Linux - http://dev.chromium.org/developers/how-tos/build-instructions-chromeos
Chrome JavaScript to Native Client Messaging System - https://developer.chrome.com/native-client/devguide/coding/message-system
Chrome Native Client SDK download - https://developer.chrome.com/native-client/sdk/download
Chrome OS JavaScript API - https://developer.chrome.com/apps/api_index
Running Android Apps on Chrome OS - https://developer.chrome.com/apps/getstarted_arc
Chrome WebPorts - https://chromium.googlesource.com/webports
Chromium OS Developer Quick Start Guide - https://www.chromium.org/chromium-os/quick-start-guide
Chromium OS Developer Guide - https://www.chromium.org/chromium-os/developer-guide
Native Client comes in two flavors -
Portable Native Client (PNaCl): Pronounced ‘pinnacle’, PNaCl runs single, portable (pexe) executables and is available in most implementations of Chrome. A translator built into Chrome translates the pexe into native code for the client hardware. The entire module is translated before any code is executed rather than as the code is executed. PNaCl modules can be hosted from any web server.
Native Client (NaCl): Traditional or non-portable Native Client, NaCl runs architecture-dependent (nexe) modules, which are packaged into an application. At runtime, the browser decides which nexe to load based on the architecture of the client machine. Apps and Extensions installed via the Chrome Web Store (CWS) can use NaCl modules without additional prompting. NaCl apps can also be installed from chrome://extensions or the command-line during development, however, this is not a recommended distribution mechanism.
Everything you see on Chrome OS is Chrome browser, Login window, all the bells and whistles. With regular Chrome there's "parent" process which manages the browser processes. In the Chrome OS case it's extended a bit and manages the whole OS. The only way to run native code on regular ChromeOS is via (P)NaCl (or JavaScript). NaCl is only allowed to use Pepper API to communicate with the browser. As a Chrome OS application developer, you have access to the Chrome Apps API and the Pepper API. You cannot directly call any operating system libraries, because your (P)NaCl code runs in a sandbox. Also, the resources you have access to with the Pepper API are virtualized containers scoped to your "origin" (roughly, this is the hostname for webpages and the extension id for chrome apps/extensions).
Even Android Apps could run on ChromeOS. These Apps in fact run on top of NaCl and PPAPI(Pepper Plugin API). They have some additional permissions, though (not much, though: currently they could execute native code without NaCl limitations, but still could only call the outside world via PPAPI).
Webports is collection of open source libraries and applications that have been ported to Native Client.
Brief:
- If you want your code to run on official release builds of ChromeOS, the only supported solution for C/C++ is to use the native client sandboxing technology.
- You can use portable native client (PNaCl) directly just from regular web pages if you don't need access to any of the additional APIs provided to chrome extensions or apps.
- As a Chrome OS application developer you have access to the Chrome Apps API and the Pepper API and can NOT access underlying OS api directly. If you do need access to those APIs, then you'll need to make an extension or app and have at least a minimal Javascript shim for proxying extensions/apps API request/responses and events to your NaCl/PNaCl code, using messaging.
- You can also develop your own OS images based off the Chromium OS source with your C/C++ code natively linked in.
Chrome User-Groups - native-client-discuss@googlegroups.com, chromium-extensions@chromium.org
Chromium Native Client - https://www.chromium.org/nativeclient
Chromium Native Client development basics - https://www.chromium.org/nativeclient/getting-started/getting-started-background-and-basics
Chrome OS Native Client Development - https://developer.chrome.com/native-client
Chrome Pepper API(C/C++) reference - https://developer.chrome.com/native-client/pepper_dev
Chrome OS C++ Tutorials -
- https://developer.chrome.com/native-client/devguide/tutorial/tutorial-part1
- https://developer.chrome.com/native-client/devguide/tutorial/tutorial-part2
Chrome OS Developer mode - https://software.intel.com/en-us/blogs/2014/08/18/two-simple-ways-to-get-to-the-chrome-os-shell
Launching Chrome OS Shell (crosh) - https://software.intel.com/en-us/blogs/2014/08/18/two-simple-ways-to-get-to-the-chrome-os-shell
Intel Chrome Resources - https://software.intel.com/en-us/chrome
Chrome Apps - https://developer.chrome.com/apps
Building Chrome OS on Linux - http://dev.chromium.org/developers/how-tos/build-instructions-chromeos
Chrome JavaScript to Native Client Messaging System - https://developer.chrome.com/native-client/devguide/coding/message-system
Chrome Native Client SDK download - https://developer.chrome.com/native-client/sdk/download
Chrome OS JavaScript API - https://developer.chrome.com/apps/api_index
Running Android Apps on Chrome OS - https://developer.chrome.com/apps/getstarted_arc
Chrome WebPorts - https://chromium.googlesource.com/webports
Chromium OS Developer Quick Start Guide - https://www.chromium.org/chromium-os/quick-start-guide
Chromium OS Developer Guide - https://www.chromium.org/chromium-os/developer-guide