在linux跑xenomai vkworks skin的测试

1 代码

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

/*
 * Copyright (C) 2001,2002,2003 Philippe Gerum <[email protected]>.
 *
 * 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...

时间: 2024-12-05 23:37:03

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

玩转Linux网络namespace-单机自环测试与策略路由

上周有厂商到公司测试,拿了一块据说很猛的网络处理加速PCIe板卡,拎在手里沉甸甸的很有分量,最让人意淫的是那4个万兆光口,于是我迫不及待的想要一览光口转发时那种看不见的震撼.       可是,仅凭4个光口怎么测试?起码你要有个"对端"啊!任何人应该都不想扛着三台机器在客户们之间跑来跑去测试其转发性能,当然你也不能指望客户那里就一定有你需要的"对端"设备,比如我们公司就没有这种和万兆光口对接的设备,不过赶巧的是,那天还真有一台设备带有万兆光口,但是只是碰巧了.最佳的

谢烟客---------Linux之Bash基础特性条件测试&&自定义退出状态码(6)

条件测试 判断某需求是否满足,需要由测试机制来实现. 根据命令的执行状态结果,表达不同的测试条件 1.根据id命令的执行状态结果,判断用户是否存在 [[email protected] ~]# id root uid=0(root) gid=0(root) groups=0(root) [[email protected] ~]# echo $? 0 [[email protected] ~]# id help id: help: no such user [[email protected] 

linux mysql 卸载,安装,测试全过程

Mysql卸载 yum remove mysql mysql-server mysql-libs compat-mysql51 rm -rf /var/lib/mysql rm /etc/my.cnf 查看是否还有mysql软件: rpm -qa|grep mysql 有的话继续删除 Mysql安装 1>若本地没有安装包 可以考虑使用yum命令进行下载 # yum -y install mysql-server # yum -y install php-mysql 2>安装后,MySQL自动启

ubuntu+systemtap进行Linux内核和用户空间开发测试

ubuntu+systemtap进行Linux内核和用户空间开发测试 Sailor_forever  sailing_9806#163.com (本原创文章发表于Sailor_forever 的个人blog,未经本人许可,不得用于商业用途.任何个人.媒体.其他网站不得私自抄袭:网络媒体转载请注明出处,增加原文链接,否则属于侵权行为.如有任何问题,请留言或者发邮件给sailing_9806#163.com) [摘要]本文主要介绍在ubuntu平台 + 自定义内核上如何安装systemtap工具包及

Linux环境下配置真机测试

1 将测试机和开发机通过usb连接 2 通过命令查看usb连接情况 Shell命令: lsusb 会将当前usb连接情况展示出来: Shell代码 : Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 013: ID 12d1:1038 Huawei Technolo

SpringBoot集合Linux的FastDFS与Nginx上传图片测试错误com.github.tobato.fastdfs.exception.FdfsConnectException: 无法获取服务端连接资源:can&#39;t create connection to/192.168.1.104:22122

发布于:2019-07-03 14:59 报错 com.github.tobato.fastdfs.exception.FdfsConnectException: 无法获取服务端连接资源:can't create connection to/192.168.1.104:22122 ...... ...... ...... ...... ...... ...... ...... ...... 解决办法 依次执行以下两条命令,来关闭防火墙 iptables -L iptables -F 如果输入之后

树莓派+8187L 安装 kali linux 跑pin

学术交流使用,小伙伴不用乱用哦 树莓派一个 一个TP 迷你网卡 一个8187L卡皇(某宝老板没有3070了)TF卡一个(8G以上) 3070更小 和 树莓派更般配 或者使用全向天线 这次我用的是定向 使用 tp迷你网卡做ap 一个5V2A的充电宝 一个小书包 放在书包里最好使用全向天线. 用手机连接到树莓派 可以实现某些特殊的渗透 最后后一张放图给大家看 首先去下载 kali linux 地址:https://www.offensive-security.com/kali-linux-vmwar

模仿RA8875/RA8876做个图形LCD控制器,STM32跑emWin接VGA显示器测试OK

RA8875相信大家都熟悉吧?我们很多工程师都热衷于STM32+RA8875+emWin做界面显示,去年瑞佑又推出了同系列新产品RA8876/RA8877. 图形LCD控制器的系统主构架是:FPGA+DDR2+Nand-Flash,FPGA里面还跑了个8051,因为要做指令缓冲.FAT32文件系统.Nand-Flash驱动程序,这三样东西没有C语言单靠FPGA是没法实现的,其实和RA8875/RA8876最大的不同就是这三个功能,可以说在某些方面是RA8875/RA8876的升级版!当然成本也没

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

一.简介 Oracle数据库在系统运维中的重要性不言而喻,通过熟悉Oracle的安装来加深对操作系统和数据库知识的了解.Linux安装Oracle前期修改linux内核参数很重要,其实就是linux下的对Oracle数据库配置的过程.(很重要,如何不配置完全在后期安装过程中会报错的) 安装测试的环境如下: 操作系统:CentOS 6.5 X64 数据库:OracleDatabase 11g Release 2 (11.2.0.1.0) for Linux x86-64 简易过程: 1. 安装需要