RTOS Debugger for OS-9

Similar documents
RTOS Debugger for RTX51 tiny

RTOS Debugger for psos+

OS Awareness Manual OSE Epsilon

RTOS Debugger for CMX

RTOS Debugger for FreeRTOS

RTOS Debugger for RTX-ARM

RTOS Debugger for ChibiOS/RT

RTOS Debugger for MicroC/OS-III

RTOS Debugger for ThreadX

OS Awareness Manual Sciopta

RTOS Debugger for MQX

RTOS Debugger for MicroC/OS-II

RTOS Debugger for RTXC Quadros

RTOS Debugger for RTXC Quadros

OS Awareness Manual OSE Delta

Integration for CodeWright

OS Awareness Manual OSEK/ORTI

TRACE32 Documents... ICD In-Circuit Debugger... Processor Architecture Manuals... NS NS32000 Monitor... 1

Hypervisor Awareness for Wind River Hypervisor

TRACE32 Documents... ICD In-Circuit Debugger... Processor Architecture Manuals... TriCore... TriCore Monitor... 1

TRACE32 Getting Started... ICD In-Circuit Debugger Getting Started... ICD Introduction... 1

The CMXBug Manual. The CMXBug Manual

Run Mode Debugging Manual Symbian

RTOS Debugger for Windows Standard

Converter from GEL to PRACTICE

ARM Application Note for MXC Chips

THE PROCESS ABSTRACTION. CS124 Operating Systems Winter , Lecture 7

embos Real Time Operating System CPU & Compiler specifics for RENESAS M16C CPUs and IAR compiler Document Rev. 5

embos Real Time Operating System CPU & Compiler specifics for ARM core with ARM RealView Developer Suite 3.0 Document Rev. 1

embos Real Time Operating System CPU & Compiler specifics for RENESAS SH2A CPUs and KPIT GNU compiler Document Rev. 1

Precept 2: Non-preemptive Scheduler. COS 318: Fall 2018

embos Real Time Operating System CPU & Compiler specifics for RENESAS M16C CPUs and HEW workbench Document Rev. 1

What s An OS? Cyclic Executive. Interrupts. Advantages Simple implementation Low overhead Very predictable

RTOS Debugger for QNX - Run Mode

CSCE Operating Systems Interrupts, Exceptions, and Signals. Qiang Zeng, Ph.D. Fall 2018

embos Real Time Operating System CPU & Compiler specifics for RENESAS SH2 CPUs and RENESAS HEW4 Document Rev. 1

Rudi Dienstbeck June 07, ARM TrustZone and Hypervisor Debugging

embos Real-Time Operating System embos plug-in for IAR C-Spy Debugger Document: UM01025 Software Version: 3.0 Revision: 0 Date: September 18, 2017

NEW CEIBO DEBUGGER. Menus and Commands

CMPE3D02/SMD02 Embedded Systems

Application Note for the SNOOPer Trace

NitrOS-9 Technical Reference

System-state System Calls. The alarm ID returned may be used to delete an alarm request. The following function codes are supported:

Integration for Visual Basic Interface

The Kernel Abstraction. Chapter 2 OSPP Part I

RTOS Debugger for LynxOS

The kernel is the nucleus of OS-9. It manages resources, controls processing, and supervises Input/Output. It is a ROMable, compact OS-9 module.

19: I/O Devices: Clocks, Power Management

Processes. Dr. Yingwu Zhu

Roadmap. Tevfik Ko!ar. CSC Operating Systems Fall Lecture - III Processes. Louisiana State University. Processes. September 1 st, 2009

embos Real-Time Operating System embos plug-in for IAR C-Spy Debugger Document: UM01025 Software Version: 3.1 Revision: 0 Date: May 3, 2018

Using kgdb and the kgdb Internals

ELEC 377 Operating Systems. Week 1 Class 2

Processes. Sanzheng Qiao. December, Department of Computing and Software

Process Concepts. CSC400 - Operating Systems. 3. Process Concepts. J. Sumey

LAB WORK NO. 3 TURBO DEBUGGER ENVIRONMENT

