Contiki源码结构

apps目录下,用于存放Application,也就是我们的应用程序放在这个目录下。如webserver,webrowser等,如下图所示。

core目录是contiki操作系统的内核所在。

其中cfs是contiki file system interface 模块,provide a lightweight flash system,called Coffee。

也就是文件系统。

其中ctk是contiki的图形界面模块,提供了graphical user interface。

其中dev外部设备的驱动文件,如led,radio,watchdog等。

这里要和cpu目录下的dev做区分,cpu/dev是cpu内部的设备,像串口rs232等。

其中lib提供一些常用库文件,如memb、mmem内存分配,list数据结构,random随机数生成等。

如图:

其中loader模块支持运行时动态加载和链接模块(support dynamic loading and linking of modules at run-time)。

这可用于重编程,即节点布设好之后,发现bug或者想更新程序,可用这个模块实现。

The Contiki module loader can load, relocate, and link standard ELF files that can optionally be stripped off their debugging symbols to keep their size down.

其中net提供两个协议栈,即uip和rime,uip支持ip6和ip4,这个是contiki的重头戏,整体概览,下一篇再写。

其中sys是系统运行的机制所在:

protothread机制的实现文件pt.h,lc.h,lc-switch.h,lc-addrlabels.h等。

process相关文件如proces.c,procinit.c等。

timer相关文件:clock.h,timer.c,stimer.c,etimer.c,ctimer.c,rtimer.c等。

power awareness相关文件:energest.c,记录能量消耗情况(Contiki provides mechanisms for estimating the system power consumption and for understanding where the power was spent.)

cpu目录下提供特定硬件底层的实现,contiki支持很多cpu(stm8官方没有提供),如:

用stm32w108来说明:

可以看到底层实现文件clock.c和rtimer-arch.c等文件。

这里的dev和core/dev有区别,cpu/dev是cpu内部的设备,如串口通信等。

doc目录下提供了一些说明文档,这是学习资料之一。

examples目录下,提供了大量的例子,通过阅读相应的例子可以更好地理解怎样应用contiki。

There are plenty of examples in the Contiki source code tree to help you get started with your own code.

Some examples show how to program network code, others show how to interact with the platform hardware,

yet others demonstrate different aspects of the Contiki system.

platform目录提供不同平台的实现文件,可以理解为main函数就在这个目录下。

注意跟cpu目录区分开来,cpu目录是底层实现的目录。

platform是最终展示给用户的,举个例子,在pc机中相同cpu可以有不同的platform,如win7,win10,linux(ubuntu,red等)。

regression-tests目录,测试contiki是否正常工作。

To ensure that the Contiki code works as expected, the Contiki developers use a set of nightly regression tests that test important aspects of Contiki on a daily basis in the Cooja simulator.

The regression test scripts can be used as a starting point for setting up simulations or to investigate how different Contiki mechanisms work.

tools目录,提供一些常用的工具,比如大名鼎鼎的仿真工具cooja就在这里。

Contiki devices often make up large wireless networks. Developing and debugging software for such networks is really hard.

Cooja, the Contiki network simulator, makes this tremendously easier by providing a simulation environment that

allows developers to both see their applications run in large-scale networks or in extreme detail on fully emulated hardware devices.

