• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Before You Start<a name="EN-US_TOPIC_0000001199722625"></a>
2
3-   [Porting Directory](#section284217487490)
4-   [Porting Process](#section639315306506)
5-   [Porting Specifications](#section187870185219)
6
7This document provides basic guidance for OpenHarmony developers and system on a chip \(SoC\) or module vendors to port OpenHarmony to typical chip architectures, such as the cortex-M and RISC-V series. Currently, the Bluetooth service is not supported. Due to the complexity of the OpenHarmony project, this document is subject to update as the version and APIs change.
8
9This guide is intended for readers who have experience in developing embedded systems. Therefore, it mainly describes operations and key points during platform porting instead of basic introduction to the OS.
10
11## Porting Directory<a name="section284217487490"></a>
12
13The implementation of the OpenHarmony project directories and functions relies on the OS itself. If no enhancement for a complex feature is involved, you only need to focus on the directories described in the following table.
14
15**Table  1**  Key directories in the porting process
16
17<a name="table97326295179"></a>
18<table><thead align="left"><tr id="row207334298172"><th class="cellrowborder" valign="top" width="27.71%" id="mcps1.2.3.1.1"><p id="p3733192991710"><a name="p3733192991710"></a><a name="p3733192991710"></a>Directory</p>
19</th>
20<th class="cellrowborder" valign="top" width="72.28999999999999%" id="mcps1.2.3.1.2"><p id="p37331329101713"><a name="p37331329101713"></a><a name="p37331329101713"></a>Description</p>
21</th>
22</tr>
23</thead>
24<tbody><tr id="row17331029181714"><td class="cellrowborder" valign="top" width="27.71%" headers="mcps1.2.3.1.1 "><p id="p873314296175"><a name="p873314296175"></a><a name="p873314296175"></a>/build/lite</p>
25</td>
26<td class="cellrowborder" valign="top" width="72.28999999999999%" headers="mcps1.2.3.1.2 "><p id="p1573342917172"><a name="p1573342917172"></a><a name="p1573342917172"></a>Basic building framework for <span id="text8913173395513"><a name="text8913173395513"></a><a name="text8913173395513"></a>OpenHarmony</span></p>
27</td>
28</tr>
29<tr id="row427301117194"><td class="cellrowborder" valign="top" width="27.71%" headers="mcps1.2.3.1.1 "><p id="p11274411181915"><a name="p11274411181915"></a><a name="p11274411181915"></a>/kernel/liteos_m</p>
30</td>
31<td class="cellrowborder" valign="top" width="72.28999999999999%" headers="mcps1.2.3.1.2 "><p id="p92741311181915"><a name="p92741311181915"></a><a name="p92741311181915"></a>Basic kernel. The implementation related to the chip architecture is in the <strong id="b155382041192418"><a name="b155382041192418"></a><a name="b155382041192418"></a>arch</strong> directory.</p>
32</td>
33</tr>
34<tr id="row44321715131917"><td class="cellrowborder" valign="top" width="27.71%" headers="mcps1.2.3.1.1 "><p id="p20432181501911"><a name="p20432181501911"></a><a name="p20432181501911"></a>/device</p>
35</td>
36<td class="cellrowborder" valign="top" width="72.28999999999999%" headers="mcps1.2.3.1.2 "><p id="p64331415171913"><a name="p64331415171913"></a><a name="p64331415171913"></a>Board-level code implementation, which is provided by third-party vendors based on the <span id="text117091750175520"><a name="text117091750175520"></a><a name="text117091750175520"></a>OpenHarmony</span> specifications. For detailed structure about the <strong id="b118614195115"><a name="b118614195115"></a><a name="b118614195115"></a>device</strong> directory and porting process, see <a href="porting-chip-board-overview.md">Board-Level OS Porting</a>.</p>
37</td>
38</tr>
39<tr id="row19497111381917"><td class="cellrowborder" valign="top" width="27.71%" headers="mcps1.2.3.1.1 "><p id="p12498181381916"><a name="p12498181381916"></a><a name="p12498181381916"></a>/vendor</p>
40</td>
41<td class="cellrowborder" valign="top" width="72.28999999999999%" headers="mcps1.2.3.1.2 "><p id="p1849841341920"><a name="p1849841341920"></a><a name="p1849841341920"></a>Product-level implementation, which is contributed by Huawei or product vendors.</p>
42</td>
43</tr>
44</tbody>
45</table>
46
47The  **device**  directory is in the internal structure of  **device/\{Chip solution vendor\}/\{Development board\}**. The following uses 	HiSilicon  **hispark\_taurus**  as an example:
48
49```
50device
51└── hisilicon                      # Name of the chip solution vendor
52    ├── common                     # Common part of the chip solution development board
53    └── hispark_taurus             # Name of the development board
54        ├── BUILD.gn               # Entry to building the development board
55        ├── hals                   # OS hardware adaptation of the chip solution vendor
56        ├── linux                  # Linux version
57        │   └── config.gni         # Configurations of the building toolchain and building options for the Linux version
58        └── liteos_a               # LiteOS Cortex-A version
59            └── config.gni         # Configurations of the building toolchain and building options for the LiteOS Cortex-A version
60```
61
62The  **vendor**  directory is in the internal structure of  **vendor/\{Product solution vendor\}/\{Product name\}**. The following uses Huawei Wi-Fi IoT product as an example:
63
64```
65vendor                       # Product solution vendor
66└── huawei                   # Name of the product solution vendor
67    └── wifiiot              # Product name
68          ├── hals           # OS adaptation of the product solution vendor
69          ├── BUILD.gn       # Product building script
70          └── config.json    # Product configuration file
71```
72
73## Porting Process<a name="section639315306506"></a>
74
75The  **device**  directory of OpenHarmony is the adaptation directory for the basic SoC. You can skip the porting process and directly develop system applications if complete SoC adaptation code is already available in the directory. If there is no corresponding SoC porting implementation in the directory, complete the porting process by following the instructions provided in this document. The following figure shows the process of porting OpenHarmony to a third-party SoC.
76
77**Figure  1**  Key steps for SoC porting<a name="fig24801925498"></a>
78![](figure/key-steps-for-soc-porting.png "key-steps-for-soc-porting")
79
80## Porting Specifications<a name="section187870185219"></a>
81
82-   The porting must comply with the basic OpenHarmony principles described in  [Contribution](../../contribute/contribution.md).
83-   The code required for third-party SoC adaptation is stored in the  **device**,  **vendor**, and  **arch**  directories. Naming and usage of these directories must comply with specified naming and usage specifications. For details, see  [Directory Specifications](porting-chip-kernel-overview.md)  and  [Board-Level Directory Specifications](porting-chip-board-overview.md#section6204129143013).
84
85