VxWorks

VxWorks 消息队列

末鹿安然 提交于 2019-12-11 14:16:09
消息队列 消息传递例子 消息创建: g_msgQID = msgQCreate("NC_MSG_Q_ID", C_MSGQ_MAX_MSGS, C_MSGQ_MAX_MSG_LENGTH); 消息发送: msgQSend(g_msgQzb2tcp, (BYTE*)&stZbDataAll, MSG_LEN_ZBDATA, NO_WAIT,MSG_PRI_NORMAL); msg_id buff buf_len type priority 消息接收: msgQReceive(g_msgQzb2tcp, RecDataFrZb, MSG_LEN_ZBDATA, NO_WAIT); msg_id buff buf_len type 来源: CSDN 作者: VxWorks_developer 链接: https://blog.csdn.net/m0_37585897/article/details/103490724

how to restrict number of connections in client server program

北战南征 提交于 2019-12-11 07:12:43
问题 I want a server program which should accept only maximum of one connection and it should discard other connections. How can I achieve this? 回答1: Only accept() a single connection. Here is a typical server routine: s = socket(...); bind(s, ...); listen(s, backlog); while (-1 != (t = accept(s, ...))) { // t is a new peer, maybe you push it into an array // or pass it off to some other part of the program } Every completed accept() call, returns the file descriptor for a new connection. If you

How can I specify the maximum amount of heap an RTP can use in VxWorks?

馋奶兔 提交于 2019-12-11 01:30:02
问题 We are creating a Real-Time Process in VxWorks 6.x, and we would like to limit the amount of memory which can be allocated to the heap. How do we do this? 回答1: When creating a RTP via rtpSpawn(), you can specify an environment variable which controls how the heap behaves. There are 3 environment variables: HEAP_INITIAL_SIZE - How much heap to allocate initially (defaults to 64K) HEAP_MAX_SIZE - Maximum heap to allocate (defaults to no limit) HEAP_INCR_SIZE - memory increment when adding to

Maximum size of message for strerror_r on VxWorks

荒凉一梦 提交于 2019-12-11 01:24:44
问题 VxWorks provides a version of strerror_r that only takes two parameters. STATUS strerror_r ( int errcode, /* error number */ char *buffer /* string buffer */ ) cURL mentions MAXERRSTR_SIZE . The vxworks-style strerror_r() does use the buffer we pass to the function. The buffer size should be at least MAXERRSTR_SIZE (150) defined in rtsold.h But I can't seem to find the file rtsold.h anywhere in the distribution. What is the maximum size of the message copied into the buffer? Is there a

How do I use the vxWorks debug agent to perform pre-kernel debugging?

倖福魔咒の 提交于 2019-12-10 20:05:15
问题 The vxWorks documentation states: The WDB agent itself is independent of the target operating system: it attaches to run-time OS services through a virtual-function run-time interface. The WDB agent can execute before VxWorks is running (as in the early stages of porting a BSP to a new board)." How can I use the debug agent before the vxWorks kernel is running? 回答1: First, in order to be able to use the agent to perform pre-kernel debugging, you must have a serial port available for debugging

C++ 11 in vxworks

百般思念 提交于 2019-12-10 13:26:38
问题 I am new to VxWorks and I am developing a software using C++ in VxWorks platform. I want to know whether VxWorks compiler supports C++ 11 standard. The reason I am asking this question is because there is no shrink_to_fit() std::vector function available(this function is introduced in c++ 11 standard). So I want to know is there any way to compile the code with C++ 11 standard in VxWorks. 回答1: There are commercial versions of g++ available for vxWorks, which are supporting c++11. As far as I

How does a VxWorks scheduler get executed?

柔情痞子 提交于 2019-12-08 17:05:50
问题 Would like to know how the scheduler gets called so that it can switch tasks. As in even if its preemptive scheduling or round robin scheduling - the scheduler should come in to picture to do any kind of task switching. Supposing a low priority task has an infinite loop - when does the scheduler intervene and switch to a higher priority task? Query is: 1. Who calls the scheduler? [in VxWorks] 2. If it gets called at regular intervals - how is that mechanism implemented? Thanks in advance. -

Redirecting to stdin in order to execute script in vxworks 6.7

Deadly 提交于 2019-12-08 01:08:33
问题 I need to execute a script in vxWorks 6.7. It can be done with the execute() function in vxworks 5.5. The solution that I am applying is to use stdin redirection as in the following code: newStdIn = open("myScript.txt",O_RDONLY,0644); oldStdIn=ioGlobalStdGet(STD_IN); ioGlobalStdSet(STD_IN, newStdIn); /*Read file here and execute*/ ioGlobalStdSet(STD_IN,oldStdIn); /*Restore old stdIn*/ close(newStdIn); I am missing the read and execute part (where the comment is). EDIT: According to the

Mapping a VxWorks image onto RAM (BSP)

烈酒焚心 提交于 2019-12-08 00:23:45
问题 Looking at a BSP package supplied with VxWorks shows the following memory mapping for the image: (from Pentium4) Parameter RAM_HIGH_ADRS { NAME Bootrom Copy region DEFAULT (INCLUDE_BOOT_APP)::(0x00008000) \ 0x00108000 } Parameter RAM_LOW_ADRS { NAME Runtime kernel load address DEFAULT (INCLUDE_BOOT_RAM_IMAGE)::(0x00508000) \ (INCLUDE_BOOT_APP)::(0x00108000) \ 0x00308000 } But this one looks strange to me, how can RAM_LOW_ADRS > RAM_HIGH_ADRS ? Per what I could understand, the boot loader is

vxworks简介

*爱你&永不变心* 提交于 2019-12-06 12:42:54
本文转自百度百科 VxWorks 是 美国 Wind River System 公司( 以下简称风河 公司 ,即 WRS 公司)推出的一个 实时操作系统 。 Tornado 是WRS 公司推出的一套实时操作系统开发环境,类似Microsoft Visual C,但是提供了更丰富的调试、仿真环境和工具。 VxWorks的概述 VxWorks操作系统是美国温瑞尔(WindRiver)公司于1983年设计开发的一种 嵌入式实时操作系统(RTOS) , 是嵌入式开发环境的关键组成部分。 良好的持续发展能力、高性能的内核以及友好的用户开发环境, 在嵌入式实时操作系统领域占据一席之地 。 VxWorks支持几乎所有现代市场上的嵌入式CPU, 包括x86系列、MIPS、 PowerPC、Freescale ColdFire、Intel i960、SPARC、SH-4、ARM, StrongARM以及xScaleCPU。它以其良好的可靠性和卓越的实时性被广泛地应用在通信、军事、航空、航天等高精尖技术及实时性要求极高的领域中,如卫星通讯、军事演习、弹道制导、飞机导航等。在美国的F-16、F/A-18战斗机、B-2隐形轰炸机和爱国者导弹上,甚至连1997年7月在火星表面登陆的火星探测器,2008年5月在火星表面上登陆的凤凰号火星探测器上也都使用到了VxWorks。 VxWorks 的组成