欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    vxworks嵌入式操作系统.pptx

    • 资源ID:80108311       资源大小:1.25MB        全文页数:92页
    • 资源格式: PPTX        下载积分:20金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要20金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    vxworks嵌入式操作系统.pptx

    TaskEach task has its own context,which is the CPU environment and system resources that the task sees each time it is scheduled to run by the kernel.A tasks context is saved in the task control block(TCB).第1页/共92页TaskA tasks context includes:-a thread of execution;that is,the tasks program counter -the CPU registers and(optionally)floating-point registers -I/O assignments for standard input,output,and error -a delay timer -a time-slice timer -kernel control structures -signal handlers -debugging and performance monitoring values第2页/共92页TaskThe default task scheduling algorithm in wind is priority-based preemptive scheduling.Round Robin is an optional algorithm.The wind kernel has 256 priority levels,numbered 0 through 255.Priority 0 is the highest and priority 255 is the lowest.第3页/共92页Task Scheduler Control Routines第4页/共92页TaskTask LockWhen a task disables the scheduler by calling taskLock(),no priority-based preemption can take place while that task is running.If the task explicitly blocks or suspends,the scheduler selects the next highest-priority eligible task to execute.When the preemption-locked task unblocks and begins running again,preemption is again disabled.The taskLock()prevent task context switching,but do not lock out interrupt handling.第5页/共92页Task Control Routine第6页/共92页TasktaskSpawnTask Name and ID RoutinesTask Information RoutinesTask Deleting RoutinesTask Control RoutinesTask Hook Routines第7页/共92页Task Spawn第8页/共92页Task Name and ID Routines第9页/共92页Task Information Routines第10页/共92页Task Information Routines第11页/共92页Task Deleting Routines第12页/共92页Task Deleting Routines第13页/共92页Task Control Routines第14页/共92页Task Hook Routines第15页/共92页Shared Code and ReentrancyA single copy of code executed by multiple tasks is called shared code.A subroutine is reentrant if a single copy of the routine can be called from several task contexts simultaneously without conflict.Modify global or static variables.第16页/共92页Code Reentrancy SolutionsDynamic Stack VariablesGuarded Global and Static VariablesTask Variables第17页/共92页Dynamic Stack Variables第18页/共92页Guarded Global and Static VariablesProviding a mutual-exclusion mechanism to prohibit tasks from simultaneously executing critical sections of code.第19页/共92页Task Variables第20页/共92页Intertask CommunicationShared Data StructureMutual ExclusionSemaphoresMessage QueuesPipesNetwork Intertask CommunicationSignals第21页/共92页Shared Data StructuresGlobal variablesLinear buffersRing buffersLinked listsPointers第22页/共92页Shared Data Structures第23页/共92页Mutual ExclusionDisable interruptsDisable preemptionResource locking with semaphores第24页/共92页Disable InterruptsThe most powerful methodIt prevents the system from responding to external events for the duration of these locks.Keep the duration of interrupt lockouts short.第25页/共92页Preemptive locksLess restrictive form of mutual exclusion.No other task is allowed to preemptive the current executing task,ISR are able to execute.Tasks of higher priority are unable to execute until the locking task leaves the critical region.第26页/共92页SemaphoresHighly optimized and provide the fastest intertask communication mechanism in VxWorks.Three types of Wind semaphores:-Binary-Mutual exclusion-Counting第27页/共92页Semaphore Control Routines第28页/共92页Binary Semaphore第29页/共92页Binary Semaphore第30页/共92页Binary Semaphore-Mutual Exclusion第31页/共92页Binary Semaphore-Mutual Exclusion第32页/共92页Binary Semaphore-Synchronization第33页/共92页Binary Semaphore-Synchronization第34页/共92页Binary Semaphore-Synchronization第35页/共92页Mutual Semaphore-Recursive Resource Access第36页/共92页Mutual Semaphore-Recursive Resource Access第37页/共92页Counting Semaphores第38页/共92页Message QueueMessage queues allow a variable number of messages,each of variable length,to be queued.Tasks and ISRs can send messages to a message queue,and tasks can receive message form a message queue.Multiple tasks can send to and receive from the same message queue.Full-duplex communication between two tasks generally requires two message queues,one for each direction.第39页/共92页Message Queues第40页/共92页Wind Message Queue Control第41页/共92页Message Queue Example第42页/共92页Message Queue Example第43页/共92页Message Queue Example第44页/共92页Message Queues第45页/共92页PipesPipes provide an alternative interface to the message queue facility that goes through the VxWorks I/O system.第46页/共92页SocketsIn VxWorks,the basis of intertask communication across the network is sockets.VxWorks supports the Internet protocols TCP and UDP.TCP provides reliable,guaranteed,two-way transmission of data with stream sockets.UDP provides a simple but less robust form of communication.第47页/共92页RPCRemote Procedure Calls(RPC)is a facility that allows a process on a machine to call a procedure that is executed by another process on either the same machine or a remote machine.第48页/共92页SignalSignals asynchronously alter the control flow of a task.Any task or ISR can raise a signal for a particular task.The task being signaled immediately suspends its current thread of execution and executes the task-specified signal handler routine.第49页/共92页SignalSignals asynchronously alter the control flow of a task.Any task or ISR can raise a signal for a particular task.The task being signaled immediately suspends its current thread of execution and executes the task-specified signal handler routine.第50页/共92页EventVxWorks events are means of communication between tasks and interrupt routine,between tasks and other tasks,or between tasks and VxWorks objects.VxWorks objects are referred to as resources such as semaphores and message queue.第51页/共92页EventSending and Receiving EventsEvents can be sent from a resource to a task,from an ISR to a task,or directly between two tasks.Waiting for EventsA task can wait for multiple events from one or more resources.Each source can send multiple events,and a task can also wait to receive only one event,or all events.第52页/共92页EventRegistering for EventsOnly one task can register itself to receive events from a resource.If another task subsequently registers with the same resource,the previously registered task is automatically unregistered.Freeing ResourceWhen a resource sends to a task to indicate that it is free,it does not mean that resource is reserved.第53页/共92页EventFree Resource DefinitionMutex Semaphore-A mutex semaphore is considered free when it no longer has an owner and no one is pending on it.Binary Semaphore-A binary semaphore is considered free when no task owns it and no one is waiting for it.第54页/共92页EventFree Resource DefinitionCounting Semaphore-A counting semaphore is considered free when its counts is nonzero and no one is pending on it.Message Queue-A message queue is considered free when a message queue is present in the queue and no one is pending for the arrival of a message in that queue.第55页/共92页EventSending and Receiving EventsEvents can be sent from a resource to a task,from an ISR to a task,or directly between two tasks.Waiting for EventsA task can wait for multiple events from one or more resources.Each source can send multiple events,and a task can also wait to receive only one event,or all events.第56页/共92页Watchdog TimersVxWorks includes a watchdog-timer mechanism that allows any C function to be connect to a specified time delay.Function invoked by watchdog timers execute as interrupt service code at the interrupt level of the system clock.第57页/共92页Watchdog Timers Calls第58页/共92页Watchdog Timers Example第59页/共92页Event Register Routine第60页/共92页Interrupt Service Routine第61页/共92页intConnect Routine第62页/共92页Appendix:Shell Run a shellVariables in shellC commands in shell:printfShell commands:i,ti,w,tw,第63页/共92页Run a shell 第64页/共92页Variables in shell第65页/共92页C commands in shell第66页/共92页Shell commands:i第67页/共92页Shell Commands:td第68页/共92页Shell Commands:ts&tr第69页/共92页Shell Commands:ti第70页/共92页Shell Commands:w第71页/共92页Shell Commands:tw第72页/共92页Shell Commands:checkStack第73页/共92页Shell Commands:d第74页/共92页Shell Commands:d第75页/共92页Shell Commands:d第76页/共92页Shell Commands:ls第77页/共92页Shell Commands:pwd&cd第78页/共92页Shell Commands:h第79页/共92页Shell Commands:reboot第80页/共92页Shell Commands:semaphore第81页/共92页Shell Commands:semaphore第82页/共92页Shell Commands:semaphore第83页/共92页Shell Commands:semaphore第84页/共92页Shell Commands:semaphore第85页/共92页Shell Commands:Message Queue第86页/共92页Shell Commands:Message Queue第87页/共92页Shell Commands:Message Queue第88页/共92页Shell Commands:Message Queue第89页/共92页Shell Commands:Message Queue第90页/共92页Shell Commands:Message Queue第91页/共92页谢谢您的观看!第92页/共92页

    注意事项

    本文(vxworks嵌入式操作系统.pptx)为本站会员(莉***)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开