The control of I/O devices is a major concern for OS designers

CSCI 350 Pintos Intro. Mark Redekopp

embos Real Time Operating System CPU & Compiler specifics for Texas Instruments MSP430 CPUs and Rowley compiler for MSP430 Document Rev.

PROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo

Programs. Program: Set of commands stored in a file Stored on disk Starting a program creates a process static Process: Program loaded in RAM dynamic

NEC 78K0- Family On-Chip Emulation

Lecture 2 - Fundamental Concepts

CSC227: Operating Systems Fall Chapter 1 INTERRUPTS. Dr. Soha S. Zaghloul

Operating Systems 2014 Assignment 2: Process Scheduling

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

Introduction to the ThreadX Debugger Plugin for the IAR Embedded Workbench C-SPYDebugger

Process Context & Interrupts. New process can mess up information in old process. (i.e. what if they both use the same register?)

COSC243 Part 2: Operating Systems

6/20/2018. Lecture 2: Platforms & RTOS. Outline. Lab Setup (20 min) Labs work. Lecture: Platform + RTOS

SMD149 - Operating Systems

CS5460: Operating Systems

Appendix A GLOSSARY. SYS-ED/ Computer Education Techniques, Inc.

CS2506 Quick Revision

! The Process Control Block (PCB) " is included in the context,

Main Memory (Part I)

Common Computer-System and OS Structures

Tracking the Virtual World

ESE 333 Real-Time Operating Systems 2 What is an operating system? Two views: 1. Top-down view: Extended machine ffl Covers the details of the hardwar

Embedded Systems Programming

Address spaces and memory management

CS 537: Introduction to Operating Systems Fall 2015: Midterm Exam #1

CSCI341. Lecture 22, MIPS Programming: Directives, Linkers, Loaders, Memory

Operating Systems. Introduction & Overview. Outline for today s lecture. Administrivia. ITS 225: Operating Systems. Lecture 1

Development Tools. 8-Bit Development Tools. Development Tools. AVR Development Tools

Trace Getting Started V8.02

Processes. CS439: Principles of Computer Systems January 24, 2018

Processes. Johan Montelius KTH

OPERATING SYSTEM OVERVIEW

ECE 598 Advanced Operating Systems Lecture 10

Noorul Islam College Of Engineering, Kumaracoil MCA Degree Model Examination (October 2007) 5 th Semester MC1642 UNIX Internals 2 mark Questions

Multiprogramming. Evolution of OS. Today. Comp 104: Operating Systems Concepts 28/01/2013. Processes Management Scheduling & Resource Allocation

Pebbles Kernel Specification September 26, 2004

A process. the stack

Processes and Threads. Processes and Threads. Processes (2) Processes (1)

AMIBIOS8 Check Point and Beep Code List

Fix serial communications not functioning after reboot when the station number is set to iptables Fix iptables.

H8 C-SPY. User Guide WINDOWS WORKBENCH VERSION

Operating System Review

Debugging. ICS312 Machine-Level and Systems Programming. Henri Casanova

Transcription:

RTOS Debugger for OS-9 TRACE32 Online Help TRACE32 Directory TRACE32 Index TRACE32 Documents... RTOS Debuggers... RTOS Debugger for OS-9... 1 Overview... 3 Brief Overview of Documents for New Users... 4 Configuration... 5 Hooks in OS-9 6 Features... 7 Display of Kernel Resources 7 Symbol Relocation 7 Function Runtime Statistics 8 Task Runtime Analysis 8 Task State Analysis 9 Task Selective Debugging 9 System Calls 9 OS-9 Commands... 10 symbol.relocate.auto Control automatic relocation 10 symbol.relocate.base Define base address 10 symbol.relocate.list List relocation info 11 symbol.relocate.magic Define program magic 11 symbol.relocate.passive Define passive base address 12 TASK.ALARMS Alarm table 13 TASK.CCTL Cache control 13 TASK.DEVS Device table 14 TASK.EVENTS Event table 14 TASK.EXIT Exit system call 14 TASK.IRQS Interrupt polling table 15 TASK.MDIR Module table 15 TASK.MFREE Free memory 15 TASK.PROCS Process table 16 TASK.PROCSL Extended process table 16 TASK.QUEUES Process queues 17 TASK.SEND Send signal 17 RTOS Debugger for OS-9 1

