VxWorks support-kr@windriver.com Copyright 2005 Wind River Systems, Inc.
Wind River & VxWorks? Network Equipment Industrial & Automotive Aerospace & Defense Consumer 30% 20% 25% 25% Media gateways Wireless access points WiMAX base stations Radio network controllers Broadband access systems Customer premises equipment VoIP phones Switches Telematics Vehicle tracking and airbag deployment notification Remote/mobile payment Traffic and point-ofinterest information Location-based services Infotainment Audio, gaming, video Navigation Powertrain / X-by-wire: steer, brake, drive Test & Measurement equipment Medical devices Robotics Power-generation equipment Semiconductor equipment Avionics Integrated Modular Avionics (IMA) cores Displays Flight controls Flight management Command and control Communications Software Defined Radio Intelligence, surveillance, and reconnaissance Radar, sonar Space Instruments Navigation Propulsion Weapons systems Smartphones Feature phones Portable media players Digital cameras Set-top boxes IPTVs PVR/DVRs Digital televisions Home access/gateways IP video security/monitors VoIP telephony Digital copiers Laser printers Multifunction printers 350 million devices worldwide use Wind River technology 2 Copyright 2005 Wind River Systems, Inc.
VxWorks Copyright 2005 Wind River Systems, Inc.
VxWorks : Embedded Hard Real Time OS Scalable VxWorks (=Linux SCHED_FIFO) (=Linux SCHED_RR) Task (Linux ) API ( + ) POSIX Asymetric(AMP) SMP 4 Copyright 2005 Wind River Systems, Inc.
VxWorks : Embedded Hard Real Time OS : 0( )~255( ) API( ) Supervisor Mode Function call (no trap, no jump table) User mode : Protection (Linux Default) Nested latency 5 Copyright 2005 Wind River Systems, Inc.
VxWorks vs. Linux Benchmark VxWorks 6.5 1.8G Hz Pentium4 Vanilla-2.6.12 2.8G Hz Pentium4 Interrupt Respone : 3.3 us Interrupt Respone : 5.8 us Kernel Task : 7.4 us User Task : 35 us Fork : 97 us Execve : 348 us http://www.opersys.com/lrtbf/ 6 Copyright 2005 Wind River Systems, Inc.
Task Task ID : Task Control Block Task ID Task : : 0( )~255( ) Task ( ) 7 Copyright 2005 Wind River Systems, Inc.
RR Task Task Task Task, Task /Static 8 Copyright 2005 Wind River Systems, Inc.
Task Stop Suspended context switch Suspended & Pended Suspend Breakpoint Hit Or Error Detected by ED&R Ready / Running Wait something Get something Pended Delay Done Delay Suspended & Delayed Wait something with Timeout Suspended & Pended & Delayed Delayed Get something or Timed Out Pended & Delayed 9 Copyright 2005 Wind River Systems, Inc.
Typical (~ VxWorks5.x) Shared Environment: Program code & data Kernel objects Heap Supervisor privilege tasks Direct device access I/O Custom Dev Driver Challenges Sem A App A Code Sem B App B Code VxWorks Kernel Environment 10 Copyright 2005 Wind River Systems, Inc. MsgQ A App C Code? Integration Symbols App D Code Task 1 VxWorks OS Modules VxWorks BSP Task 2 Driver 1 Task 3 Driver 2 App errors system errors Application ( ) Heap manager
RTP(Real Time Process) Linux Process Task Container RTP objects (semaphores, sockets, etc.) Task User mode Kernel Access System Call / Protection RTP Task RTP Direct Access RTP Kernel : Protection non-overlapped memory model 11 Copyright 2005 Wind River Systems, Inc.
RTP(Real Time Process) GREY: Supervisor only REST: SUP + USR RTP private mapping RTP overlap RTP System Call Supervisor Kernel task RTP Access Published API RTP-private memory mappings: rtpmemshow() similar output as vmcontextshow() 12 Copyright 2005 Wind River Systems, Inc.
RTP vs. Linux Process System call Address Space Protection : Processe Kernel Direct Access Process Etc. VxWorks Task (thread) Process Linux Process Tasks (pthreads) RTP Real Time / Determinism / Linux : Open & Generic VxWorks lightweight : Thread switching speed & latency 13 Copyright 2005 Wind River Systems, Inc.
RTP vs. Linux Process Global scheduling VxWorks RTP Task Scheduling : Task Task Create & load Caller RTP object & memory context. RTP Setup Caller can wait for the RTP to be up & running, or continue running concurrently. Linux RTP Linux Demand paging : Determinism (No Page Fault) MMU/MMU-less support Linux VxWorks non-overlapped memory model Non-overlapped : RTP virtual memory MMU and MMU-less programming model Linux overlapped memory model : requires an MMU Non-overlapped fork/exec(). µclinux fork/exec Compatibility with VxWorks kernel APIs Large subset of VxWorks kernel API (hardware Access BSP Processor feature Access API ) POSIX API 14 Copyright 2005 Wind River Systems, Inc.
ED&R(Error Detection & Report) Event ED&R log Circular buffer ED&R log Soft reboot (persistent memory) Exception Rebooting Booting Stack Pages Program Pages Address Space Heap Blocks Start Read only Stack Raw data Stop 0x0 15 Copyright 2005 Wind River Systems, Inc.
ED&R : void badfunc(funcptr *tp) { WIND_TCB *ptcb; ptcb = taskidcurrent; printf("addr=0x%x, Stack=0x%x ~ 0x%x\n", &tp, ptcb- >pstackbase, ptcb->pstackend); } (*(FUNCPTR) &tp)(); &tp FUNCPTR tp 16 Copyright 2005 Wind River Systems, Inc.
ED&R : -> Addr=0x863f98, Stack=0x864000 ~ 0x863000 program Exception current instruction address: 0x00863f98 Machine Status Register: 0x0008b032 Condition Register: 0x20000080 Task: 0x6dba48 "t54" 0x6dba48 (t54): task 0x6dba48 has had a failure and has been stopped. 0x6dba48 (t54): fatal kernel task-level exception! -> edrshow ERROR LOG ========= Log Size: Record Size: Max Records: 7 CPU Type: Errors Missed: Error count: 1 Boot count: 1 32768 bytes (8 pages) 4096 bytes 0x5a Generation count: 19 0 (old) + 0 (recent) 17 Copyright 2005 Wind River Systems, Inc.
ED&R : ==[1/1]============================================================== Severity/Facility: FATAL/KERNEL Boot Cycle: 1 OS Version: 6.0.0 Time: THU JAN 01 06:40:34 1970 (ticks = 1442068) Task: Injection Point: "t54" (0x006dba48) excarchlib.c:2532 fatal kernel task-level exception! <<<<<Memory Map>>>>> 0x00100000 -> 0x00268f28: kernel 0x0087b000 -> 0x00000000: ed_stack_exe.out 18 Copyright 2005 Wind River Systems, Inc.
ED&R : <<<<<Exception Information>>>>> program Exception current instruction address: 0x00863f98 Machine Status Register: 0x0008b032 Condition Register: 0x20000080 <<<<<Registers>>>>> r0 = 0x0087b0cc sp = 0x00863f90 r2 = 0x00000000 r3 = 0x00000029 r4 = 0x00000000 r5 = 0x00000001 r6 = 0x006dba48 r7 = 0x0000000a r8 = 0x00000000 r9 = 0x00000000 r10 = 0x00000001 r11 = 0x00863f98 r12 = 0x00000029 r13 = 0x00000000 r14 = 0x00000000 r15 = 0x00000000 r16 = 0x00000000 r17 = 0x00000000 r18 = 0x00000000 r19 = 0x00000000 r20 = 0x00000000 r21 = 0x00000000 r22 = 0x00000000 r23 = 0x00000000 r24 = 0x00000000 r25 = 0x00000000 r26 = 0x00000000 r27 = 0x00000000 r28 = 0x00000000 r29 = 0x00000000 r30 = 0x0087b094 r31 = 0x006dba48 msr = 0x0008b032 lr = 0x0087b0d8 ctr = 0x00863f98 pc = 0x00863f98 cr = 0x20000080 xer = 0x20000000 pgtblptr = 0x00649000 scsrtblptr = 0x0069bccc srtblptr = 0x0069bccc 19 Copyright 2005 Wind River Systems, Inc.
ED&R : <<<<<Disassembly>>>>> 0x863f78 04000dee.long 04000dee 0x863f7c 00863f98.long 00863f98 0x863f80 00863f18.long 00863f18 0x863f84 eeeeeeee.long eeeeeeee 0x863f88 eeeeeeee.long eeeeeeee 0x863f8c eeeeeeee.long eeeeeeee 0x863f90 00863fa0.long 00863fa0 0x863f94 0087b0cc.long 0087b0cc *0x863f98 001b9048.long 001b9048 0x863f9c 00000000.long 00000000 0x863fa0 00863fc0.long 00863fc0 0x863fa4 00111f60.long 00111f60 0x863fa8 00000000.long 00000000 0x863fac 00000000.long 00000000 0x863fb0 eeeeeeee.long eeeeeeee 0x863fb4 eeeeeeee.long eeeeeeee 20 Copyright 2005 Wind River Systems, Inc.
ED&R : <<<<<Traceback>>>>> 0x00111f60 vxtaskentry +0x54 : 0x00863f98 () value = 0 = 0x0 -> Cf. Entry Point Symbol Table <<<<<Traceback>>>>> 0x00111f60 vxtaskentry +0x54 : badfunc () value = 0 = 0x0 21 Copyright 2005 Wind River Systems, Inc.
Task / Process Shared Memory (Mutual Exclution Sema : Mutex) / ISR Event Task-to-Task, ISR-to-Task Synch (» light-weight Binary Sema) / Task Message Channel (Single / Multi-Processor ) (Socket, RPC) VxMP (Asymmetric Multi-Processor CPU ) 22 Copyright 2005 Wind River Systems, Inc.
System Tick (Default 60 tick) taskdelay() Watchdog Tick ISR 23 Copyright 2005 Wind River Systems, Inc.
Managed ISR OS => ISR => OS C Unmanaged ISR / ISR,,,, 24 Copyright 2005 Wind River Systems, Inc.
Copyright 2005 Wind River Systems, Inc.
WindShell C (Interpreter) (,, ) (MsgQ, Sema etc.) (vi ) -> x = (8 * 6) / 4 x = 0x20ff378: value = 12 = 0xc -> Nom = Nelson new symbol Nom added to symbol table. Nom = 0x23fe798: value = 37742496 = 0x23fe7a0 = Nom + 0x8 -> printf ( Hello %s, number is %d.\n, Nom, 0x20) Hello Nelson, number is 32. value = 28 = 0x1c -> &x value = 34599800 = 0x20ff378 = x 26 Copyright 2005 Wind River Systems, Inc.
(b, s, tt, c) WindShell b Display breakpoints and eventpoints b addr[,task[,count]] Set breakpoint c [task[,addr[,addr1]]] Continue from breakpoint cret [task] Continue to subroutine return s [task[,addr[,addr1]]] Single step so [task] Single step/step over subroutine l [adr[,ninst]] List disassembled memory tt [task] Do stack trace on task -> b printf value = 0 = 0x0 -> b # Breakpoint Address Ctx Ctx Id Cnt Stops N Hard --- ----------------------------- ----- ---------- --- ------- - ------------ 47 0x13EC78: printf any n/a 0 task y - value = 0 = 0x0 -> sp main task spawned: id = 0x4eb3b0, name = s18u0 value = 5157808 = 0x4eb3b0 -> Break at 0x13EC78: printf Task: 0x4EB3B0 (s18u0) c Hello World! -> 27 Copyright 2005 Wind River Systems, Inc.
WindShell (Host Shell) Ctrl-d, TAB: /, Ctrl-w: HTML w: (-> < myscript) Tornado/Workbench ( ) ( ) 28 Copyright 2005 Wind River Systems, Inc.
WR debugger : GUI Debugger Task / System( ) Multi Core/Processor Multi Task / Process Multi Target Connection 29 Copyright 2005 Wind River Systems, Inc.
System Viewer Deadlock / Race condition 30 Copyright 2005 Wind River Systems, Inc.
StethoScope : RealTime Data Monitor Signals Bar Installed Signals List Legend Used Signal Dump Shows Value for every timestamp Monitor Shows RealtimeValue & Modify 31 Copyright 2005 Wind River Systems, Inc.
TraceScope : Code Execution Tracer Overview Global View of Task/Fuction Interactions Columns of Tasks Trace View Timestamp Sequence ID Spend Time Return Value Detail View Function Traces Function Callstack 32 Copyright 2005 Wind River Systems, Inc.
ProfileScope : Statistical Profiling Stoplight Toggle %CPU Total View Selection %CPU Current Graphical Usage Meter Profilescope Status Task & Function Call Tree 33 Copyright 2005 Wind River Systems, Inc.
Memory Scope : Mem Leak Detection Which Function (Full Call Stack)? Alloc# Free# Memory Leak Which Task? Indivisual Alloc/Free 34 Copyright 2005 Wind River Systems, Inc.
CoverageScope : Code Coverage Info This code was Never Executed 35 Copyright 2005 Wind River Systems, Inc.
Diagnostics : Sensor Point Dynamic patch No Rebooting No Func Recompile Ex. Printf Access variables within the scope of the function foo ( arg1) { int error; if (arg1 < 500) { error = 0; } else error = 1; log($arg1); $arg1 = 501; Monitor, configure, control } return (error) log($error); 36 Copyright 2005 Wind River Systems, Inc.
Diagnostics : Core Image Dump Stack Backtrace Core Image Kernel Fatal System Exception, Panic, Task-level exception ( ) Persistent Memory Core image Workbench IDE Workbench Debugger Core Image Stack Backtrace Exception,, 37 Copyright 2005 Wind River Systems, Inc.
support-kr@windriver.com. Copyright 2005 Wind River Systems, Inc.