1 代码

##############################################################

/*
 * Copyright (C) 2001,2002,2003 Philippe Gerum <rpm@xenomai.org>.
 *
 * VxWorks is a registered trademark of Wind River Systems, Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#include <vxworks/vxworks.h>

#define ROOT_TASK_PRI        100
#define ROOT_STACK_SIZE      16*1024

#define CONSUMER_TASK_PRI    115
#define CONSUMER_STACK_SIZE  24*1024

#define PRODUCER_TASK_PRI    110
#define PRODUCER_STACK_SIZE  24*1024

#define CONSUMER_WAIT 150
#define PRODUCER_TRIG 40

int root_thread_init(void);
void root_thread_exit(void);

#if !defined(__KERNEL__) && !defined(__XENO_SIM__)

#include <sys/mman.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>

#define MODULE_LICENSE(x)

#define xnarch_printf printf

int main (int argc, char *argv[])
{
    int tid;

mlockall(MCL_CURRENT|MCL_FUTURE);

atexit(&root_thread_exit);

tid = taskSpawn("RootTask",
            ROOT_TASK_PRI,
            0,
            ROOT_STACK_SIZE,
            (FUNCPTR)&root_thread_init,
            0,0,0,0,0,0,0,0,0,0);
    if (tid)
    pause();

return 1;
}

#endif /* Native, user-space execution */

MODULE_LICENSE("GPL");

static const char *satch_s_tunes[] = {
    "Surfing With The Alien",
    "Lords of Karma",
    "Banana Mango",
    "Psycho Monkey",
    "Luminous Flesh Giants",
    "Moroccan Sunset",
    "Satch Boogie",
    "Flying In A Blue Dream",
    "Ride",
    "Summer Song",
    "Speed Of Light",
    "Crystal Planet",
    "Raspberry Jam Delta-V",
    "Champagne?",
    "Clouds Race Across The Sky",
    "Engines Of Creation"
};

static int producer_tid,
       consumer_tid,
       message_qid;

void consumer_task (int a0, int a1, int a2, int a3, int a4,
            int a5, int a6, int a7, int a8, int a9)
{
    char *msg;
    int sz;

for (;;)
    {
    taskDelay(CONSUMER_WAIT);

while ((sz = msgQReceive(message_qid,(char *)&msg,sizeof(msg),NO_WAIT)) != ERROR)
        xnprintf("Now playing %s...\n",msg);
    }
}

void producer_task (int a0, int a1, int a2, int a3, int a4,
            int a5, int a6, int a7, int a8, int a9)
{
    int next_msg = 0;
    const char *s;

for (;;)
    {
    taskDelay(PRODUCER_TRIG);

s = satch_s_tunes[next_msg++];
    next_msg %= (sizeof(satch_s_tunes) / sizeof(satch_s_tunes[0]));

msgQSend(message_qid,(char *)&s,sizeof(s),WAIT_FOREVER,MSG_PRI_NORMAL);
    }
}

int root_thread_init (void)

{
    message_qid = msgQCreate(16,sizeof(char *),MSG_Q_FIFO);

consumer_tid = taskSpawn("ConsumerTask",
                 CONSUMER_TASK_PRI,
                 0,
                 CONSUMER_STACK_SIZE,
                 (FUNCPTR)&consumer_task,
                 0,0,0,0,0,0,0,0,0,0);

producer_tid = taskSpawn("ProducerTask",
                 PRODUCER_TASK_PRI,
                 0,
                 PRODUCER_STACK_SIZE,
                 (FUNCPTR)&producer_task,
                 0,0,0,0,0,0,0,0,0,0);
    return 0;
}

void root_thread_exit (void)

{
    taskDelete(producer_tid);
    taskDelete(consumer_tid);
    msgQDelete(message_qid);
}

#############################################################################

2 添加vxworks内核模块

modprobe xeno_vxworks

3 xeno vxworks的测试结果