TASK.SysCall Generic system call 17 TASK.SYSGLOB Display time 18 OS9 specific Functions... 19 Frequently-Asked Questions... 19 RTOS Debugger for OS-9 2

RTOS Debugger for OS-9 Version 06-Nov-2017 Overview E::w.task.procsl magic id prior sig state last data module name pid grp usr aging datasize entry age usr-ticks sys-ticks f$calls i$calls readen written 00020000 1. -1. 0000 A000 Link 00000000 00002400 kernel 0. 0. 0. -1. 0. 00002482 00:18:13 0. 109345. 0. 0. 0. 0. 0003EB60 2. 128. 0000 8000 w Wait 00021B00 00009100 sysgo 0. 0. 0. 0. 512. 00009152 22:46:29 0. 0. 3. 0. 0. 0. E::w.task.queues magic id prior sig last module name active: sleeping: 0003E330 3. 128. 0000 ReadLn 0000E300 shell waiting: 0003EB60 2. 128. 0000 Wait 00009100 sysgo RTOS Debugger for OS-9 3

Brief Overview of Documents for New Users Architecture-independent information: Debugger Basics - Training (training_debugger.pdf): Get familiar with the basic features of a TRACE32 debugger. T32Start (app_t32start.pdf): T32Start assists you in starting TRACE32 PowerView instances for different configurations of the debugger. T32Start is only available for Windows. General Commands (general_ref_<x>.pdf): Alphabetic list of debug commands. Architecture-specific information: Processor Architecture Manuals : These manuals describe commands that are specific for the processor architecture supported by your debug cable. To access the manual for your processor architecture, proceed as follows: - Choose Help menu > Processor Architecture Manual. RTOS Debuggers (rtos_<x>.pdf): TRACE32 PowerView can be extended for operating systemaware debugging. The appropriate RTOS manual informs you how to enable the OS-aware debugging. RTOS Debugger for OS-9 4

Configuration The PRACTICE script '~~/demo/m68k/kernel/os9/pos9.cmm' patches the kernel and configures the RTOS debugger. The macros defined at the beginning of the file define the address of the kernel, the address of the global system variables and the vectors which are used to enter the kernel (e.g. clock interrupt). These values have to been checked and modified if necessary. The emulation memory has to mapped into the address space used by OS-9 to access the information by dual-port memory. TASK.CONFIG os9 <magic_address> <sleep> <globals> <system_call_gate> <magic_address> Specifies a memory location that contains the current running task. <sleep> The argument for <sleep> is currently not used. Specify 0. <globals> <system_call_gate> This argument must be the address of the system-global variables, which is used to display the tables. This argument is the address of the system call entry point, which is used by the command when executing system calls. If the task selective debugging features are not used, the patching of the kernel is not required. The first two arguments are then not required. The following PRACTICE script will configure the command for data table display: &globals=0cxxxx TASK.CONFIG os9 0x0 0x0 &globals 0x0 TIP: The command SETUP.DIS can be used to display the OS-9 traps correctly in the disassembler windows. The PRACTICE script '~~/demo/m68k/kernel/os9/pos9.cmm' can make the required patches to OS/9 and configure the display command: DO pos9 nopatch DO pos9 notask DO pos9 ; configures only display functions ; no patches are made (TASK.OFF) ; enables display and analyzer ; functions task selective debugging ; is off ; patches VRTX32 for task selective ; debugging RTOS Debugger for OS-9 5

