转载:冷钦街老师倾力打造的OpenHarmony南向设备开发平台试运行啦 本平台集成了 OpenHarmony 代码获取、代码修改、代码提交、代码编译、编译镜像下载几大功能。用户只需要准备开发板以及烧录镜像的工具就可以进行 OpenHarmony 南向设备开发工作。特别适合学生使用,也方便对 OpenHarmony 感兴趣的研究人员使用。
【详细深入分析OpenHarmony编译流程】 OpenHarmony做为复杂的操作系统软件,其编译构建也比较复杂。本文主要记录作者自己在阅读编译脚本代码后对其的认识,不代表官方观点,不足之处还请批评指正。本文顺着编译流程阅读和解释编译脚本代码,即执行时间靠前的代码先解释,执行时间靠后的代码后解释。本文参考代码为2024年7月8日master分支代码。为了方便查看OpenHarmony代码,作者搭建了一个服务器,欢迎使用https://lengqinjie.xyz。
鸿蒙APP框架分析 本文主要描述鸿蒙系统的APP框架的代码组成,APP的一些概念。APP的启动,APP的生命周期,APP之间的交互情况。主要关注进程级别。而进程内的线程级别在其它文章描述。通过本文的学习,可以对APP的运行机制有一个大致的把握和理解。
VPP-BIHASH实现分析 /vppinfa/bihash_template.h本文件为本数据结构的核心头文件概念一key-value-pair 键-值-对。 组成HASH表的各元素,在C语言中,一般定义成一个struct,其中一部分是key, 另一部分是value。每1个key在hash表中只能出现1次通过key用来计算hash值。不同的key可能计算出相同的hash值,如果表中存在2个这样的表...
C++11标准解读--内存模型部分 1.7 The C++ memory model C++内存是按字节寻址的,每个字节有唯一的内存地址,每个字节有低位和高位(权重大的位)不同的内存位置可以多线程并发访问,但结构体中的位段例外,如下面的例子。struct {char a;int b:5,c:11,:0,d:8;struct {int ee:8;} e;}a, d, e.ee 都是独立的内存区域,可以多...
VPP代码阅读中文注解---dlmalloc.h * Quickstart This library is all in one file to simplify the most common usage: ftp it, compile it (-O3), and link it into another program. All of the compile-time options default to reasonabl...
VPP代码阅读中文注解--dlist.h 双向链表算法。本双向链表的所有元素存储在一个pool中,根据pool中内存块的序号进行索引。typedef struct{ u32 next; u32 prev; u32 value;} dlist_elt_t;本双向链表中每一个元素的结构。value指的是元素的值。next, prev分别代表前一个和后一个元素。它们的语义是元素在内存池中的编号,通俗的说,就是数...
VPP代码阅读中文注解--crc32.h static_always_inline u32clib_crc32c (u8 * s, int len){ u32 v = 0;#if __x86_64__ for (; len >= 8; len -= 8, s += 8) v = _mm_crc32_u64 (v, *((u64 *) s));#else /* workaround weird GCC ...
VPP代码阅读中文注解--cpu.c #define foreach_x86_cpu_uarch \ _(0x06, 0x9e, "Kaby Lake", "Kaby Lake DT/H/S/X") \ _(0x06, 0x8e, "Kaby Lake", "Kaby Lake Y/U") \ _(0x06, 0x85, "Knights Mill", "Knights Mill") \ _(0x06, 0x5f,
VPP代码阅读中文注解---cpu.h #include <vppinfra/format.h>/* * multiarchitecture support. Adding new entry will produce * new graph node function variant optimized for specific cpu * microarchitecture. * Order is impo...
VPP代码阅读中文注解---clib_error.h #include <vppinfra/types.h>typedef struct{ /* Error message. */ u8 *what; /* Where error occurred (e.g. __FUNCTION__ __LINE__) */ const u8 *where; uword flags; /* Error code (...
VPP代码阅读中文注解--cache.h /* * Allow CFLAGS to override the configured / deduced cache line size */#ifndef CLIB_LOG2_CACHE_LINE_BYTES/* Default cache line size of 64 bytes. */#ifndef CLIB_LOG2_CACHE_LINE_BYTES#define C...
VPP代码阅读中文注解--byte_order.h 处理字节序相关的头文件。比如IP地址 192.168.10.20 这个IP地址。在X86 CPU中处理时,长这样: 0x140aa8c0在网络上传输时,长这样:0xc0a80a14由于网络传输是按照低地址代表most significant byte的语义。这个与x86 这类的CPU刚好相反。所以软件中需要做相应的处理,实际上就是在内存中做字节交换。 #include ...
VPP代码阅读中文注解--pool.c #include <vppinfra/pool.h>void_pool_init_fixed (void **pool_ptr, u32 elt_size, u32 max_elts){ u8 *mmap_base; u64 vector_size; u64 free_index_size; u64 total_size; u64 page_size; ...
VPP代码阅读中文注解--pool.h /** @file * @brief Fixed length block allocator. Pools are built from clib vectors and bitmaps. Use pools when repeatedly allocating and freeing fixed-size data. Pools are fast, and avoid m...
VPP代码阅读中文注解---bitmap.h /** \file Bitmaps built as vectors of machine words*/#include <vppinfra/vec.h>#include <vppinfra/random.h>#include <vppinfra/error.h>#include <vppinfra/bitops.h> /* ...
VPP代码阅读中文注解--bitops.h /* Population count from Hacker's Delight. */always_inline uwordcount_set_bits (uword x){#ifdef __POPCNT__#if uword_bits == 64 return __builtin_popcountll (x);#else return __builtin_popcoun...