#############################################################

Now playing Surfing With The Alien...                                           
Now playing Lords of Karma...                                                   
Now playing Banana Mango...                                                     
Now playing Psycho Monkey...                                                    
Now playing Luminous Flesh Giants...                                            
Now playing Moroccan Sunset...                                                  
Now playing Satch Boogie...                                                     
Now playing Flying In A Blue Dream...                                           
Now playing Ride...                                                             
Now playing Summer Song...                                                      
Now playing Speed Of Light...                                                   
Now playing Crystal Planet...                                                   
Now playing Raspberry Jam Delta-V...                                            
Now playing Champagne?...                                                       
Now playing Clouds Race Across The Sky...                                       
Now playing Engines Of Creation...                                              
Now playing Surfing With The Alien...                                           
Now playing Lords of Karma...                                                   
Now playing Banana Mango...                                                     
Now playing Psycho Monkey...                                                    
Now playing Luminous Flesh Giants...                                            
Now playing Moroccan Sunset...                                                  
Now playing Satch Boogie...                                                     
Now playing Flying In A Blue Dream...                                           
Now playing Ride...                                                             
Now playing Summer Song...                                                      
Now playing Speed Of Light...                                                   
Now playing Crystal Planet...                                                   
Now playing Raspberry Jam Delta-V...                                            
Now playing Champagne?...                                                       
Now playing Clouds Race Across The Sky...                                       
Now playing Engines Of Creation...                                              
Now playing Surfing With The Alien...                                           
Now playing Lords of Karma...                                                   
Now playing Banana Mango...                                                     
Now playing Psycho Monkey...                                                    
Now playing Luminous Flesh Giants...                                            
Now playing Moroccan Sunset...                                                  
Now playing Satch Boogie...                                                     
Now playing Flying In A Blue Dream...                                           
Now playing Ride...                                                             
Now playing Summer Song...                                                      
Now playing Speed Of Light...                                                   
Now playing Crystal Planet...                                                   
Now playing Raspberry Jam Delta-V...                                            
Now playing Champagne?...                                                       
Now playing Clouds Race Across The Sky...                                       
Now playing Engines Of Creation...                                              
Now playing Surfing With The Alien...                                           
Now playing Lords of Karma...                                                   
Now playing Banana Mango...                                                     
Now playing Psycho Monkey...