The PRACTICE file must be modified according the software running on the target. The address of the system globals the memory for patching must be defined. Hooks in OS-9 When the task selective debugging is used the entry and exit of the kernel must lead to a multitask breakpoint. To determine the entry of a task, patching the OS-9 kernel is required. All returns to the task context (usually RTE instructions) are patched to pass control to the multitask monitor. The patch writes the current executing process table address to the magic word of the RTOS debugger and runs to a breakpoint. The entries to OS-9 are patched directly in the vector table. The patches write the value 1 to the magic word and run to a breakpoint. The correct setting of the breakpoints can be checked in following way: 1. Boot OS-9 2. break program with 'break' 3. execute 'patchos9.cmm' 4. continue with 'go' 5. disable debugging for the kernel 6. set 'write'-breakpoints to the os-9 global-variables 7. the program should continue without breaking or spotting RTOS Debugger for OS-9 6

Features Display of Kernel Resources The resources are usually read by dual port memory. For correct operation memory must be mapped at all places where OS/9 holds its tables. The commands can either give an overview about one resource type or display them more in detail. The following information can be displayed: Globals and time (SYSGLOB) Processes (PROCS,PROCSL) Process queues (QUEUES) Event table (EVENTS) Alarm table (ALARMS) Module directory (MDIR) Free memory (MFREE) Devices (DEVS) IRQ table (IRQS) Symbol Relocation The processes of OS9 use position independent code and data. The symbols need to be relocated, when they get a new address from OS9. The OS9 awareness provides a method to relocate the symbols automatically when necessary. This method extracts a table from the target memory which defines the locatio nof the position independent code and data sections. It will be called automatically after any program break, or by manually execute the command symbol.relocate.auto. Programs that are not active can be relocated to an unused address, when the command symbol.relocate.passive is active. Without this command symbols of currently not used programs will stay at the last known location. Correct relocation requires knowledge about the base address for position independent data used by the linker. This address must be defined by the symbol.relocate.base command. The identification of programs can either be done by a unique number, defined by the symbol.relocate.magic command or based on an address in the code area of a program. See the symbol.relocate commands in the OS-9 Command section RTOS Debugger for OS-9 7

Example for automatic relocation of symbols for OS/9 (partial program): TASK.CONFIG os9 0x0 0x0 0x1000 symbol.relocate.passive 0x0ffff0000 symbol.relocate.base 0x0ffff0000 symbol.relocate.auto ON Data.LOAD.ROF modul1 0x18000 0x0ffff8000 Function Runtime Statistics All function related statistic and time chart functions can be used with or without patching the kernel. The difference is whether the kernel will be seen like another task or as part of the task who called the kernel. Task selective debugging should not be used when statistics are made, as this would cause an error in the measurements. The task switch can be displayed in the analyzer list with the List.TASK keyword. The example script 'taskfunc.cmm' makes a task-selective performance analysis for the demo application. Analyzer.STATistic.TASKFunc Analyzer.STATistic.TASKTREE Analyzer.Chart.TASKFunc Analyzer.List Display function runtime statistic Display functions as tree Display function time chart List.TASK FUNC Display function nesting in analyzer Task Runtime Analysis The time spend in a task can be analyzed by marking the access to a word holding a pointer to the current tasks tcb. This can either be in the kernel or in the patch programs. In the first case the runtime in the kernel will be added to the last task which called the kernel. If the 'magic' word in the patch program is marked, the kernel is treated like another task. Task selective debugging should not be used when statistics are made, as this would cause an error in the measurements. The example script 'taskfunc.cmm' can be used to make the measurement for this analysis. Analyzer.STATistic.TASK Analyzer.Chart.TASK Display task runtime statistic Display task runtime time chart RTOS Debugger for OS-9 8

Task State Analysis The time different tasks are is a certain state (running, ready, suspended or waiting) can be displayed as a statistic or in graphical form. This feature is implemented by recording all accesses to the status byte of all tasks. The breakpoints to the tcb status bytes are set by the TASK.TASKState command. The example script 'taskstat.cmm' makes a task state analysis with the demo application. NOTE: The analysis will only show task which were existent when the file is executed and after the measurement has completed. Analyzer.STATistic.TASKState Analyzer.Chart.TASKState Display task state statistic Display task state time chart Task Selective Debugging Task selective debugging allows to disable or enable the analyzer and the trigger system for specific tasks and to stop one task while others continue to operate. This function has an impact on the response time of the multitask kernel. The feature should not be used when making performance or time measurements or with extremely time critical applications. Task selective debugging is currently not available on CPU32 and CPU32+ processors. System Calls Manually executing system calls requires a small program on the target, which makes the system call and stops execution after the call. Such a program is part of the standard patch procedure (pos9.cmm). The memory at the system parameter buffer (a part of the patch area) must be mapped internal. RTOS Debugger for OS-9 9

