0

I've built hello world program by nacl and pnacl tools from NACL_SDK.
And now I want to test it.
I've mad a html page and js script which are working with my nexe and pexe and in browser everything is working fine.

But how can I launch my programs from console?
And how can I write stdout to file?

Laser
  • 6,652
  • 8
  • 54
  • 85

1 Answers1

1

To run a nexe-program my-app.nexe from console and redirect output to file output.log use the following command:

$NACL_SDK/tools/sel_ldr.py my-app.nexe > output.log

sel_ldr.py is just a helper script. If you pass a --verbose option to it, you'll see a real command used to run your program. It's something like this:

$NACL_SDK/tools/nacl_helper_bootstrap_x86_64 $NACL_SDK/tools/sel_ldr_x86_64 \
    --r_debug=0xXXXXXXXXXXXXXXXX --reserved_at_zero=0xXXXXXXXXXXXXXXXX -a   \
    -B $NACL_SDK/tools/irt_core_x86_64.nexe my-app.nexe
Nikolai
  • 1,499
  • 12
  • 24
  • thank you for the answer, but i don't get what's the different between sel_ldr and real device? And how to run test on real device (e,g.) chrome book. – Laser Oct 24 '14 at 06:00
  • I'm not aware of chrome books, but on ARM it can be run the same way using arm-helpers. Unfortunately, there's no respective helpers in NACL_SDK, so you have to build them from sources, I guess. – Nikolai Oct 24 '14 at 06:16
  • But what the difference between realdevice execution and sel_ldr? – Laser Oct 24 '14 at 06:23
  • You know that nexe-programs run in a sandbox for the sake of security. `sel_ldr` (secure elf loader) is a heart of this sandbox. It places nexe-module and irt_core, which implements PPAPI, at specific addresses in memory. Internally browser runs your module in a similar way. – Nikolai Oct 24 '14 at 06:28