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. linux中find的用法

    找所在目录的文件用 find -name “file*” -print  #注意不要用加文件路径,查找文件也好用双双引号括住: 也可以 find ./ -name “file*” -print

  2. LeetCode OJ 之 Ugly Number (丑数)

    题目: Write a program to check whether a given number is an ugly number. Ugly numbers are positive num ...

  3. mysql跨服务器查询

    MySQL FEDERATED引擎使用示例, 类似Oracle DBLINK 摘要: 本地MySQL数据库要访问远程MySQL数据库的表中的数据, 必须通过FEDERATED存储引擎来实现. 有点类似 ...

  4. 第一个Swift程序Hello World

    import Foundation print("Hello, World!") print("I am here!") var arr=["项羽&q ...

  5. 【LeetCode】Validate Binary Search Tree ——合法二叉树

    [题目] Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defin ...

  6. Winform GridView打印类

      using System;using System.Collections.Generic;using System.Text;using System.Drawing.Printing;usin ...

  7. HTML5 Support In Visual Studio 2010

    最近HTML5浪潮已经开始了,VS2010已经有一个扩展支持在HTML5智能提示.你可以从这里下载这个扩展: http://visualstudiogallery.msdn.microsoft.com ...

  8. [Android Studio 权威教程]最有用的快捷键

    上篇中我们讲了Android Studio怎样加入插件.这篇我们讲讲AS的快捷键.这里我说明的快捷键都是最最有用的,希望刚刚加入AS的朋友尽快的熟悉一下这几个快捷键,这样能够帮助你提高coding的效 ...

  9. 机器学习实战之SVM

    一引言: 支持向量机这部分确实很多,想要真正的去理解它,不仅仅知道理论,还要进行相关的代码编写和测试,二者想和结合,才能更好的帮助我们理解SVM这一非常优秀的分类算法 支持向量机是一种二类分类算法,假 ...

  10. JAVA中两个Set比较找出交集、差集、并集

    当做到某些功能的时候,使用Set能够快速方便地将需要的类型以集合类型保存在一个变量中,Set是最简单的一种集合,集合中的对象不按特定的方式排序,并且没有重复对象. //两个Set比较找出交集.差集.并 ...