在linux跑xenomai vkworks skin的测试的更多相关文章

  1. linux下开发板网络速度测试记录

        由于做的项目对于网络和USB的读写速度有很高的要求,因此新拿回来的板子要测试网络和usb的最佳传输速度.要考虑不少因素,先把我能想到的记录下来.     测试的环境是开发板和ubuntu虚拟机 ...

  2. linux环境下安装tcping工具测试访问超时

    wget https://sources.voidlinux.eu/tcping-1.3.5/tcping-1.3.5.tar.gz tar zxvf tcping-1.3.5.tar.gz cd t ...

  3. DolphinScheduler 功能开发:⼯作流级别任务空跑(后端),测试工作流是否正确执行...

    点击上方 蓝字关注我们 ✎ 编 者 按 在今年由中国科学院软件研究所主办的开源软件所供应链点亮计划-开源之夏活动中,有不少小伙伴提交了关于 DolphinScheduler 的项目,本期是来自成都信息 ...

  4. 通过LoadGenerator将Linux作为负载机进行压力测试

    前提说明: 测试架构:controller部署在windows操作系统下(windows下安装loadrunner的过程,可以去网上搜下,这里不做解释),loadgenerator部署在linux下. ...

  5. linux上实现jmeter分布式压力测试(转)

    摘要:最近根据公司工作的需求,学习了一些压力测试的知识,目前,公司使用的是jmeter进行压力测试.下面就记录下近期的学习.我想将这次的博文分成三个部分:1.开始测试前的准备(测试环境的搭建)2.在一 ...

  6. win7下virtualbox装linux共享win7文件问题(已测试可用)

    virtualbox这个比较强大,在win7上跑redhat5u4很流畅.os之间共享文件是个大家都很关心的问题,这会直接关系到虚拟机用的爽不爽. 在win7和其上的虚拟机linux之间共享文件也很容 ...

  7. Linux安装Oracle 11G过程(测试未写完)

    一.简介 Oracle数据库在系统运维中的重要性不言而喻,通过熟悉Oracle的安装来加深对操作系统和数据库知识的了解.Linux安装Oracle前期修改linux内核参数很重要,其实就是linux下 ...

  8. Linux Shell编程(19)——测试与分支

    case和select结构在技术上说不是循环,因为它们并不对可执行的代码块进行迭代.但是和循环相似的是,它们也依靠在代码块的顶部或底部的条件判断来决定程序的分支.在代码块中控制程序分支case (in ...

  9. Linux跑脚本用sh和./有什么区别?(转)

    sh是一个shell.运行sh a.sh,表示我使用sh来解释这个脚本:如果我直接运行./a.sh,首先你会查找脚本第一行是否指定了解释器,如果没指定,那么就用当前系统默认的shell(大多数linu ...

随机推荐

  1. (剑指Offer)面试题13:在O(1)时间内删除链表结点

    题目: 在给定单向链表的头指针和一个结点指针,定义一个函数在O(1)时间内删除该结点.链表结点与函数的定义如下: struct ListNode{ int val; ListNode* next; } ...

  2. Microjs: 超棒的迷你框架和迷你类库搜罗工具

    你可以按条件方便的搜索需要的类库或者框架,以下为条件 基础框架 模板引擎 DOM操作 CSS动画 Javascript动画 数据操作 更多 阅读原文:Microjs: 超棒的迷你框架和迷你类库搜罗工具

  3. C#基础视频教程3.3 常见控件类型和使用方法

    前面介绍了微软的控件,也介绍了几个第三方控件,那么这些控件是如何做出来的?即便我们自己不做控件,也至少要理解控件的原理. 如果要创建一个自定义控件,首先新建一个C#下面的Windows窗体控件库   ...

  4. WebView加载网页文件

    转自:http://www.2cto.com/kf/201108/101518.html WebView(网络视图)能加载显示网页,可以将其视为一个浏览器.它使用了WebKit渲染引擎加载显示网页,实 ...

  5. Python - 带参数的方法

    import math class Point: def move(self, x, y): self.x = x self.y = y def reset(self): self.move(0, 0 ...

  6. WCF 之 数据契约

    前面几篇讲的都只能传递string类型的简单参数,数据契约就是用来解决如传递一个带有多个属性的Class类型的对象的. WCF推荐使用数据契约的方式实现数据的序列化.这部分的内容很好理解但是很重要,先 ...

  7. k-means聚类学习

    4.1.摘要 在前面的文章中,介绍了三种常见的分类算法.分类作为一种监督学习方法,要求必须事先明确知道各个类别的信息,并且断言所有待分类项都有一个类别与之对应.但是很多时候上述条件得不到满足,尤其是在 ...

  8. How to make a custom WIDGET in OpenERP

    转自:http://sahotaparamjitsingh.blogspot.com/2012/04/how-to-make-custom-widget-in-openerp.html   Hello ...

  9. MySQL比较两个表不同的数据

    在本教程中,您将学习如何比较两个表以找到不匹配的记录. 在数据迁移中,我们经常需要比较两个表,以便在一个表中标识另一个表中没有相应记录的记录. 例如,我们有一个新的数据库,其架构与旧数据库不同.我们的 ...

  10. cxf 生成客户端代码调用服务

    cxf是另一种发布webservice的方式,与jdk提供的相比 jdk提供的是wsimport cxf 提供的是 wsdl2java- d 地址 根据http://www.cnblogs.com/f ...