OS-9 Commands symbol.relocate.auto Control automatic relocation symbol.relocate.auto [ON OFF] Enables or disables the automatic relocation process. Without argument the command forces an immediate relocation base on the current values of the target. This manual triggered relocation is useful when the target can not be stopped, but analyzer or breakpoint features will be used. It can also be useful when the read of the relocation information structure of the target is time consuming and should not be performed after each breakpoint or step. symbol.relocate.auto symbol.relocate.auto ON ; perform one single relocation ; turn automatic relocation on See chapter Symbol Relocation. symbol.relocate.base Define base address symbol.relocate.base <class>:<base>] [<symbolpath> <range>] Defines the current base address for one or more programs. The symbol path limits the definition to special symbols of a module or a program. If an address range is given, only the symbols in this range will be set. The memory class P: or D: defines which base address (program or data) is set. This program doesn't relocate symbols. The command is used after loading the symbols, when the default base address in the table doesn't match. The default program base is the first location of the program, the data base is zero. symbol.relocate.base d:0x400000 ; assume all position independent ; data was linked to address 400000 See chapter Symbol Relocation. RTOS Debugger for OS-9 10

symbol.relocate.list List relocation info symbol.relocate.list Displays information about the automatic relocation of symbols. E::w.y.reloc.l magic prog data active name 00000000 00009000 FFFF0000 INIT 00000000 00009100 00021B00 SYSGO 00000000 00009400 FFFF0000 SCF 00000000 00009C00 FFFF0000 SCHS 00000000 0000A000 FFFF0000 RTC 00000000 0000A400 FFFF0000 TERM 00000000 0000A500 FFFF0000 CIO 00000000 0000E300 00021D00 SHELL The magic column displays is the identifier of a program, zero means that the program is identified by an address inside the code area. The 'prog' and 'data' columns show the current base address for code and data. The 'active' field is set when the program is currently alive. See chapter Symbol Relocation. symbol.relocate.magic Define program magic symbol.relocate.magic <magic_number> [<symbolpath> <range>] Defines the magic number for one or more programs. The symbol path limits the definition to special symbols of a module or a program. If an address range is given, only the symbols in this range will be set. The magic number can be used to identify a program and get a relation between task numbers in the target and program names. A magic number of zero (default) will use the program address as an identifier. symbol.relocate.magic 0x665f0 \\MODUL1 ; assignes the magic number ; 665f0 to the program MODUL1 See chapter Symbol Relocation. RTOS Debugger for OS-9 11

symbol.relocate.passive Define passive base address symbol.relocate.passive <class>:<base> When a program is currently not used in the target, the code or data symbols are relocate to the address defined by this command. The memory class P: or D: defines which base address (program or data) is set. A base address of zero (default) turns the relocation off. In this case the symbols of not used (passive) programs stay where they are. symbol.relocate.passive d:0x0ffff0000 ; unused data symbols will be ; relocated to address ; 0ffff0000 See chapter Symbol Relocation. RTOS Debugger for OS-9 12

TASK.ALARMS Alarm table TASK.ALARMS E::w.task.alarms address signal at tick in ticks task id name 0003D6E0 00000055 40239. 9. 0003E330 3. shell 0003D660 00000055 41230. 1000. 0003E330 3. shell TASK.CCTL Cache control TASK.CCTL <option_word> Calls the F$Cttl function. The meaning of the bits induced the option-word is described in the OS-9 manual. RTOS Debugger for OS-9 13

TASK.DEVS Device table TASK.DEVS E::w.task.devs device driver file mgr data ptr links term schs scf 00021A90 2. t2 schs scf 0003E190 2. TASK.EVENTS Event table TASK.EVENTS E::w.task.events address id name value w-inc s-inc links 0003D760 1. testevent1 0. 1. -1. 1. TASK.EXIT Exit system call TASK.EXIT The current process is terminated by an OS-9 F$Exit call. RTOS Debugger for OS-9 14

