240411771a
The built-in `print` is removed from jerry-core, but an external `print` implementation is added to jerry-main. From now on, all embedders of the engine have to implement their own `print` if they need such a functionality. For printing results in REPL mode of jerry-main, the external `print` handler is called directly instead of looking up the `print` function registered into the global object. (The two are the same, but the indirection is not needed anymore.) Because jerry-core does not contain `print` anymore, `jerry_port_console` is removed from the port API. The default port is updated, i.e., the implementation of `jerry_port_console` is removed. Additionally, all references to `jerry_port_console` in jerry-main are replaced by `printf`. Speculatively, `jerry_port_console` is also removed from all non-default targets. Most targets implemented it for the sake of the engine only; in those targets the removal was trivial. Where the function was called from the embedder application as well, the calls were replaced with equivalents (e.g., `printf`, `printk`). NOTE 1: This is a breaking change! NOTE 2: This patch still leaves several targets without a JS `print` implementation. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
About
This folder contains files to build and run JerryScript on TizenRT with Artik05x board.
How to build
1. Set up build environment
- Install toolchain
Get the build in binaries and libraries, gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.
Untar the gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar and export the path like
$ tar xvf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar
$ export PATH=<Your Toolchain PATH>:$PATH
- Get the jerryscript and TizenRT sources
$ mkdir jerry-tizenrt
$ cd jerry-tizenrt
$ git clone https://github.com/jerryscript-project/jerryscript.git
$ git clone https://github.com/Samsung/TizenRT.git tizenrt
The following directory structure is created after these commands
jerry-tizenrt
├── jerryscript
└── tizenrt
2. Add jerryscript configuration for TizenRT
$ cp -r jerryscript/targets/tizenrt-artik05x/apps/jerryscript/ tizenrt/apps/system/
$ cp -r jerryscript/targets/tizenrt-artik05x/configs/jerryscript/ tizenrt/build/configs/sidk_s5jt200/
Apply following diff in jerry-tizenrt/tizenrt/os/FlatLibs.mk. (The line number may differ since tizenrt is under developing.)
--- a/os/FlatLibs.mk
+++ b/os/FlatLibs.mk
@@ -142,6 +142,12 @@ endif
# Add library for Framework
TINYARALIBS += $(LIBRARIES_DIR)$(DELIM)libframework$(LIBEXT)
+# Add library for Jerryscript
+ifeq ($(CONFIG_JERRYSCRIPT),y)
+TINYARALIBS += $(LIBRARIES_DIR)$(DELIM)libjerry-core$(LIBEXT)
+TINYARALIBS += $(LIBRARIES_DIR)$(DELIM)libjerry-libm$(LIBEXT)
+endif
+
# Export all libraries
3. Configure TizenRT
$ cd tizenrt/os/tools
$ ./configure.sh sidk_s5jt200/jerryscript
4. Build JerryScript for TizenRT
# assuming you are in jerry-tizenrt folder
$ cd jerryscript
$ make -f targets/tizenrt-artik05x/Makefile.tizenrt
5. Build TizenRT binary
# assuming you are in jerry-tizenrt folder
$ cd tizenrt/os
$ make
Binaries are available in tizenrt/build/output/bin
6. Flash binary
The official guide will be announced on TizenRT page.
7. Run JerryScript
You can use minicom for terminal program, or any other you may like, but set
baud rate to 115200.
(Note: Device path may differ like /dev/ttyUSB1.)
sudo minicom --device=/dev/ttyUSB0 --baud=115200