Skip to content
Snippets Groups Projects
Commit c3ced7a2 authored by Gururaj Shetty's avatar Gururaj Shetty
Browse files

all the latest update from readme file incorporated

parent 194f128d
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,8 @@ OpenHarmony is a distributed OS that is designed to run on top of variety of OS ...@@ -12,6 +12,8 @@ OpenHarmony is a distributed OS that is designed to run on top of variety of OS
:align: center :align: center
:alt: meta-ohos overview :alt: meta-ohos overview
Building and Running OpenHarmony image
************************************************
**Prerequisites** **Prerequisites**
To start working with **meta-ohos** first install git repo: To start working with **meta-ohos** first install git repo:
...@@ -22,10 +24,9 @@ To start working with **meta-ohos** first install git repo: ...@@ -22,10 +24,9 @@ To start working with **meta-ohos** first install git repo:
$ sudo apt-get update $ sudo apt-get update
$ sudo apt-get install git-repo $ sudo apt-get install git-repo
Building and Running OpenHarmony image **Procedure**
************************************************
1. Once git repo has been installed, clone the necessary repositories using the following commands: Once git repo has been installed, clone the necessary repositories using the following commands:
.. code-block:: console .. code-block:: console
...@@ -33,9 +34,9 @@ Building and Running OpenHarmony image ...@@ -33,9 +34,9 @@ Building and Running OpenHarmony image
$ repo init -u https://git.ostc-eu.org/OSTC/manifest.git $ repo init -u https://git.ostc-eu.org/OSTC/manifest.git
$ repo sync $ repo sync
Above commands creates the following directory structure: Above commands creates the following directory structure:
.. code-block:: console .. code-block:: console
./ohos/ ./ohos/
└── sources └── sources
...@@ -43,128 +44,156 @@ Building and Running OpenHarmony image ...@@ -43,128 +44,156 @@ Building and Running OpenHarmony image
├── meta-ohos ├── meta-ohos
├── meta-openembedded ├── meta-openembedded
├── meta-zephyr ├── meta-zephyr
├── <various yocto layers>
└── poky └── poky
2. Build OHOS flavour of your choice. Currently OpenHarmony supports Linux, Zephyr, and FreeRTOS. OpenHarmony can be hosted on top of variety of kernels. Currently supported kernels (a.k.a. OHOS flavours) are Linux, Zephyr, and FreeRTOS (experimental).
* **OHOS Linux flavour** To build OHOS flavour, use the following command syntax:
Default Linux distro is poky-tiny. You can choose any of the following machines (default is qemux86):
* qemux86
* qemux86-64
* qemuarm
* qemuarmv5
To build Linux-based OHOS, execute following commands:
.. code-block:: console .. code-block:: console
$ TEMPLATECONF=../sources/meta-ohos/flavours/linux . ./sources/poky/oe-init-build-env build-poky-tiny-qemux86 $ TEMPLATECONF=../sources/meta-ohos/flavours/<lower_case_flavour> . ./sources/poky/oe-init-build-env build-<flavour>-<target_machine>
$ bitbake core-image-minimal $ bitbake <image-name>
DISTRO and MACHINE variables can be set up in *conf/local.conf* file under build directory or via command line. MACHINE variable can be set up in *conf/local.conf* file under build directory or via command line:
Example:
.. code-block:: console
$ DISTRO=poky MACHINE=qemux86-64 bitbake core-image-minimal
* **OHOS Zephyr flavour**
For Zephyr you can choose any of the following machines (default is qemu-x86):
* acrn
* arduino-101-ble
* arduino-101
* arduino-101-sss
* qemu-cortex-m3
* qemu-nios2
* qemu-x86
To build Zephyr-based OHOS, execute following commands:
.. code-block:: console
$ TEMPLATECONF=../sources/meta-ohos/flavours/zephyr . ./sources/poky/oe-init-build-env build-zephyr-qemux86
$ bitbake zephyr-philosophers
.. note::
`zephyr-philosophers` is one of the sample applications available in meta-zephyr layer by Yocto project. It's easy to build other samples using recipes available in `meta-zephyr/recipes-kernel/zephyr-kernel/` directory.
* **OHOS FreeRTOS flavour**
For FreeRTOS you can choose any of the following machines:
* qemuarmv5
To build FreeRTOS-based OHOS, execute following commands: **Example:**
.. code-block:: console
$ TEMPLATECONF=../sources/meta-ohos/flavours/freertos . ./sources/poky/oe-init-build-env build-freertos-qemuarmv5 .. code-block:: console
$ bitbake freertos-demo
3. Running OpenHarmony image. $ MACHINE=<target_machine> bitbake <image-name>
When the build is finished, you can run the image by executing following command: OHOS Linux flavour
====================
* For poky-tiny:
.. code-block:: console
$ runqemu qemux86 ramfs qemuparams="-nographic" OHOS Linux flavour is based on poky distribution.
After successful bootup, you should see following: **Supported images:**
.. code-block:: console
qemux86 login:
# Default login is _root_ without a password.
# After login you should see prompt:
root@qemux86:~#
To exit qemu, you can either shut down the system: * core-image-minimal
* core-image-full-cmdline
root@qemux86:~# poweroff -f **Supported machines:**
or close qemu using key combination: * qemux86-64 (default)
* qemux86
* qemuarm
* qemuarm64
Ctrl-a followed by 'x' **Example:**
.. code-block:: console
* For Zephyr:
$ TEMPLATECONF=../sources/meta-ohos/flavours/linux . ./sources/poky/oe-init-build-env build-ohos-linux-qemux86-64
.. code-block:: console $ bitbake core-image-minimal
You can test the image built for the qemux86-64 target by issuing:
.. code-block:: console
$ runqemu qemux86-64 qemuparams="-nographic"
After successful bootup, you should see following:
.. code-block:: console
Poky (Yocto Project Reference Distro) 3.1.4 qemux86-64 /dev/ttyS0
qemux86-64 login:
Default login is root without a password. After login you should see following prompt:
.. code-block:: console
root@qemux86-64:~#
To exit qemu, you can either shut down the system:
.. code-block:: console
root@qemux86:~# poweroff -f
or close qemu using key combination:
Ctrl-a followed by 'x'
OHOS Zephyr flavour
====================
OHOS Zephyr flavour is based on zephyr distribution and supports following images / machines:
$ DEPLOY_DIR_IMAGE=tmp-newlib/deploy/images/qemu-x86 runqemu qemu-x86 **Supported images:**
* zephyr-philosophers
**Supported machines:**
* qemu-cortex-m3
* qemu-x86 (default)
**Example:**
.. code-block:: console
$ TEMPLATECONF=../sources/meta-ohos/flavours/zephyr . ./sources/poky/oe-init-build-env build-ohos-zephyr-qemu-x86
$ bitbake zephyr-philosophers
You can test the image built for the qemu-x86 target by issuing:
.. code-block:: console
$ DEPLOY_DIR_IMAGE=tmp-newlib/deploy/images/qemu-x86 runqemu qemu-x86
After successful bootup, you should see following:
.. code-block:: console
After successful bootup, you should see following:
.. code-block:: console
Booting from ROM..*** Booting Zephyr OS build zephyr-v2.4.0 *** Booting from ROM..*** Booting Zephyr OS build zephyr-v2.4.0 ***
Philosopher 0 [P: 3] THINKING [ 300 ms ] Philosopher 0 [P: 3] THINKING [ 300 ms ]
Philosopher 1 [P: 2] EATING [ 575 ms ] Philosopher 1 [P: 2] EATING [ 575 ms ]
Philosopher 2 [P: 1] STARVING Philosopher 2 [P: 1] STARVING
Philosopher 3 [P: 0] EATING [ 525 ms ] Philosopher 3 [P: 0] EATING [ 525 ms ]
Philosopher 4 [C: -1] THINKING [ 475 ms ] Philosopher 4 [C: -1] THINKING [ 475 ms ]
* For FreeRTOS:
.. code-block:: console To exit qemu, use key combination:
**Ctrl-A** followed by 'x'
OHOS FreeRTOS flavour
======================
OHOS FreeRTOS flavour is based on freertos distribution and supports following images / machines:
**Supported images:**
* freertos-demo
**Supported machines:**
* qemuarmv5
**Example:**
.. code-block:: console
$ TEMPLATECONF=../sources/meta-ohos/flavours/freertos . ./sources/poky/oe-init-build-env build-ohos-freertos-qemuarmv5
$ bitbake freertos-demo
You can test the image built for the qemuarmv5 target by issuing:
.. code-block:: console
$ runqemu qemuarmv5 $ runqemu qemuarmv5
After successful bootup, you should see following: After successful bootup, you should see following:
.. code-block:: console .. code-block:: console
###### - FreeRTOS sample application - ###### ###### - FreeRTOS sample application - ######
A text may be entered using a keyboard. A text may be entered using a keyboard.
It will be displayed when 'Enter' is pressed. It will be displayed when 'Enter' is pressed.
Periodic task 10 secs Periodic task 10 secs
Waiting For Notification - Blocked... Waiting For Notification - Blocked...
Task1 Task1
...@@ -174,3 +203,6 @@ Building and Running OpenHarmony image ...@@ -174,3 +203,6 @@ Building and Running OpenHarmony image
Notification Received Notification Received
Waiting For Notification - Blocked... Waiting For Notification - Blocked...
To exit qemu, use key combination:
**Ctrl-A** followed by 'x'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment