百篇博客系列篇.本篇为:

v60.xx 鸿蒙内核源码分析(gn应用篇) | gn语法及在鸿蒙的使用 | 51.c.h.o

编译构建相关篇为:

gn是什么?

gn 存在的意义是为了生成 ninja,如果熟悉前端开发,二者关系很像 SassCSS的关系.

为什么会有gn,说是有个叫even的谷歌负责构建系统的工程师在使用传统的makefile构建chrome时觉得太麻烦,不高效,所以设计了一套更简单,更高效新的构建工具gn+ninja,然后就被广泛的使用了.

gn语法和配置

gn 有大量的内置变量和库函数,熟悉这些库函数基本就知道gn能干什么,gn的官方文档很齐全,前往 gn参考手册翻看查找 .

gn 的语法简单,了解以下几点基本就能看懂gn代码.重点了解下函数的调用方式,和其他高级语言不太一样.

字符串

  1. a = "mypath"
  2. b = "$a/foo.cc" # b -> "mypath/foo.cc"
  3. c = "foo${a}bar.cc" # c -> "foomypathbar.cc"

列表

  1. a = [ "first" ]
  2. a += [ "second" ] # [ "first", "second" ]
  3. a += [ "third", "fourth" ] # [ "first", "second", "third", "fourth" ]
  4. b = a + [ "fifth" ] # [ "first", "second", "third", "fourth", "fifth" ]

条件语句

  1. if (is_linux || (is_win && target_cpu == "x86")) {
  2. sources -= [ "something.cc" ]
  3. }else {
  4. ...
  5. }

循环

  1. foreach(i, mylist) {
  2. print(i) # Note: i is a copy of each element, not a reference to it.
  3. }

函数调用

  1. print("hello, world")
  2. assert(is_win, "This should only be executed on Windows") # 如果is_win为真,就打印后面的内容
  3. static_library("mylibrary") {
  4. sources = [ "a.cc" ]
  5. }

解读:

  • print,assert,static_library都是库函数,或者叫内置函数.
  • static_library的调用有点奇怪,它是个函数,函数内部会使用sources这个内置变量,sources = [ "a.cc" ]相当于先传参给这个函数的内置变量,并调用这个函数.学习ng得习惯这种语法方式,被大量的使用.

模板 | Templates

gn提供了很多内置函数,使用偏傻瓜式,若构建不复杂的系统,熟悉这些内置函数,选择填空就可以交作业了,如果想高阶点,想自己定义函数怎么办? 答案是模板,模板就是自定义函数.

  1. #定义模板, 文件路径: //tools/idl_compiler.gni, 后缀.gni 代表这是一个 gn import file
  2. template("idl") { #自定义一个名称为 "idl"的函数
  3. source_set(target_name) { #调用内置函数 source_set
  4. sources = invoker.sources #invoker为内置变量,含义为调用者内容 即:[ "a", "b" ]的内容
  5. }
  6. }
  1. #如何使用模板, 用import,类似 C语言的 #include
  2. import("//tools/idl_compiler.gni")
  3. idl("my_interfaces") { #等同于调用 idl
  4. sources = [ "a", "b" ] #给idl传参, 参数的接收方是 invoker.sources
  5. }

明白了模板的使用,阅读鸿蒙gn代码就不会有太大的障碍.

目标项 | Targets

目标是构建图中的一个节点。它通常表示将生成某种可执行文件或库文件。整个构建是由一个个的目标组成.

目标包含:

  1. action: 运行脚本以生成文件
  2. executable: 生成可执行文件
  3. group: 生成依赖关系组
  4. shared_library: 生成.dll或.so动态链接库
  5. static_library: 生成.lib或.a 静态链接库
  6. ...

配置项 | Configs

记录完成目标项所需的配置信息,例如:

  1. config("myconfig") {#创建一个标签为`myconfig`的配置项
  2. include_dirs = [ "include/common" ]
  3. defines = [ "ENABLE_DOOM_MELON" ]
  4. }
  5. executable("mything") {#生成可执行文件
  6. configs = [ ":myconfig" ]#使用标签为`myconfig`的配置项来生成目标文件
  7. }

gn在鸿蒙中的使用

有了以上基础铺垫,正式开始gnopenharomny中的使用.

从哪开始

在构建工具篇中已经说清楚了 hbpython部分有个工作任务是生成gn命令所需参数. gn生成ninja的命令是 gn gen ...

  1. /home/tools/gn gen /home/openharmony/code-v1.1.1-LTS/out/hispark_aries/ipcamera_hispark_aries \
  2. --root=/home/openharmony/code-v1.1.1-LTS \
  3. --dotfile=/home/openharmony/code-v1.1.1-LTS/build/lite/.gn \
  4. --script-executable=python3 \
  5. '--args=ohos_build_type="debug" \
  6. ohos_build_compiler_specified="clang" \
  7. ohos_build_compiler_dir="/home/tools/llvm" \
  8. product_path="/home/openharmony/code-v1.1.1-LTS/vendor/hisilicon/hispark_aries" \
  9. device_path="/home/openharmony/code-v1.1.1-LTS/device/hisilicon/hispark_aries/sdk_liteos" \
  10. ohos_kernel_type="liteos_a" \
  11. enable_ohos_appexecfwk_feature_ability = false \
  12. ohos_full_compile=true'

解读

  • root,dotfile,script-executable是gn内置的固定参数,一切从dotfile指向的文件开始.即build/lite/.gn 相当于main()函数的作用,
  • 打开 build/lite/.gn看下内容,只有两句,先配置好内部参数再工作.
    1. # The location of the build configuration file. #1.完成gn的配置工作
    2. buildconfig = "//build/lite/config/BUILDCONFIG.gn"
    3. # The source root location. #2.完成gn的编译工作
    4. root = "//build/lite"
  • args为用户自定义的参数,它们将会在解析BUILD.gn,BUILDCONFIG.gn过程中被使用.

BUILDCONFIG.gn | 构建配置项

BUILDCONFIG.gnBUILD.gn做准备,填充好编译所需的配置信息.即生成配置项

详细请查看 build/lite/config/BUILDCONFIG.gn 文件全部内容,本篇只贴出部分.

  1. import("//build/lite/ohos_var.gni")
  2. import("${device_path}/config.gni")
  3. ....
  4. arch = "arm"
  5. if (ohos_kernel_type == "liteos_a") {
  6. target_triple = "$arch-liteos"
  7. } else if (ohos_kernel_type == "linux") {
  8. target_triple = "$arch-linux-ohosmusl"
  9. }
  10. ...
  11. template("executable") { #生成可执行文件
  12. executable(target_name) {
  13. forward_variables_from(invoker, Variables_Executable)
  14. if (!defined(invoker.deps)) {
  15. deps = [ "//build/lite:prebuilts" ]
  16. } else {
  17. deps += [ "//build/lite:prebuilts" ]
  18. }
  19. if (defined(invoker.configs)) {
  20. configs = []
  21. configs += invoker.configs
  22. }
  23. }
  24. }
  25. set_defaults("executable") {#设置目标类型的默认值
  26. configs = default_executable_configs
  27. configs += [ "//build/lite/config:board_exe_ld_flags" ]
  28. }
  29. ...

解读

  • ${device_path}为命令行参数,本篇为home/openharmony/code-v1.1.1-LTS/device/hisilicon/hispark_aries/sdk_liteos
  • 查看构建-配置内容,BUILDCONFIG主要任务就是对其中的内置变量赋值.例如:
    • 指定编译器 clang,
    • 如何生成可执行文件的方法等

BUILD.gn | 启动构建

查看 build/lite/BUILD.gn 文件,文件注解较多.

  1. #目的是要得到项目各个模块的编译入口
  2. group("ohos") {
  3. deps = []
  4. if (ohos_build_target == "") {
  5. # Step 1: Read product configuration profile.
  6. # 第一步:读取配置文件product_path的值来源于根目录的ohos_config.json,如下,内容由 hb set 命令生成
  7. # {
  8. # "root_path": "/home/openharmony",
  9. # "board": "hispark_aries",
  10. # "kernel": "liteos_a",
  11. # "product": "ipcamera_hispark_aries",
  12. # "product_path": "/home/openharmony/vendor/hisilicon/hispark_aries",
  13. # "device_path": "/home/openharmony/device/hisilicon/hispark_aries/sdk_liteos",
  14. # "patch_cache": null
  15. #}
  16. product_cfg = read_file("${product_path}/config.json", "json")
  17. # Step 2: Loop subsystems configured by product.
  18. # 第二步:循环处理各自子系统,config.json中子系统部分格式如下hb
  19. #"subsystems": [
  20. # {
  21. # "subsystem": "aafwk",
  22. # "components": [
  23. # { "component": "ability", "features":[ "enable_ohos_appexecfwk_feature_ability = false" ] }
  24. # ]
  25. # },
  26. # ...
  27. # {
  28. # "subsystem": "distributed_schedule",
  29. # "components": [
  30. # { "component": "system_ability_manager", "features":[] },
  31. # { "component": "foundation", "features":[] },
  32. # { "component": "distributed_schedule", "features":[] }
  33. # ]
  34. # },
  35. # {
  36. # "subsystem": "kernel",
  37. # "components": [
  38. # { "component": "liteos_a", "features":[] }
  39. # ]
  40. # },
  41. #]
  42. foreach(product_configed_subsystem, product_cfg.subsystems) {#对子系统数组遍历操作
  43. subsystem_name = product_configed_subsystem.subsystem #读取一个子系统 aafwk,hiviewdfx,security ==
  44. subsystem_info = {
  45. }
  46. # Step 3: Read OS subsystems profile.
  47. # 第三步: 读取各个子系统的配置文件
  48. subsystem_info =
  49. read_file("//build/lite/components/${subsystem_name}.json", "json")
  50. # Step 4: Loop components configured by product.
  51. # 第四步: 循环读取子系统内各控件的配置信息
  52. # 此处以内核为例://build/lite/components/kernel.json"
  53. # "components": [
  54. # {
  55. # "component": "liteos_a", # 组件名称
  56. # "description": "liteos-a kernel", # 组件一句话功能描述
  57. # "optional": "false", # 组件是否为最小系统必选
  58. # "dirs": [ # 组件源码路径
  59. # "kernel/liteos_a"
  60. # ],
  61. # "targets": [ # 组件编译入口
  62. # "//kernel/liteos_a:kernel"
  63. # ],
  64. # "rom": "1.98MB", # 组件ROM值
  65. # "ram": "", # 组件RAM估值
  66. # "output": [ # 组件编译输出
  67. # "liteos.bin"
  68. # ],
  69. # "adapted_board": [ # 组件已适配的主板
  70. # "hispark_aries",
  71. # "hispark_taurus",
  72. # "hi3518ev300",
  73. # "hi3516dv300",
  74. # ],
  75. # "adapted_kernel": [ "liteos_a" ], # 组件已适配的内核
  76. # "features": [], # 组件可配置的特性
  77. # "deps": {
  78. # "components": [], # 组件依赖的其他组件
  79. # "third_party": [ # 组件依赖的三方开源软件
  80. # "FreeBSD",
  81. # "musl",
  82. # "zlib",
  83. # "FatFs",
  84. # "Linux_Kernel",
  85. # "lwip",
  86. # "NuttX",
  87. # "mtd-utils"
  88. # ]
  89. # }
  90. # },
  91. # ]
  92. foreach(product_configed_component,
  93. product_configed_subsystem.components) { #遍历项目控件数组
  94. # Step 5: Check whether the component configured by product is exist.
  95. # 第五步: 检查控件配置信息是否存在
  96. component_found = false #初始为不存在
  97. foreach(system_component, subsystem_info.components) {#项目控件和子系统中的控件遍历对比
  98. if (product_configed_component.component ==
  99. system_component.component) { #找到了liteos_a
  100. component_found = true
  101. }
  102. }
  103. #如果没找到的信息,则打印项目控件查找失败日志
  104. assert(
  105. component_found,
  106. "Component \"${product_configed_component.component}\" not found" +
  107. ", please check your product configuration.")
  108. # Step 6: Loop OS components and check validity of product configuration.
  109. # 第六步: 检查子系统控件的有效性并遍历控件组,处理各个控件
  110. foreach(component, subsystem_info.components) {
  111. kernel_valid = false #检查内核
  112. board_valid = false #检查开发板
  113. # Step 6.1: Skip component which not configured by product.
  114. if (component.component == product_configed_component.component) {
  115. # Step 6.1.1: Loop OS components adapted kernel type.
  116. foreach(component_adapted_kernel, component.adapted_kernel) {
  117. if (component_adapted_kernel == product_cfg.kernel_type &&
  118. kernel_valid == false) { #内核检测是否已适配
  119. kernel_valid = true
  120. }
  121. }
  122. # 如果内核未适配,则打印未适配日志
  123. assert(
  124. kernel_valid,
  125. "Invalid component configed, ${subsystem_name}:${product_configed_component.component} " + "not available for kernel: ${product_cfg.kernel_type}!")
  126. # Step 6.1.2: Add valid component for compiling.
  127. # 添加有效组件进行编译
  128. foreach(component_target, component.targets) {//遍历组件的编译入口
  129. deps += [ component_target ] #添加到编译列表中
  130. }
  131. }
  132. }
  133. }
  134. }
  135. # Step 7: Add device and product target by default.
  136. # 第七步: 添加设备和项目的编译单元
  137. # "product_path": "/home/openharmony/vendor/hisilicon/hispark_aries",
  138. # "device_path": "/home/openharmony/device/hisilicon/hispark_aries/sdk_liteos",
  139. deps += [
  140. "${device_path}/../", #添加 //device/hisilicon/hispark_aries 进入编译项
  141. "${product_path}" #添加 //vendor/hisilicon/hispark_aries 进入编译项
  142. ]
  143. } else {#编译指定的组件,例如 hb build -T targetA&&targetB
  144. deps += string_split(ohos_build_target, "&&")
  145. }
  146. }

解读

  • 有三个概念贯彻整个鸿蒙系统,子系统(subsystems),组件(components),功能(features).理解它们的定位和特点是解读鸿蒙的关键所在.
  • 先找到product_path下的 配置文件 config.json,里面配置了项目所要使用的子系统和组件.
  • 再遍历项目所使用的组件是否能再 //build/lite/components/*.json组件集中能找到.
  • 将找到的组件targets加入到编译列表deps中.targets指向了要编译的组件目录.例如内核组件时指向了://kernel/liteos_a:kernel,
    1. import("//build/lite/config/component/lite_component.gni") #组件模板函数
    2. import("//build/lite/config/subsystem/lite_subsystem.gni") #子系统模板函数
    3. lite_subsystem("kernel") {#编译内核子系统/组件入口
    4. subsystem_components = []
    5. if (enable_ohos_kernel_liteos_a_ext_build == false) {
    6. subsystem_components += [
    7. "//kernel/liteos_a/kernel",
    8. "//kernel/liteos_a/net",
    9. "//kernel/liteos_a/lib",
    10. "//kernel/liteos_a/compat",
    11. "//kernel/liteos_a/fs",
    12. "//kernel/liteos_a/arch:platform_cpu",
    13. ]
    14. if (LOSCFG_SHELL) {
    15. subsystem_components += [ "//kernel/liteos_a/shell" ]
    16. }
    17. } else {
    18. deps = [ ":make" ]
    19. }
    20. }

    lite_subsystem是个模板函数(自定义函数),再查看lite_subsystem.gni函数原型,它的目的只有一个填充 deps,deps是私有链接依赖关系,最终会形成一颗依赖树.gn会根据这些依赖关系生成最终的.ninja文件.

    1. # 定义一个子系统
    2. # lite_subsystem template模板定义了子系统中包含的所有模块
    3. # 参数
    4. # subsystem_components (必须))
    5. # [范围列表] 定义子系统的所有模块.
    6. template("lite_subsystem") {
    7. assert(defined(invoker.subsystem_components), "subsystem_components in required.")
    8. lite_subsystem_components = invoker.subsystem_components
    9. group(target_name) {
    10. deps = []
    11. if(defined(invoker.deps)) {
    12. deps += invoker.deps
    13. }
    14. # add subsystem packages
    15. foreach(pkg_label, lite_subsystem_components) {
    16. deps += [ pkg_label ]
    17. }
    18. }
    19. }

生成了哪些文件

执行后gn gen 会生成如下文件和目录

  1. turing@ubuntu:/home/openharmony/code-v1.1.1-LTS/out/hispark_aries/ipcamera_hispark_aries$ ls
  2. args.gn build.ninja build.ninja.d NOTICE_FILE obj test_info toolchain.ninja

build.ninja.d中记录依赖的 BUILD.gn文件路径

  1. build.ninja: ../../../base/global/resmgr_lite/frameworks/resmgr_lite/BUILD.gn \
  2. ../../../base/hiviewdfx/hilog_lite/frameworks/featured/BUILD.gn \
  3. ../../../base/hiviewdfx/hilog_lite/services/apphilogcat/BUILD.gn \
  4. ....

gn根据这些组件的BUILD.gnobj目录下对应生成了每个组件的.ninja文件.此处列出鸿蒙L1所有的 .ninja文件, 具体ninja是如何编译成最终的库和可执行文件的,将在后续篇中详细介绍其语法和应用.

  1. turing@ubuntu:/home/openharmony/code-v1.1.1-LTS/out/hispark_aries/ipcamera_hispark_aries/obj$ tree
  2. ├── base
  3.    ├── global
  4.       └── resmgr_lite
  5.       └── frameworks
  6.       └── resmgr_lite
  7.       └── global_resmgr.ninja
  8.    ├── hiviewdfx
  9.       └── hilog_lite
  10.       ├── frameworks
  11.          └── featured
  12.          ├── hilog_shared.ninja
  13.          └── hilog_static.ninja
  14.       └── services
  15.       ├── apphilogcat
  16.          ├── apphilogcat.ninja
  17.          └── apphilogcat_static.ninja
  18.       └── hilogcat
  19.       ├── hilogcat.ninja
  20.       └── hilogcat_static.ninja
  21.    ├── security
  22.       ├── appverify
  23.          └── interfaces
  24.          └── innerkits
  25.          └── appverify_lite
  26.          ├── products
  27.             └── ipcamera
  28.             └── verify_base.ninja
  29.          ├── unittest
  30.             └── app_verify_test.ninja
  31.          └── verify.ninja
  32.       ├── deviceauth
  33.          └── frameworks
  34.          └── deviceauth_lite
  35.          └── source
  36.          └── hichainsdk.ninja
  37.       ├── huks
  38.          └── frameworks
  39.          └── huks_lite
  40.          └── source
  41.          └── huks.ninja
  42.       └── permission
  43.       └── services
  44.       └── permission_lite
  45.       ├── ipc_auth
  46.          └── ipc_auth_target.ninja
  47.       ├── pms
  48.          └── pms_target.ninja
  49.       ├── pms_base
  50.          └── pms_base.ninja
  51.       └── pms_client
  52.       └── pms_client.ninja
  53.    └── startup
  54.    ├── appspawn_lite
  55.       └── services
  56.       ├── appspawn.ninja
  57.       └── test
  58.       └── unittest
  59.       └── common
  60.       └── appspawn_test.ninja
  61.    ├── bootstrap_lite
  62.       └── services
  63.       └── source
  64.       └── bootstrap.ninja
  65.    ├── init_lite
  66.       └── services
  67.       ├── init.ninja
  68.       └── test
  69.       └── unittest
  70.       └── common
  71.       └── init_test.ninja
  72.    └── syspara_lite
  73.    └── frameworks
  74.    ├── parameter
  75.       └── src
  76.       └── sysparam.ninja
  77.    ├── token
  78.       └── token_shared.ninja
  79.    └── unittest
  80.    └── parameter
  81.    └── ParameterTest.ninja
  82. ├── build
  83.    └── lite
  84.    └── config
  85.    └── component
  86.    ├── cJSON
  87.       ├── cjson_shared.ninja
  88.       └── cjson_static.ninja
  89.    ├── openssl
  90.       ├── openssl_shared.ninja
  91.       └── openssl_static.ninja
  92.    └── zlib
  93.    ├── zlib_shared.ninja
  94.    └── zlib_static.ninja
  95. ├── drivers
  96.    ├── adapter
  97.       └── uhdf
  98.       ├── manager
  99.          └── hdf_core.ninja
  100.       ├── platform
  101.          └── hdf_platform.ninja
  102.       ├── posix
  103.          └── hdf_posix_osal.ninja
  104.       └── test
  105.       └── unittest
  106.       ├── common
  107.          └── hdf_test_common.ninja
  108.       ├── config
  109.          └── hdf_adapter_uhdf_test_config.ninja
  110.       ├── manager
  111.          ├── hdf_adapter_uhdf_test_door.ninja
  112.          ├── hdf_adapter_uhdf_test_ioservice.ninja
  113.          ├── hdf_adapter_uhdf_test_manager.ninja
  114.          └── hdf_adapter_uhdf_test_sbuf.ninja
  115.       ├── osal
  116.          └── hdf_adapter_uhdf_test_osal.ninja
  117.       └── platform
  118.       └── hdf_adapter_uhdf_test_platform.ninja
  119.    └── peripheral
  120.    ├── input
  121.       └── hal
  122.       └── hdi_input.ninja
  123.    └── wlan
  124.    ├── client
  125.       └── wifi_driver_client.ninja
  126.    ├── hal
  127.       └── wifi_hal.ninja
  128.    └── test
  129.    ├── performance
  130.       └── hdf_peripheral_wlan_test_performance.ninja
  131.    └── unittest
  132.    └── hdf_peripheral_wlan_test.ninja
  133. ├── foundation
  134.    ├── aafwk
  135.       └── aafwk_lite
  136.       ├── frameworks
  137.          ├── ability_lite
  138.             └── ability.ninja
  139.          ├── abilitymgr_lite
  140.             └── abilitymanager.ninja
  141.          └── want_lite
  142.          └── want.ninja
  143.       └── services
  144.       └── abilitymgr_lite
  145.       ├── abilityms.ninja
  146.       ├── tools
  147.          └── aa.ninja
  148.       └── unittest
  149.       └── test_lv0
  150.       └── page_ability_test
  151.       └── ability_test_pageAbilityTest_lv0.ninja
  152.    ├── ai
  153.       └── engine
  154.       ├── services
  155.          ├── client
  156.             ├── ai_client.ninja
  157.             ├── client_executor
  158.                └── client_executor.ninja
  159.             └── communication_adapter
  160.             └── ai_communication_adapter.ninja
  161.          ├── common
  162.             ├── platform
  163.                ├── dl_operation
  164.                   └── dlOperation.ninja
  165.                ├── event
  166.                   └── event.ninja
  167.                ├── lock
  168.                   └── lock.ninja
  169.                ├── os_wrapper
  170.                   └── ipc
  171.                   └── aie_ipc.ninja
  172.                ├── semaphore
  173.                   └── semaphore.ninja
  174.                ├── threadpool
  175.                   └── threadpool.ninja
  176.                └── time
  177.                └── time.ninja
  178.             ├── protocol
  179.                └── data_channel
  180.                └── data_channel.ninja
  181.             └── utils
  182.             └── encdec
  183.             └── encdec.ninja
  184.          └── server
  185.          ├── ai_server.ninja
  186.          ├── communication_adapter
  187.             └── ai_communication_adapter.ninja
  188.          ├── plugin_manager
  189.             └── plugin_manager.ninja
  190.          └── server_executor
  191.          └── server_executor.ninja
  192.       └── test
  193.       ├── common
  194.          ├── ai_test_common.ninja
  195.          └── dl_operation
  196.          └── dl_operation_so
  197.          └── dlOperationSo.ninja
  198.       ├── function
  199.          ├── ai_test_function.ninja
  200.          └── death_callback
  201.          ├── testDeathCallbackLibrary.ninja
  202.          └── testDeathCallback.ninja
  203.       ├── performance
  204.          └── ai_test_performance_unittest.ninja
  205.       └── sample
  206.       ├── asyncDemoPluginCode.ninja
  207.       ├── sample_plugin_1.ninja
  208.       ├── sample_plugin_2.ninja
  209.       └── syncDemoPluginCode.ninja
  210.    ├── appexecfwk
  211.       └── appexecfwk_lite
  212.       ├── frameworks
  213.          └── bundle_lite
  214.          └── bundle.ninja
  215.       └── services
  216.       └── bundlemgr_lite
  217.       ├── bundle_daemon
  218.          └── bundle_daemon.ninja
  219.       ├── bundlems.ninja
  220.       └── tools
  221.       └── bm.ninja
  222.    ├── communication
  223.       ├── ipc_lite
  224.          └── liteipc_adapter.ninja
  225.       └── softbus_lite
  226.       └── softbus_lite.ninja
  227.    ├── distributedschedule
  228.       ├── dmsfwk_lite
  229.          ├── dmslite.ninja
  230.          └── moduletest
  231.          └── dtbschedmgr_lite
  232.          └── distributed_schedule_test_dms.ninja
  233.       ├── safwk_lite
  234.          └── foundation.ninja
  235.       └── samgr_lite
  236.       ├── communication
  237.          └── broadcast
  238.          └── broadcast.ninja
  239.       ├── samgr
  240.          ├── adapter
  241.             └── samgr_adapter.ninja
  242.          ├── samgr.ninja
  243.          └── source
  244.          └── samgr_source.ninja
  245.       ├── samgr_client
  246.          └── client.ninja
  247.       ├── samgr_endpoint
  248.          ├── endpoint_source.ninja
  249.          └── store_source.ninja
  250.       └── samgr_server
  251.       └── server.ninja
  252.    ├── graphic
  253.       ├── surface
  254.          ├── surface.ninja
  255.          └── test
  256.          └── lite_surface_unittest.ninja
  257.       ├── ui
  258.          └── ui.ninja
  259.       ├── utils
  260.          ├── graphic_hals.ninja
  261.          ├── graphic_utils.ninja
  262.          └── test
  263.          ├── graphic_test_color.ninja
  264.          ├── graphic_test_container.ninja
  265.          ├── graphic_test_geometry2d.ninja
  266.          ├── graphic_test_math.ninja
  267.          └── graphic_test_style.ninja
  268.       └── wms
  269.       ├── wms_client.ninja
  270.       └── wms_server.ninja
  271.    └── multimedia
  272.    ├── audio_lite
  273.       └── frameworks
  274.       └── audio_capturer_lite.ninja
  275.    ├── camera_lite
  276.       └── frameworks
  277.       └── camera_lite.ninja
  278.    ├── media_lite
  279.       ├── frameworks
  280.          ├── player_lite
  281.             └── player_lite.ninja
  282.          └── recorder_lite
  283.          └── recorder_lite.ninja
  284.       ├── interfaces
  285.          └── kits
  286.          └── player_lite
  287.          └── js
  288.          └── builtin
  289.          └── audio_lite_api.ninja
  290.       └── services
  291.       └── media_server.ninja
  292.    └── utils
  293.    └── lite
  294.    └── media_common.ninja
  295. ├── test
  296.    ├── developertest
  297.       ├── examples
  298.          └── lite
  299.          └── cxx_demo
  300.          └── test
  301.          └── unittest
  302.          └── common
  303.          └── CalcSubTest.ninja
  304.       └── third_party
  305.       └── lib
  306.       └── cpp
  307.       ├── gtest_main.ninja
  308.       └── gtest.ninja
  309.    └── xts
  310.    ├── acts
  311.       ├── aafwk_lite
  312.          └── ability_posix
  313.          └── module_ActsAbilityMgrTest.ninja
  314.       ├── ai_lite
  315.          └── ai_engine_posix
  316.          └── base
  317.          ├── module_ActsAiEngineTest.ninja
  318.          └── src
  319.          └── sample
  320.          ├── asyncDemoPluginCode.ninja
  321.          ├── sample_plugin_1_sync.ninja
  322.          ├── sample_plugin_2_async.ninja
  323.          └── syncDemoPluginCode.ninja
  324.       ├── appexecfwk_lite
  325.          └── bundle_mgr_posix
  326.          └── module_ActsBundleMgrTest.ninja
  327.       ├── communication_lite
  328.          ├── lwip_posix
  329.             └── module_ActsLwipTest.ninja
  330.          └── softbus_posix
  331.          └── module_ActsSoftBusTest.ninja
  332.       ├── distributed_schedule_lite
  333.          └── samgr_posix
  334.          └── module_ActsSamgrTest.ninja
  335.       ├── graphic_lite
  336.          ├── graphic_utils
  337.             ├── a
  338.                └── module_ActsUiInterfaceTest1.ninja
  339.             ├── color_posix
  340.                └── module_ActsColorTest.ninja
  341.             ├── geometry2d_posix
  342.                └── module_ActsGeometyr2dTest.ninja
  343.             ├── graphic_math_posix
  344.                └── module_ActsGraphicMathTest.ninja
  345.             ├── heap_base_posix
  346.                └── module_ActsHeapBaseTest.ninja
  347.             ├── list_posix
  348.                └── module_ActsListTest.ninja
  349.             ├── mem_api_posix
  350.                └── module_ActsGraphMemApiTest.ninja
  351.             ├── rect_posix
  352.                └── module_ActsRectTest.ninja
  353.             ├── transform_posix
  354.                └── module_ActsTransformTest.ninja
  355.             └── version_posix
  356.             └── module_ActsGraphVersionTest.ninja
  357.          ├── surface
  358.             └── surface_posix
  359.             └── module_ActsSurfaceTest.ninja
  360.          └── ui
  361.          ├── a
  362.             └── module_ActsUiInterfaceTest.ninja
  363.          ├── animator_posix
  364.             └── module_ActsAnimatorTest.ninja
  365.          ├── easing_equation_posix
  366.             └── module_ActsEasingEquationTest.ninja
  367.          ├── events_posix
  368.             └── module_ActsEventsTest.ninja
  369.          ├── flexlayout_posix
  370.             └── module_ActsFlexlaoutTest.ninja
  371.          ├── gridlayout_posix
  372.             └── module_ActsGridLayoutTest.ninja
  373.          ├── image_posix
  374.             └── module_ActsImageTest.ninja
  375.          ├── interpolation_posix
  376.             └── module_ActsInterpoliationTest.ninja
  377.          ├── layout_posix
  378.             └── module_ActsLayoutTest.ninja
  379.          ├── listlayout_posix
  380.             └── module_ActsListlayoutTest.ninja
  381.          ├── screen_posix
  382.             └── module_ActsScreenTest.ninja
  383.          ├── style_posix
  384.             └── module_ActsStyleTest.ninja
  385.          ├── theme_posix
  386.             └── module_ActsThemeTest.ninja
  387.          ├── ui_abstract_progress_posix
  388.             └── module_ActsUIAbstractProgressTest.ninja
  389.          ├── ui_analog_clock_posix
  390.             └── module_ActsUIAnalogClockTest.ninja
  391.          ├── uianimator_posix
  392.             └── module_ActsUIAnimatorTest.ninja
  393.          ├── ui_arc_lable_posix
  394.             └── module_ActsUIArcLabelTest.ninja
  395.          ├── ui_axis_posix
  396.             └── module_ActsUIAxisTest.ninja
  397.          ├── ui_box_porgress_posix
  398.             └── module_ActsUIBoxProgressTest.ninja
  399.          ├── ui_button_posix
  400.             └── module_ActsUIButtonTest.ninja
  401.          ├── ui_canvas_posix
  402.             └── module_ActsUICanvasTest.ninja
  403.          ├── ui_chart_posix
  404.             └── module_ActsUIChartTest.ninja
  405.          ├── ui_checbox_posix
  406.             └── module_ActsUICheckboxTest.ninja
  407.          ├── ui_circle_progress_posix
  408.             └── module_ActsUICircleProgressTest.ninja
  409.          ├── ui_digital_clock_posix
  410.             └── module_ActsUIDigitalClockTest.ninja
  411.          ├── ui_image_animator_posix
  412.             └── module_ActsUIImageAnimatorTest.ninja
  413.          ├── ui_image_posix
  414.             └── module_ActsUIImageTest.ninja
  415.          ├── ui_label_button_posix
  416.             └── module_ActsUILabelButtonTest.ninja
  417.          ├── ui_label_posix
  418.             └── module_ActsUILabelTest.ninja
  419.          ├── ui_list_posix
  420.             └── module_ActsUIListTest.ninja
  421.          ├── ui_picker_posix
  422.             └── module_ActsUIPickerTest.ninja
  423.          ├── ui_radio_button_posix
  424.             └── module_ActsUIRadioButtonTest.ninja
  425.          ├── ui_repeat_button_posix
  426.             └── module_ActsUIRepeatButtonTest.ninja
  427.          ├── ui_screenshot_posix
  428.             └── module_ActsUIScreenshotTest.ninja
  429.          ├── ui_scroll_view_posix
  430.             └── module_ActsUIScrollViewTest.ninja
  431.          ├── ui_slider_posix
  432.             └── module_ActsUISliderTest.ninja
  433.          ├── ui_surface_view_posix
  434.             └── module_ActsUISurfaceViewTest.ninja
  435.          ├── ui_swipe_view_posix
  436.             └── module_ActsUISwipeViewTest.ninja
  437.          ├── ui_text_posix
  438.             └── module_ActsUITextTest.ninja
  439.          ├── ui_texture_mapper_posix
  440.             └── module_ActsUITextureMapperTest.ninja
  441.          ├── ui_time_picker_posix
  442.             └── module_ActsUITimePickerTest.ninja
  443.          ├── ui_toggle_button_posix
  444.             └── module_ActsUIToggleButtonTest.ninja
  445.          ├── ui_view_group_posix
  446.             └── module_ActsUIViewGroupTest.ninja
  447.          └── ui_view_posix
  448.          └── module_ActsUIViewTest.ninja
  449.       ├── hiviewdfx_lite
  450.          └── hilog_posix
  451.          └── module_ActsHilogTest.ninja
  452.       ├── kernel_lite
  453.          ├── dyload_posix
  454.             └── module_ActsDyloadTest.ninja
  455.          ├── fs_posix
  456.             ├── jffs
  457.                └── module_ActsJFFS2Test.ninja
  458.             ├── nfs
  459.                └── module_ActsNFSTest.ninja
  460.             ├── vfat
  461.                └── module_ActsVFATTest.ninja
  462.             └── vfat_storage
  463.             └── module_ActsVFATstorageTest.ninja
  464.          ├── futex_posix
  465.             └── module_ActsFutexApiTest.ninja
  466.          ├── io_posix
  467.             └── module_ActsIoApiTest.ninja
  468.          ├── ipc_posix
  469.             ├── message_queue
  470.                └── module_ActsIpcMqTest.ninja
  471.             ├── pipe_fifo
  472.                └── module_ActsIpcPipeTest.ninja
  473.             ├── semaphore
  474.                └── module_ActsIpcSemTest.ninja
  475.             ├── shared_memory
  476.                └── module_ActsIpcShmTest.ninja
  477.             └── signal
  478.             └── module_ActsIpcSignalTest.ninja
  479.          ├── math_posix
  480.             ├── complexTest.ninja
  481.             └── module_ActsMathApiTest.ninja
  482.          ├── mem_posix
  483.             └── module_ActsMemApiTest.ninja
  484.          ├── net_posix
  485.             └── module_ActsNetTest.ninja
  486.          ├── process_posix
  487.             └── module_ActsProcessApiTest.ninja
  488.          ├── sched_posix
  489.             └── module_ActsSchedApiTest.ninja
  490.          ├── sys_posix
  491.             └── module_ActsSysApiTest.ninja
  492.          ├── time_posix
  493.             └── module_ActsTimeApiTest.ninja
  494.          ├── util_posix
  495.             └── module_ActsUtilApiTest.ninja
  496.          └── utils
  497.          ├── libfs.ninja
  498.          ├── libmt_utils.ninja
  499.          └── libutils.ninja
  500.       ├── multimedia_lite
  501.          └── media_lite_posix
  502.          └── recorder_native
  503.          └── module_ActsMediaRecorderTest.ninja
  504.       ├── security_lite
  505.          ├── datahuks_posix
  506.             └── module_ActsSecurityDataTest.ninja
  507.          └── permission_posix
  508.          ├── capability
  509.             ├── capability_shared.ninja
  510.             ├── jffs
  511.                └── module_ActsJFFS2CapabilityTest.ninja
  512.             └── vfat
  513.             └── module_ActsVFATCapabilityTest.ninja
  514.          ├── dac
  515.             ├── jffs
  516.                └── module_ActsJFFS2DACTest.ninja
  517.             └── vfat
  518.             └── module_ActsVFATDACTest.ninja
  519.          └── pms
  520.          └── module_ActsPMSTest.ninja
  521.       ├── startup_lite
  522.          ├── bootstrap_posix
  523.             └── module_ActsBootstrapTest.ninja
  524.          └── syspara_posix
  525.          └── module_ActsParameterTest.ninja
  526.       └── utils_lite
  527.       └── kv_store_posix
  528.       └── module_ActsKvStoreTest.ninja
  529.    └── tools
  530.    └── lite
  531.    ├── hcpptest
  532.       ├── gmock_main.ninja
  533.       ├── gmock.ninja
  534.       ├── hcpptest_main.ninja
  535.       └── hcpptest.ninja
  536.    └── others
  537.    └── query
  538.    └── query.ninja
  539. ├── third_party
  540.    ├── bounds_checking_function
  541.       ├── libsec_shared.ninja
  542.       └── libsec_static.ninja
  543.    ├── freetype
  544.       └── freetype.ninja
  545.    ├── giflib
  546.       └── libgif.ninja
  547.    ├── iniparser
  548.       └── iniparser.ninja
  549.    ├── libjpeg
  550.       └── libjpeg.ninja
  551.    ├── libpng
  552.       └── libpng.ninja
  553.    ├── mbedtls
  554.       ├── mbedtls_gt.ninja
  555.       ├── mbedtls_shared.ninja
  556.       └── mbedtls_static.ninja
  557.    └── qrcodegen
  558.    └── qrcodegen.ninja
  559. ├── utils
  560.    └── native
  561.    └── lite
  562.    ├── kv_store
  563.       └── src
  564.       └── utils_kv_store.ninja
  565.    └── os_dump
  566.    └── os_dump.ninja
  567. └── vendor
  568. └── hisilicon
  569. └── hispark_aries
  570. └── hals
  571. ├── security
  572.    └── permission_lite
  573.    └── hal_pms.ninja
  574. └── utils
  575. ├── sys_param
  576.    └── hal_sysparam.ninja
  577. └── token
  578. └── haltoken_shared.ninja

鸿蒙内核源码分析.总目录

v08.xx 鸿蒙内核源码分析(总目录) | 百万汉字注解 百篇博客分析 | 51.c.h .o

百万汉字注解.百篇博客分析

百万汉字注解 >> 精读鸿蒙源码,中文注解分析, 深挖地基工程,大脑永久记忆,四大码仓每日同步更新< gitee| github| csdn| coding >

百篇博客分析 >> 故事说内核,问答式导读,生活式比喻,表格化说明,图形化展示,主流站点定期更新中< 51cto| csdn| harmony| osc >

关注不迷路.代码即人生

QQ群:790015635 | 入群密码: 666

原创不易,欢迎转载,但请注明出处.

鸿蒙内核源码分析(GN应用篇) | GN语法及在鸿蒙的使用 | 百篇博客分析OpenHarmony源码 | v60.01的更多相关文章

  1. 鸿蒙内核源码分析(索引节点篇) | 谁是文件系统最重要的概念 | 百篇博客分析OpenHarmony源码 | v64.01

    百篇博客系列篇.本篇为: v64.xx 鸿蒙内核源码分析(索引节点篇) | 谁是文件系统最重要的概念 | 51.c.h.o 文件系统相关篇为: v62.xx 鸿蒙内核源码分析(文件概念篇) | 为什么 ...

  2. 鸿蒙内核源码分析(文件概念篇) | 为什么说一切皆是文件 | 百篇博客分析OpenHarmony源码 | v62.01

    百篇博客系列篇.本篇为: v62.xx 鸿蒙内核源码分析(文件概念篇) | 为什么说一切皆是文件 | 51.c.h.o 本篇开始说文件系统,它是内核五大模块之一,甚至有Linux的设计哲学是" ...

  3. 鸿蒙内核源码分析(忍者ninja篇) | 都忍者了能不快吗 | 百篇博客分析OpenHarmony源码 | v61.02

    百篇博客系列篇.本篇为: v61.xx 鸿蒙内核源码分析(忍者ninja篇) | 都忍者了能不快吗 | 51.c.h.o 编译构建相关篇为: v50.xx 鸿蒙内核源码分析(编译环境篇) | 编译鸿蒙 ...

  4. 鸿蒙内核源码分析(构建工具篇) | 顺瓜摸藤调试鸿蒙构建过程 | 百篇博客分析OpenHarmony源码 | v59.01

    百篇博客系列篇.本篇为: v59.xx 鸿蒙内核源码分析(构建工具篇) | 顺瓜摸藤调试鸿蒙构建过程 | 51.c.h.o 编译构建相关篇为: v50.xx 鸿蒙内核源码分析(编译环境篇) | 编译鸿 ...

  5. 鸿蒙内核源码分析(编译脚本篇) | 如何防编译环境中的牛皮癣 | 百篇博客分析OpenHarmony源码 | v58.01

    百篇博客系列篇.本篇为: v58.xx 鸿蒙内核源码分析(环境脚本篇) | 编译鸿蒙原来如此简单 | 51.c.h.o 本篇用两个脚本完成鸿蒙(L1)的编译环境安装/源码下载/编译过程,让编译,调试鸿 ...

  6. 鸿蒙内核源码分析(编译过程篇) | 简单案例窥视GCC编译全过程 | 百篇博客分析OpenHarmony源码| v57.01

    百篇博客系列篇.本篇为: v57.xx 鸿蒙内核源码分析(编译过程篇) | 简单案例窥视编译全过程 | 51.c.h.o 编译构建相关篇为: v50.xx 鸿蒙内核源码分析(编译环境篇) | 编译鸿蒙 ...

  7. 鸿蒙内核源码分析(静态站点篇) | 五一哪也没去就干了这事 | 百篇博客分析OpenHarmony源码 | v52.02

    百篇博客系列篇.本篇为: v52.xx 鸿蒙内核源码分析(静态站点篇) | 五一哪也没去就干了这事 | 51.c.h.o 前因后果相关篇为: v08.xx 鸿蒙内核源码分析(总目录) | 百万汉字注解 ...

  8. 鸿蒙内核源码分析(编译环境篇) | 编译鸿蒙看这篇或许真的够了 | 百篇博客分析OpenHarmony源码 | v50.06

    百篇博客系列篇.本篇为: v50.xx 鸿蒙内核源码分析(编译环境篇) | 编译鸿蒙防掉坑指南 | 51.c.h.o 编译构建相关篇为: v50.xx 鸿蒙内核源码分析(编译环境篇) | 编译鸿蒙防掉 ...

  9. 鸿蒙内核源码分析(源码注释篇) | 鸿蒙必定成功,也必然成功 | 百篇博客分析OpenHarmony源码 | v13.02

    百篇博客系列篇.本篇为: v13.xx 鸿蒙内核源码分析(源码注释篇) | 鸿蒙必定成功,也必然成功 | 51.c.h .o 几点说明 kernel_liteos_a_note | 中文注解鸿蒙内核 ...

随机推荐

  1. 使用npm安装 Ant Design Vue 时报错—ant-design-vue@latest(sha1-qsf / gCIFcRYxyGmOKgx7TmHf1z4 =)seems to be corrupted.

    安装 Ant Design Vue 时报错: npm install ant-design-vue --save ant-design-vue @ latest(sha1-qsf / gCIFcRYx ...

  2. C语言 windows下Ansi和UTF-8编码格式的转换

    当我们使用MinGW-w64作为编译器在windows系统环境下进行C语言编程时,如果源代码文件(.c)保存格式为Ansi格式,则在打印汉字时不会出现乱码:反之,如果我们使用UTF-8格式保存,则会出 ...

  3. wpf 富文本编辑器richtextbox的简单用法

    最近弄得一个小软件,需要用到富文本编辑器,richtextbox,一开始以为是和文本框一样的用法,但是实践起来碰壁之后才知道并不简单. richtextbox 类似于Word,是一个可编辑的控件.结构 ...

  4. C#基础知识---匿名方法使用

    一.匿名方法使用 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Tex ...

  5. ajax传字符串时出现乱码问题的解决

    字符乱码的解决: 第一种在@RequestMapping中添加 @RequestMapping(value="queryAllToTree",method=RequestMetho ...

  6. .net core api 对于FromBody的参数验证

    前言 在framework的mvc中,经常会使用 Model.State . ModelState.IsValid 配合着特性进行参数验证,通过这种方式可以降低controller的复杂度,使用方便. ...

  7. jQuery中的内容、可见性过滤选择器(四、四)::contains()、:empty、:has()、:parent、:hidden、:visible

    <!DOCTYPE html> <html> <head> <title>内容.可见性过滤选择器</title> <meta http ...

  8. eh-admin一套前后端一体的轻量级后台管理系统

    https://gitee.com/DawnYang/eh-admin 主要技术 后端技术:Spring Boot,Apache Shiro,MyBatis-Plus等: 前端技术:Jquery,La ...

  9. vscode Markdown Preview Enhanced 安装配置

    打开VSCode 打开Externsion,可通过Ctrl+Shift+X 选中 Markdown Preview Enhanced并install即可 配置Preview风格: Magage -&g ...

  10. 堆栈相关的经典题(c++)

    1.定义队列 typedef struct node{ int data; struct node * next; }Node; typedef struct linkQueue { Node * f ...