TASK.IRQS Interrupt polling table TASK.IRQS E::w.task.irqs vec prior port data irq svc 35. 4. 00000000 00021A90 00009CA0 35. 4. 00000004 0003E190 00009CA0 35. 5. 00000000 0000A000 0000A084 TASK.MDIR Module table TASK.MDIR E::w.task.mdir address to entry size access type revs edit lnk name 0000A500 0000E22B 0000A58A 15660. 0555 0B01 C008 6. 0. cio 0000E300 00012D0F 0000E34E 18960. 0555 0101 C001 48. 1. shell 00012E00 00013D57 00012E50 3928. 0555 0101 C001 21. 0. setime 00013E00 000152FF 00013E4E 5376. 0555 0101 C001 19. 0. procs 00015300 00015DF1 0001534E 2802. 0555 0101 C001 16. 0. date 00015E00 00015E75 00015E04 118. 0555 0F00 8000 5. 2. t2 00018000 0001B1D1 00018050 12754. 0555 0101 8001 7. 1. modul1 TASK.MFREE Free memory TASK.MFREE E::w.task.mfree address to size 00024500 0003D6FF 102912. total free space: 102912. RTOS Debugger for OS-9 15

TASK.PROCS Process table TASK.PROCS Displays the process table. E::w.task.procs magic id prior sig S last data module name 00020000 1. -1. 0000 Link 00000000 00002400 kernel 0003EB60 2. 128. 0000 w Wait 00021B00 00009100 sysgo 0003E330 3. 128. 0000 s ReadLn 00021D00 0000E300 shell 0003D890 4. 128. 0000 * Sleep 00022C00 00018000 modul1 TASK.PROCSL Extended process table TASK.PROCSL Displays the process table in an extended format. E::w.task.procsl magic id prior sig state last data module name pid grp usr aging datasize entry age usr-ticks sys-ticks f$calls i$calls readen written 0003E330 3. 128. 0000 8000 s ReadLn 00021D00 0000E300 shell 2. 0. 0. 0. 3840. 0000E34E 00:03:43 1. 1. 8. 52. 27. 48. 0003D890 4. 128. 0000 8000 * Sleep 00022C00 00018000 modul1 3. 0. 0. 0. 6400. 00018050 00:02:50 8753. 4674. 265353. 18. 0. 255. RTOS Debugger for OS-9 16

TASK.QUEUES Process queues TASK.QUEUES E::w.task.queues magic id prior sig last module name active: 0003D890 4. 128. 0000 Sleep 00018000 modul1 sleeping: waiting: 0003EB60 2. 128. 0000 Wait 00009100 sysgo TASK.SEND Send signal TASK.SEND [<id>] [<signal>] Sends a signal to one specific or all processes (F$Send). task.send 5. 0. ; kill task 5. TASK.SysCall Generic system call TASK.SysCall <code> [<d0> <d4> <a0> <a1> <a2>] Executes any OS-9 system call. If the system call hangs the kernel, you can try to break manually and use the command Register.SWAP to restore the CPU registers in front of the system call. After the system call has been executed the system register set contains the values returned by the system call. The values of D0..D4 and A0..A2 are displayed in the message line. This command if the most dangerous of the RTOS debugger, as wrong arguments may cause the kernel to crash down. Use this command if it's really necessary only. RTOS Debugger for OS-9 17

TASK.SYSGLOB Display time TASK.SYSGLOB Displays the current time and tick. E::w.task.sysglob time tick ticks 00:02:48 28. 16872. RTOS Debugger for OS-9 18

OS9 specific Functions TASK.PROCS.PADDR(<processname>) Extracts the program base address of a process from the process table. TASK.PROCS.DADDR(<processname>) Extracts the data base address of a process from the process table. TASK.MDIR.PADDR(<modulename>) Extracts the program base address of a process from the modul directory. Frequently-Asked Questions No information available RTOS Debugger for OS-9 19