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. 服务器启动之后运行脚本在/etc/rc.d/rc.local中配置

    服务器启动之后运行脚本在/etc/rc.d/rc.local中配置 # ! /bin/sh # 启动svn /usr/bin/svnserve -d -r /var/svnroot/

  2. 身份证识别接口编写的JAVA调用示例

    此java文章是基本聚合数据证件识别接口来演示,基本HTTP POST请求上传图片并接收JSON数据来处理. 使用前你需要通过 https://www.juhe.cn/docs/api/id/153 ...

  3. HDU5294——Tricks Device(最短路 + 最大流)

    第一次做最大流的题目- 这题就是堆模板 #include <iostream> #include <algorithm> #include <cmath> #inc ...

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

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

  5. 楼梯跳跃代码web

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  6. 解析iscroll-小demo

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name ...

  7. robotframework使用之元素定位动态ID方法

    转自: http://blog.csdn.net/u011757108/article/details/53418671 一个弹出框所有元素ID竟然的动态的,关闭后再打开,里面的ID又变! 如下图:  ...

  8. spring中的事件 applicationevent 讲的确实不错

    event,listener是observer模式一种体现,在spring 3.0.5中,已经可以使用annotation实现event和eventListner里. 我们以spring-webflo ...

  9. com.opensymphony.xwork2.ognl.OgnlValueStack - Error setting expression 'customer.applyRate' with value '[Ljava.lang.String;@7d3fae2c'

    出错的3个最可能的原因:我是第二种错误 1.action配置错误 <action name="doCreateMeetingInfo" class="meeting ...

  10. os如何处理键盘的所有按键,显示or不显示,显示是如何显示

    [0]README 0.1) source code and text decription are from orange's implemention of a os , and for comp ...