PXROS V4 User’s Guide Version 1.0 HighTec EDV-Systeme GmbH Author: Werner Schwa
PXROS V4 User’s Guide Version 1.0 HighTec EDV-Systeme GmbH Author: Werner Schwarz Feldmannstr. 98 Date: 20. May 1996 D-66119 Saarbrücken Tel: 0681/92613-0 FAX: 0681/92613-26 Email: htc@hightec.saarlink.de HighTec EDV-Systeme GmbH 1 20. Mai 1996 3;5269HUVLRQ 9HUVLRQ User’s Guide PXROS V4 User’s Guide Version 1.0 HighTec EDV-Systeme GmbH 2 20. Mai 1996 PXROS V4 User’s Guide Version 1.0 7DEOH2I&RQWHQWV 1 Introduction.................................................................................................................9 1.1 PXROS................................................................................................................9 1.2 The User’s Guide...............................................................................................10 2 PXROS.....................................................................................................................13 2.1 Structures and Mechanisms..............................................................................14 2.2 PXROS Objects.................................................................................................16 2.2.1 Tasks..........................................................................................................16 2.2.2 Messages...................................................................................................17 2.2.3 Mailboxes...................................................................................................17 2.2.4 Memory Classes.........................................................................................17 2.2.5 Object Pools...............................................................................................18 2.2.6 Delay Objects.............................................................................................18 2.3 Name Conventions............................................................................................18 2.3.1 PXROS Services........................................................................................18 2.3.2 PXROS Data Types, Macros, ....................................................................20 3 Tasks........................................................................................................................21 3.1 Creating Tasks with a Standard Function..........................................................22 3.2 Task Code.........................................................................................................23 3.3 Task Communication.........................................................................................25 3.3.1 Data Communication via Messages...........................................................25 3.3.2 Signalling Events........................................................................................25 3.4 Killing Tasks......................................................................................................26 4 Building the Sample Programs.................................................................................27 4.1 Process.............................................................................................................27 4.2 Initialization Phase............................................................................................28 5 Communication through Messages..........................................................................29 5.1 Summary...........................................................................................................29 5.2 Generating Messages.......................................................................................30 5.3 Writing and Evaluating Message Data..............................................................31 5.4 Sending and Receiving Messages....................................................................32 5.5 Releasing Messages.........................................................................................33 5.6 Using an Existing Data Area..............................................................................36 5.7 Message Pools..................................................................................................38 5.8 Examples...........................................................................................................40 5.8.1 ex1.c...........................................................................................................40 5.8.2 ex2.c...........................................................................................................43 5.8.3 ex3.c...........................................................................................................45 5.8.4 ex4.c...........................................................................................................48 6 Events.......................................................................................................................51 6.1 Summary...........................................................................................................51 6.2 Signalling Events...............................................................................................52 6.3 Waiting for Events.............................................................................................52 6.4 Resetting Events...............................................................................................53 6.5 Other Functions.................................................................................................54 6.5.1 Parallel Waiting..........................................................................................54 6.5.2 Aborting Functions with Events..................................................................54 6.6 Examples...........................................................................................................55 6.6.1 ex.c.............................................................................................................55 6.6.2 ex2.c...........................................................................................................57 HighTec EDV-Systeme GmbH 3 20. Mai 1996 PXROS V4 User’s Guide Version 1.0 7 Memory Management...............................................................................................59 7.1 Summary...........................................................................................................59 7.2 Memory Requests.............................................................................................59 7.3 Memory Classes................................................................................................60 7.3.1 Creating Memory Classes..........................................................................60 7.3.2 Memory Classes with a Variable Block Size..............................................61 7.3.3 Memory Classes with a Fixed Block Size...................................................62 7.3.4 Allocating and Releasing Memory..............................................................62 7.4 Use of Different Memory Classes in the System...............................................63 7.5 Tips for Developers...........................................................................................64 7.6 Examples...........................................................................................................64 7.6.1 ex1.c...........................................................................................................64 7.6.2 ex2.c...........................................................................................................65 8 PXROS Time............................................................................................................67 8.1 Summary...........................................................................................................67 8.2 PXROS Time Base............................................................................................67 8.3 Standard Services.............................................................................................68 8.3.1 Timeouts....................................................................................................68 8.3.2 Periodic Events..........................................................................................69 8.4 Delay Jobs.........................................................................................................70 8.4.1 Delay Job Resources.................................................................................70 8.4.2 Starting a Delay Job...................................................................................71 8.4.3 Cancelling a Delay Job...............................................................................73 8.5 Examples...........................................................................................................74 8.5.1 ex1.c...........................................................................................................74 8.5.2 ex2.c...........................................................................................................76 8.5.3 ex3.c...........................................................................................................77 8.5.4 ex4.c...........................................................................................................79 8.5.5 ex5.c...........................................................................................................80 9 Mailboxes..................................................................................................................83 9.1 Summary...........................................................................................................83 9.2 Creating Mailboxes............................................................................................83 9.3 Mailbox Handlers...............................................................................................84 9.4 Examples...........................................................................................................85 9.4.1 ex1.c...........................................................................................................86 10 Objects and Object Pools.......................................................................................89 10.1 Summary.........................................................................................................89 10.2 Generating Object Pools.................................................................................90 10.2.1 Virtual Object Pools..................................................................................91 10.2.2 Real Object Pools....................................................................................91 10.3 Generating Additional Objects.........................................................................92 10.4 Using Different Object Pools in the System....................................................92 10.5 Other Services.................................................................................................93 10.6 Examples.........................................................................................................93 10.6.1 ex1.c.........................................................................................................93 10.6.2 ex2.c.........................................................................................................95 11 Interrupt Interface...................................................................................................97 12 Error Handling.........................................................................................................99 12.1 Summary.........................................................................................................99 12.2 Runtime Errors................................................................................................99 12.3 Application Errors..........................................................................................100 HighTec EDV-Systeme GmbH 4 20. Mai 1996 PXROS V4 User’s Guide Version 1.0 12.4 Example........................................................................................................100 12.4.1 ex1.c.......................................................................................................101 13 Scheduling............................................................................................................103 13.1 Summary.......................................................................................................103 13.2 Hardware Interrupt Handlers.........................................................................103 13.3 Software Interrupt Handlers..........................................................................104 13.4 Task Scheduling............................................................................................104 13.4.1 Tasks of Equal Priority...........................................................................105 13.4.2 Special Types.........................................................................................105 13.5 Example........................................................................................................105 14 Creating Tasks......................................................................................................107 14.1 ts_name.........................................................................................................108 14.2 ts_fun.............................................................................................................108 14.3 ts_mc.............................................................................................................108 14.4 ts_opool.........................................................................................................109 14.5 ts_taskstack...................................................................................................109 14.5.1 Automatic Stack Request.......................................................................110 14.5.2 Explicit Stack Allocation.........................................................................110 14.5.3 Choosing a Stack Size...........................................................................110 14.6 ts_tblimit........................................................................................................111 14.7 ts_prio............................................................................................................111 14.8 ts_actevents..................................................................................................112 14.9 ts_timeslices..................................................................................................112 14.10 ts_abortstack, ts_abortstacksize.................................................................112 14.11 ts_sched_extension, ts_sched_initarg........................................................114 14.12 ts_privileges.................................................................................................114 14.13 ts_int_dummies...........................................................................................114 14.14 ts_context....................................................................................................114 14.15 ts_addr_dummies........................................................................................114 14.16 Features of the Initialization Task................................................................114 14.17 Example......................................................................................................115 15 PXROS Initialization.............................................................................................117 15.1 A Standard Initialization.................................................................................117 15.2 Initialization Details........................................................................................118 15.2.1 is_sysmc_type,is_sysmc_size................................................................119 15.2.2 is_sysmc_blk, is_sysmc_blksize............................................................119 15.2.3 is_obj_number, is_obj_namelength.......................................................119 15.2.4 is_inittask...............................................................................................119 15.2.5 is_monitoring..........................................................................................120 15.2.6 is_int_dummies......................................................................................120 15.2.7 is_schedext............................................................................................120 15.2.8 is_addr_dummies...................................................................................121 15.3 Example........................................................................................................121 16 Common Task Data..............................................................................................123 16.1 Example........................................................................................................124 16.1.1 Ex1.c......................................................................................................124 17 Abort Mechanism..................................................................................................127 17.1 Summary.......................................................................................................127 17.2 Using the Abort Mechanism..........................................................................127 17.3 Activation and Deactivation of the Abort Mechanism....................................128 17.4 Implicit deactivation with PXROS Services...................................................129 HighTec EDV-Systeme GmbH 5 20. Mai 1996 PXROS V4 User’s Guide Version 1.0 17.5 Protecting resources......................................................................................131 17.6 Example........................................................................................................133 17.6.1 Ex1.c......................................................................................................133 18 Processor Dependent Services............................................................................135 18.1 PXROS for Siemens C16x Processors.........................................................135 18.1.1 Interrupt Interface...................................................................................135 18.1.1.1 Definig Handlers Dynamically.........................................................135 18.1.1.2 Defining Handlers Statically............................................................135 18.1.1.3 Trap Vector Table in EPROM.........................................................136 18.1.2 Task Context..........................................................................................136 18.2 PXROS for Intel 80x86 Processors...............................................................137 18.2.1 Interrupt Interface...................................................................................137 18.2.2 Task Context..........................................................................................137 19 Services for Specific Versions of PXROS.............................................................139 19.1 Scheduling Extensions..................................................................................139 19.1.1 Global Scheduling Extensions...............................................................139 19.1.2 Task Scheduling Extensions..................................................................140 19.2 Handler-Send................................................................................................141 19.3 Time Slicing...................................................................................................141 20 Using PXROS with EPROMs................................................................................143 20.1 Siemens C16x Family with the GNU Development tools..............................143 20.1.1 Interrupt Interface...................................................................................143 20.1.2 Compiler Options...................................................................................143 20.1.3 Linker Map File.......................................................................................144 20.1.4 Potential Problems.................................................................................144 21 Using Pxmon / Pxmon-RT....................................................................................145 22 PXROS and C++..................................................................................................147 23 Creating a PXROS Application.............................................................................149 23.1 Siemens C16x Processors............................................................................149 23.1.1 Makefile..................................................................................................149 23.1.2 Special Notes.........................................................................................152 24 Utility Library.........................................................................................................153 24.1 Management of Global Task Data.................................................................153 24.1.1 PxuAppinfoSetComp, PxuAppinfoUpdateComp....................................153 24.1.2 PxuAppinfoGetComp.............................................................................154 24.1.3 PxuAppinfoCleanupComp......................................................................154 24.2 New Memory Classes....................................................................................154 24.2.1 PxuCreateFixblkPool..............................................................................154 24.2.2 PxuCreateVarblkPool.............................................................................155 24.3 Cleaning Up After an Abort...........................................................................155 24.3.1 PxuCleanupInit.......................................................................................157 24.3.2 PxuCleanupPush...................................................................................158 24.3.3 PxuCleanupGetId...................................................................................158 24.3.4 PxuCleanupActivate...............................................................................158 24.3.5 PxuCleanupPop.....................................................................................158 24.4 Waiting at Different Mailboxes Simultaneously.............................................159 24.5 Message Pools..............................................................................................160 24.6 Protected Data..............................................................................................161 24.6.1 PxuPobjCreate, PxuPobjDelete.............................................................161 24.6.2 PxuPobjRequestRefData.......................................................................161 24.6.3 PxuPobjReleaseRefData.......................................................................162 HighTec EDV-Systeme GmbH 6 20. Mai 1996 PXROS V4 User’s Guide Version 1.0 24.7 Memory Requests.........................................................................................162 24.7.1 malloc.....................................................................................................162 24.7.2 realloc.....................................................................................................163 24.7.3 calloc......................................................................................................163 24.7.4 free.........................................................................................................163 24.8 PXROS Initialization......................................................................................163 24.9 Task Creation................................................................................................164 24.10 Time Conversion.........................................................................................165 24.11 Ring Buffers with waking functions..............................................................165 24.11.1 PXUWrbDefineType.............................................................................166 24.11.2 Initialization..........................................................................................166 24.11.2.1 PXUWrbInit, PXUWrbClear..........................................................166 24.11.2.2 PXUWrb~Init_Buffer, ~SetPutControls, ~SetGetControl ..............168 24.11.3 PXUWrbGet, PXUWrbPut....................................................................168 24.11.4 PXUWrbGetReadPointer, PXUWrbAdvanceReadPointer ...................169 24.11.5 PXUWrbGetWritePointer, PXUWrbAdvanceWritePointer ...................169 24.11.6 PXUWrbGetElemNum, PXUWrbIsFull, PXUWrbIsEmpty ....................170 24.12 Measuring the System Load........................................................................170 24.12.1 PxuSysloadCalibrate............................................................................170 24.12.2 PxuSysloadStartMeasure.....................................................................171 24.12.3 PxuSysLoadGetMeasure.....................................................................171 24.12.4 PxuSysloadEnd....................................................................................171 24.13 Messages....................................................................................................171 24.13.1 Synchronous Communication..............................................................172 24.13.1.1 PxuReqSynInit..............................................................................172 24.13.1.2 PxuReqSynOpen..........................................................................172 24.13.1.3 PxuReqSyn...................................................................................172 24.13.1.4 PxuReqSynClose..........................................................................173 24.13.2 Asynchronous communication.............................................................173 24.13.3 Receiver Services................................................................................173 24.13.3.1 PxuReqReceive............................................................................174 24.13.3.2 PxuReqDecode.............................................................................174 24.13.3.3 PxuReqAck...................................................................................175 25 Glossary................................................................................................................177 25.1 Delay Jobs.....................................................................................................177 25.2 Events...........................................................................................................177 25.3 Handlers........................................................................................................177 25.4 Mailbox..........................................................................................................177 25.5 Mailbox Handlers...........................................................................................178 25.6 Memory Classes............................................................................................178 25.7 Messages......................................................................................................178 25.8 Objects..........................................................................................................178 25.9 Object Pools..................................................................................................178 25.10 Private Mailbox............................................................................................179 25.11 Priority.........................................................................................................179 25.12 PXROS Ticks...............................................................................................179 25.13 Resource Distribution..................................................................................179 25.14 Tasks...........................................................................................................180 25.15 Time Slicing.................................................................................................180 26 Index.....................................................................................................................181 HighTec EDV-Systeme GmbH 7 20. Mai 1996 PXROS V4 User’s Guide Version 1.0 ,QWURGXFWLRQ 3;526 PXROS (pronounced pixros), is the acronym and stands for 3ortable e;tendible 5ealtime 2perating 6ystem. It is a realtime operating system kernel and may be used as a platform for a variety of realtime applications. PXROS services are provided in libraries. This means the the code corresponds largely to the functionality needed. Two libraries are used for developing applications: the GHEXJ library, used in the development stage, and the SURGXFWLRQ library, which is used for the completed project. Both libraries offer the application the same interface and functionality, the difference lying in the service testing perfomed. To detect errors in the early stages of development, PXROS conducts extensive checks and tests when executing services from the debug library. These tests however, increase the run time and the code requirements; therefore, the production library is used once development is completed. The production library does not perform these tests, thus providing better run time performance and lower code requirements. In addition to standard PXROS, other versions exist with extended functionality. These include a multiprocessor communication version, a version that provides priority-based semaphores, and a version extends the normal scheduling with time slicing. Most of these extended services are not described in this User’s Guide. PXROScompact is another PXROS variation. It differs from the standard version mainly in that tasks and PXROS objects can not be generated dynamically. The application’s structure must be defined statically. Fewer services means less code, thereby reducing the size of the final application. PXROScompact is useful in small applications with very limited space for code. The User’s Guide describes the full-featured PXROS services and does not deal with PXROScompact’s features specifically. 3;PRQ is a debugging tool used in conjunction with PXROS. It allows the developer to examine and alter memory locations and variables while UXQQLQJ the application. PXmon recognizes internal PXROS structures and provides specific PXROS information about resource consumption, the state of tasks, or the scheduling of the system. The extended version, 3[PRQ57 offers UHDOWLPH GHEXJJLQJ during final testing, including task-specific breakpoints and single-stepping tasks (i.e. without stopping the whole system). PXmon is described in detail in chapter 21. HighTec EDV-Systeme GmbH 8 20. Mai 1996 PXROS V4 User’s Guide Version 1.0 7KH8VHU V*XLGH The User’s Guide is a resource intended to assist in the development of individual PXROS applications. It describes PXROS mechanisms and services that can help solve problems. To understand the User’s Guide, no previous knowledge of PXROS is required, and the applied terminology and principles are dealt with in detail. The User’s Guide does not explain how to e.g. translate a C-program for specific target hardwares, how to use a debugger, or how to load the completed program. The User’s Guide is structured as follows: The next two chapters briefly introduce PXROS structures and its underlying mechanisms, as well as some of the more important terms used. This introduction is intended to prepare you for the following chapters and should not be ignored. Individual PXROS mechanisms and the services related to them, are explained later in the corresponding chapters. Each chapter begins with a summary of the most important information. Processes and various services are briefly described, followed by detailed explanations of the subject and a full-length description of the relevant services. At the end of most chapters, the User’s Guide contains a description of sample programs related specifically to the subjects at hand. Their source code can be found on the accompanying disk. These programs should illustrate specific aspects of use in relation to the services concerned. The starting phase and uploads/Litterature/ pxros-user-guide.pdf
Documents similaires










-
27
-
0
-
0
Licence et utilisation
Gratuit pour un usage personnel Attribution requise- Détails
- Publié le Dec 15, 2022
- Catégorie Literature / Litté...
- Langue French
- Taille du fichier 0.5236MB