Contiki源码结构的更多相关文章

  1. [译] 给PHP开发者的PHP源码-第一部分-源码结构

    文章来自:http://www.hoohack.me/2016/02/04/phps-source-code-for-php-developers-ch 原文:http://blog.ircmaxel ...

  2. 轻量级富文本编辑器wangEditor源码结构介绍

    1. 引言 wangEditor——一款轻量级html富文本编辑器(开源软件) 网站:http://www.wangeditor.com/ demo演示:http://www.wangeditor.c ...

  3. PostgreSQL9.2.4内核源码结构介绍

    PostgreSQL的源代码可以随意获得,其开源协议也允许研究者任意修改,这里介绍一下PostgreSQL的源码结构以及部分实现机制.下载PostgreSQL源代码并减压后,其一级目录结构如下图: P ...

  4. Nginx源码结构

    上一章对Nginx的架构有了一个初步的了解.这章,为了对源码仔细的剖析,先要对Nginx的源码结构有一个了解.从宏观上把握源码模块的结构. 一.nginx源码的3个目录结构 在安装的nginx的目录下 ...

  5. linux内核源码结构

    一.概述 Linux内核庞大,但是这些文件的结构还是有章可循的,分别位于不同的目录下,各个目录功能相对独立. 二.源码结构表 目录名 描述 arch 体系结构相关的代码,对于每个架构的CPU,arch ...

  6. OVS 总体架构、源码结构及数据流程全面解析

    在前文「从 Bridge 到 OVS」中,我们已经对 OVS 进行了一番探索.本文决定从 OVS 的整体架构到各个组件都进行一个详细的介绍. OVS 架构 OVS 是产品级的虚拟交换机,大量应用在生产 ...

  7. Spring Boot 2.0系列文章(五):Spring Boot 2.0 项目源码结构预览

    关注我 转载请务必注明原创地址为:http://www.54tianzhisheng.cn/2018/04/15/springboot2_code/ 项目结构 结构分析: Spring-boot-pr ...

  8. 【Android 系统开发】Android框架 与 源码结构

    一. Android 框架 Android框架层级 : Android 自下 而 上 分为 4层; -- Linux内核层; -- 各种库 和 Android运行环境层; -- 应用框架层; -- 应 ...

  9. Nginx源码结构及如何处理请求

    一.源码结构   1:下载安装包后,解压,可以看到目录结构,其中src目录下放的是源码       2:src源码目录下,可以看到这几个目录     mail:mail目录中存放了实现Nginx服务器 ...

随机推荐

  1. IOS之怎样把自己开发的App安装到越狱的手机

    场景: 有开发人员账号,能够把设备加到开发人员账号中,真机调试.如今须要打包,安装到的越狱手机上(此越狱手机没有加到开发人员账号中,另外公司的人). 常识: 没有越狱的话,最大的问题就是设备的签名,每 ...

  2. POJ 题目3264 Balanced Lineup(RMQ)

    Balanced Lineup Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 39046   Accepted: 18291 ...

  3. LeetCode 206 Reverse Linked List(反转链表)(Linked List)(四步将递归改写成迭代)(*)

    翻译 反转一个单链表. 原文 Reverse a singly linked list. 分析 我在草纸上以1,2,3,4为例.将这个链表的转换过程先用描绘了出来(当然了,自己画的肯定不如博客上面精致 ...

  4. 我如何添加一个空目录到Git仓库?

    新建了一个仓库,只是创建一些目录结构,还不里面放什么,要放的内容还没有,还不存在,应该怎么办呢? Git 是不跟踪空目录的,所以需要跟踪那么就需要添加文件! 也就是说 Git 中不存在真正意义上的空目 ...

  5. Web Service之Soap请求响应内容中文编码解密

    java模拟Soap请求测试Web Service接口,发现Web Service响应内容中的中文竟然是编码格式.比如: 中文:退保成功 Soap中文编码:退保成功   我仔细分析后发现,退编码实际上 ...

  6. JS图片预加载插件

    在开发H5项目中有时候会遇到要加载大量图片的情况,利用预加载技术可以提高用户浏览时的体验. 1)概念:懒加载也叫延迟加载:JS图片延迟加载,延迟加载图片或符合某些条件时才加载某些图片.预加载:提前加载 ...

  7. ceres g2o 安装

    .ceres 安装 Git clone https://github.com/ceres-solver/ceres-solver 安装依赖: # CMake sudo apt-get install ...

  8. go的timer定时器实现

    示例如下: package main import ( "fmt" "time" ) func testTimer1() { go func() { fmt.P ...

  9. 12 redis之aof日志持久化

    Aof 的配置 appendonly no # 是否打开 aof日志功能 appendfsync always # 每1个命令,都立即同步到aof. 安全,速度慢 appendfsync everys ...

  10. notHere 对框架解决方案的框架预期处理

    <script> import wepy from 'wepy' import api from '../api/api' import util from '../utils/util' ...