Home

OS Porting and Abstraction Lab User Manual

image

Contents

1. File Edit Refactor Navigate Search Project Run Tools Window Help ri B OOR BO B pat Welcome 3 A a F Help Contents FEY pat Profiler pat Projects DI Search Fa C C Projects 5 2 9 Dynamic Help B z Key Assist Ctrl St J Tips and Tricks amp adapal_1 Fede a Cheat Sheets demo_cross_os demo_nucleus 2 Find and Install Software Updates demo_posix a w demo_psos Manage Configuration About OS Porting and Abstraction Lab Hh demo_uitron i demo_yxworks wA proji fae Probl Prope ie Progr El console 58 O iC Bui m C Build adapal_1 8 BR mr B r raAaC Ora TOS la j adazCC adapal_1 source helloworld ada o adazCC adapal_1 source hello world el tab o lwinmm Build complete for project adapal_1 Time consumed 138406 ms Cal Reem J iss g jadapal_1 MAPUS QFT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL 2 Select Search for new features to install and click Next as shown in Figure 4 Figure 4 Remote Update Feature Updates Par Install Update SR Feature Updates AT Choose the way you want to search For Features to install AN pE O Search for updates of the currently installed features Select this option if you want to search for updates of the features you already have installed b ea Select this option if you want to install new features from existing or new update sites Some sites m
2. E ada2 demo_ada_to_c demo_cross_os demo_nucleus demo_posix demo_psos demo_uitron demo_yvxworks demo_windows B E TANT J E E3 E3 Ea 4 idemo_ada_to_c MAPUS QFT Porting Made Easy 86 OS PORTING AND ABSTRACTION LAB USER MANUAL 2 On OS PAL Import window select the root directory from where you want to import the legacy code by clicking on Browse button next to the text box and click Next as shown inFigure 62 Figure 62 Import Legacy Code Window Ek Import Posix Legacy Code E ora Select a Directory to Import Legacy Code Into OS PAL Root Directory Project Name Root Task Prototype Root Task Stack Sizefin bytes 3 Enter the project name for which you want to import the legacy code in the Project Name text box 4 Enter the root task prototype next to Root Task Prototype text box 5 Enter the root task stack size next to the Root Task Stack Size text box The value should be in bytes 6 Click Finish to complete the importing of legacy code into OS PAL You have successfully imported the legacy code and a project with your given project name is created in the current workspace MAPUS QFT Porting Made Easy 87 OS PORTING AND ABSTRACTION LAB USER MANUAL Method 3 Manually Porting Legacy Applications using OS PAL Import Feature Step 1 In your source code remove references to the original OS include files and use os_target h
3. _ Ada Source Ada listings Ada messages Adadrivers Additional Source listing No source listing Source listing only if errors Always produce source listing Source listing Format Pagination Continuous source listing Paginated source listing C Listing only of lines with errors or warnings Cross reference listing No cross reference listing Produce cross reference listing MAPUS QFT Porting Made Easy 241 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on Ada Listings tab are as follows Field Description Your Action Source Listing Specifies if you want the Ada source list to be generated or not and how it should be generated You can do any one of the following e To not to do Ada source list select the radio button e To do Ada source list only if errors are present select the radio button Note By default this is enabled e To always produce Ada source list select the radio button Source Listing F ormat Pagination Specifies the format of the Source Listing You can do any one of the following e For continuous source listing select the radio button Note By default this is enabled e For listing only of lines with errors or warnings select the radio button e For paginated source listing select the radio button Page Length Specifies the length of the page Enter a value
4. demo_ada_to_c demo_cross_os a demo_nucleus a demo_posix _ demo_psos La demo_uitron La demo_vxworks nucleuslegacy L posixlegacy a psoslegacy simple_vxworks_app a uitronlegacy HOA i ga Ea E3 ga amp es es amp El console Properties 5 E Progress amp wiar o Property Value ia E Info derived False editable true last modified April 20 2010 11 15 08 AM linked False sal Li demo_cross_os MAPUS QFT Porting Made Easy 127 OS PORTING AND ABSTRACTION LAB USER MANUAL 3 From OS PAL Optimized Target Code Generator window select your target platform specifications from the drop down list VxWorks operating system is selected as an example as shown in Figure 87 Optimized Target Code Generator This wizard optimizes target specific source code Target yxWorks Version SMP Kernel Mode User Mode Architecture 32 bit Target Hardware PPC Load settings from Previous C Generate a Project File Project Destination Path MAPUS QFT Porting Made Easy __ R i 28 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on OS PAL Optimized Target Code Generator window are as follows Field Description Your Action Target Specifies the target OS name Enter the target OS name in the text box Version Based on t
5. Figure 24 Select APIs Window QB 0S PAL C Project Wizard Select APIs List of API sets available Cross O5 Interface APIs will automatically be included for OS PAL C C Projects Select additional development APT s used by your application Include Cross O5 Interface API s C Include POSIX Interface API s C Include xWorks Interface API s C Include p505 Interface API s C Include Nucleus Interface API s C Include micro ITRON Interface API s C Include Windows Interface API s MAPUS FT Porting Made Easy 45 OS PORTING AND ABSTRACTION LAB USER MANUAL You will see the output as shown in Figure 25 Figure 25 Creating OS PAL C C Project Output PAL Projects OS Porting and Abstraction Lab File Edit Navigate Search Project Run Tools Window Help f EHSoim 2Oon BO HA db Aa e 4 x EF pat Profiler PAL Projects Fie C C Projects 52 gm fH adapal_1 demo_cross_os demo_nucleus demo_posix demo_psos demo_uitron demo_vxworks Al projt i O sample jp Includes 4S include ES source Ge E prope 3 Progr E Console a aj a Property Value derived False editable true last modified April 20 2010 10 30 26 AM linked False location C MapuSoft OSPAL workspacels name samnle CiC Indexer 0 Cc B Probl MAPUS QFT Porting Made Easy 46 OS PORTING AND ABSTRACTION LAB USER MANUAL OS PAL P
6. 3 Browse to the location of the saved license file and click Open as shown in Figure 2 The license key is installed and now you can work on OS PAL Figure 2 Selecting the Saved License File Choose lic extension file to import 12 39 OO lic Kcense_20090320_12_33_00 MyNetwork Files oftype ic MAPUS FT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL Updating OS PAL Getting Updates for OS PAL NOTE This feature requires OSPAL Host License Click http www mapusoft com contact to send a request to receive licenses and documentation You can get latest OS PAL updates from http www mapusoft com using the following two options e Remote Update By using Remote Update Site the system will automatically contact http www mapusoft com website and search for the latest updates You need internet connectivity for this to work e Local Update By using Local Update Site you can do OSPAL updates without connecting to the Internet For this to work you need to get the updated files from http www mapusoft com by e mail or CD MAPUS FT Porting Made Easy 12 OS PORTING AND ABSTRACTION LAB USER MANUAL Updating Software Using Remote Update Site To update software using Remote update site 1 From OS PAL main menu select Help gt Software Updates gt Find and Install as shown in Figure 3 Figure 3 Software Updates Using Remote Site
7. Note Before you begin refer to MapuSoft System Configuration Guide This chapter contains the following topics Generating Full Library Packages Generating Binary Packages MAPUS FT Porting Made Easy 114 OS PORTING AND ABSTRACTION LAB USER MANUAL Generating Full Library Packages NOTE This feature requires a Library Package generation license Click http mapusoft com contact to send a request to receive licenses and documentation OS PAL can also create full library packages to complete the porting and development outside of OS PAL with your own tools and environment NOTE To generate full library package on Windows Interface ensure that the flag INCLUDE_OS_PROCESS is set to OS_TRUE in the cross_os_usr h configuration file To generate full source library package follow the steps 1 Generating Full Library Package To generate full library package a From OS PAL main menu click Full Library Package Generator button on the tool bar as highlighted in Figure 80 Or select Tools gt Full Library Package Generator Figure 80 Generating Library Package PAL Projects OS Porting and Abstraction Lab File Edit Navigate Search Project Run Tools Window Help mS miM Or Ff RET j License FEY pat Profiler PAL Projects Resource ETa C C Projects 22 cs demo_ada_to_c H w demo_cross_os Ej C demo_nucleus 7 C demo_posix demo_psos demo _uitron C demo_vxworks k nucleuslegacy J pos
8. e e error messages i information messages n not yet implemented messages Ww warning messages e r redundant messages By default all messages except information and redundant messages are displayed for the current invocation of the compiler For recursive invocations no messages are displayed by default For convenience m a will suppress all messages except errors Other Options Options Description 0 The 0 option identifies the version number of the executable That s a zero not an oh a If the a option is specified compilation will stop after semantic analysis No output is generated C If the c option is specified compilation will stop after the front end No output is generated discard_names This option has the same effect as using pragma Discard_Names e count The e count option causes the compiler to report MAPUS FT Porting Made Easy 196 OS PORTING AND ABSTRACTION LAB USER MANUAL Options Description only the first count errors The default is 100 0 The eo option enables optimizations that are performed by the front end This is the default ga Generate Ada oriented debugging information The ga option causes the compiler to generate the appropriate code and data for operation with the C debugger but in a way that should cause it to display the Ada source code rather than the C
9. E Properties 3 Progress Console Property Value E Info derived false editable true last modified April 20 2010 10 39 49 AM linked false location C MapuSoft OSPAL workspace sample faa name camnle g sample di OS PORTING AND ABSTRACTION LAB USER MANUAL Porting VxWorks Applications using OSPAL Porting applications into the OS PAL host environment can be done in three different ways 1 Porting a WindRiver Workbench project 2 Porting a Legacy application 3 Manual porting using OSPAL Method 1 Porting a WindRiver Workbench C Project NOTE This feature requires a license Click http mapusoft com downloads ospal evaluation to request an evaluation license 1 From OS PAL main window select any project underC C Projects tab on the left pane 2 Select File gt Porting gt VxWorks gt Import Workbench C Project as shown in Figure 53 You can also click on the Porting icon amp from the task bar Figure 53 Im porting a VxWorksWorkbench C Project in OS PAL PAL Projects OS Porting and Abstraction Lab File Edit Source Refactor Navigate Search Project Run Tools Window Help Dis m DORX BGO M amp O Q i W FEY PaL Profiler pat Projects Resource VxWorks gt GY Import Workbench C Project p505 gt P Import Legacy C Code Nucleus POSIX an b b Fie C C Projects 52 la micro ITRON Windows BE Resource E C demo_cross
10. Porting Made Easy 140 OS PORTING AND ABSTRACTION LAB USER MANUAL Field Description Your Action OLING Default Specifies the default Enter the default TaskpoolTime TaskpoolTimeslice TaskpoolTimeslice slice NOTE The default value is OS_DEFAULT_TSLICE Default Specifies the default Enter the default Taskpool timeout Taskpool Taskpool timeout value value Timeout NOTE The default value is Value OS_TIME_TICK _PER_SEC 6 11 On Process configuration tab configure the options to your specifications as shown inFigure 94 Select the check box next to Enable Cross OS Interface Process Feature to allocate the memory from a shared memory region to allow applications to communicate across multiple processes By disabling this option the memory will be allocated from the individual application process specific pool which is created during the OS_Application_Init function call Figure 94 Process Tab OS PAL Target Code Generator P a This wizard optimizes target specific source code L2 7 Task Process Memory Other Resources Debug Output Devices ANSI Mapping Device IJO Interface Maximum Process Control Blocks Process Memory Pool Minimum Size in Bytes Process Memory Pool Maximum Size in Bytes Stack Size for the Main Process in KiloBytes Heap Size for the Main Process in KiloBytes Task Priority for the Main Process Task Preemption Mode for the Main Process MAPUS QFT Porti
11. Porting Made Easy 262 OS PORTING AND ABSTRACTION LAB USER MANUAL create an RTL library project An application project will be created for the target but it will require some manual modifications to build The modifications which need to be made to the application project are as follows Header Inclusion Add include lt target lt target lt target Add include application if your Ada paths for the Ada RTL component dir gt rtl dir gt rtl sre dir gt rtl1 IL path for any other C library that you need for your project is integrated with Cross OS you will need to add the following lt target lt target dir gt include include dir gt cross_ os lt target gt include MAPUS QFT Porting Made Easy 263 OS PORTING AND ABSTRACTION LAB USER MANUAL Revision History Document Title OS Porting and Abstraction Lab User Manual in MS Word Release Number 1 3 7 Release Revision Orig of Description of Change Change 1 3 6 0 1 VV New Manual 1 3 6 1 0 1 VV Ada sections 1 3 7 0 1 VV Changes to Ada C Ct Changer and Target Code Optimization sections 1 3 8 0 1 VV Changes to Target Code Optimization sections MAPUS FT Porting Made Easy 264
12. e To include comments in generated C code select the radio button Note By default this is enabled e To suppress comments in generated C code select the radio button Include C C Specifies if you want to include C C You can do any one of the following the header files to be separated or included in the C files itself files e To include full C output only select the radio button Note By default this is enabled e To include C namespace Exceptions select the radio button Header Files Specifies if you want you can do any one of the following e To separate c and h files in generated C Source files select the radio button Note By default this is enabled e To not to generate separate h files in generated C Source files select the radio button Association Specifies the association constructs You can do any one of the following e To place and on same line as associated construct select the radio button Note By default this is enabled e To place and on its own line select the radio button Checks Specifies if you want to select the corresponding checks You can do any one of the following e To suppress all checks in generated C code select the radio button You can change the length as required needed Note By default this is enabled e To suppress numeric overflow checks in generated C code select the radio button e
13. A pat Profiler vey SHA Babes tae d PA Projects von Pia AUTE ESE z Show view b S profiler_data_1210 Other System Customize Perspective Functions Save Perspective As p 5 Threads Reset Perspective oe amp Task_1 Close Perspective Lo a Task_2 1400C Close All Perspectives N Platform AF T ao x Fa os_set_tast E 12000__ Navigation 4 os Create 000C Ca working Sets gt O _Get_Cu oO 05 Protect D 8000 Preferences E e os_unprote 8 600000 ES oS os_Get_tve 400000 lt ifii 7 083 os_steep_ti gt 200000 is gt os_appica i os_cettve amp 0 Rae Se mr om ooo os_set_tver E a os_Delete e Instances of E Tedd Task 3 j called by Task_2 Thread Q Task_4 Su E gj Ex Task_5 PESEN F oie SE E Properties 22 E a Task_6 gt a 5 ui 5 A ag Task_7 Property value S Average execution time 0 000 277 083 Nano Seconds Instance with the longest exe 11 Instance with the shortest ex 12 v lt EIES E MAPUSS FT Porting Made Easy 170 OS PORTING AND ABSTRACTION LAB USER MANUAL You can view OS PAL Profiler Perspective as shown in Figure 107 Figure 107 OS PAL Profiler Perspective Profiler OS Porting and Abstraction Lab File Edit Navigate Search Project Run Tools Window Help Bite oo AMM i vie FEY pa Profiler Debug PAL Projects a Profiler Data Expl 3 E PA profiler_data _1210 System t 47 Functions 5 Th
14. C C Build gt Settings MAPUS FT Porting Made Easy 225 OS PORTING AND ABSTRACTION LAB USER MANUAL Ada C C Changer Build Ada C C Changer enables you to build an existing project This feature enables you to either do an incremental full build or just a C C Changer Build on your Ada 95 sources e The Build process will incrementally compile the Ada files that have been modified or added since the last build NOTE To do an incremental build you should not do Clean e If any new Ada source files are added removed or modified in the project and want to generate the c sources again you can do a full build by first calling Clean and then Build NOTE Clean will delete all your info files which will result in a full build e You cannot re build if new directories are created or new files are added with differing extension than what was provided during the project creation If you have new directories and new extensions then you must recreate the Ada C C Changer project e You will get a build error when you create an Ada C C Changer project with the default all option for the Main Ada Procedure Name MAPUS FT Porting Made Easy 226 OS PORTING AND ABSTRACTION LAB USER MANUAL To do Ada C C Changer Build 1 To generate the corresponding executable right click on the project you have created on the projects pane and select Build Project in project or from the main menu select Projects gt
15. Cross OS interface provides you a robust and standard OS interface architecture for flexible application development and portability while eliminating the risks associated with selecting an OS and dependency on a single vendor OS Abstractor makes your application adapt to multiple operating system platforms with a standard OS interface thereby reducing cost associated with code maintenance and learning multiple operating systems OS Abstractor is designed for use as a fully scalable C library Services used inside your application software are extracted from the OS Abstractor libraries and are combined with the other application objects to produce the complete image This image may be downloaded to the target platform or placed in ROM on the target platform Application developers need to specify the OS for the application and also include the required OS Abstractor libraries while building the application Application developers can also select the individual OS Abstractor components that are needed and exclude the ones that are not required OS Abstractor is graphically represented in the following diagram QS ABSTRACTOR Interface Overview Diagram Target Operating Systems Your Applications OS Abstractor for Developing Portable Software includes the following topics e Introduction to OS Abstractor Products e Installing OS Abstractor Products e Using OS Abstractor MAPUS QFT Porting Made Easy 34 OS PORTING AND ABSTRACTI
16. FEY pat Profiler pat Projects Resource VxWorks psos TE cic Projects 3 BY import Legacy C Code rs 1 E Al ada2 A l POSIX gt Be El Problem icro ITRON gt 10 items ji gt a Al napo aa n Description pom Resource 4 C demo_cross_os E C demo_nucleus demo_posix demo_psos demo _uitron demo_vxworks demo_windows D E W E E demo_ada_to_c MAPUS QFT Porting Made Easy 94 OS PORTING AND ABSTRACTION LAB USER MANUAL 2 On OS PAL Import window select the root directory from where you want to import the legacy code by clicking on Browse button next to the text box and click Next as shown inFigure 68 Figure 68 Import Nucleus Legacy Code Window Import Nucleus Legacy Code Select a Directory to Import Legacy Code Into OS PAL Root Directory D legacy Nucleus Project Name nucleus _legacy Root Task Prototype VOID NucleusRoot UNSIGNED argv VOID argc Root Task Stack Size in bytes OS_MIN_STACK_SIZE Root Task Name NU_ROOT 3 Enter the project name for which you want to import the legacy code in the Project Name text box 4 Enter the root task prototype next to Root Task Prototype text box 5 Enter the root task stack size next to the Root Task Stack Size text box The value should be in bytes 6 Enter the root task name next to Root Task Nametext box MAPUS QFT Porting Made Easy 95 OS PORTING AN
17. Output Files The Ada program builder generates a corresponding load module for eg main procedure name exe Messages All program builder messages are written to console view Main features of Ada C C Changer and Ada PAL Compiler The Ada run time is written in Ada 95 and then translated to C C The run time is layered and is re hostable on various operating systems As delivered it depends only on C s native setjmp longjmp but is structured to allow re hosting on POSIX like OS s or other RTOS s that have support for threads and some kind of mutex Ada C C Changer amp Ada PAL Compiler converts 100 of the Adasource into C with no human intervention Our tool is based on a fully validated Ada compiler which handles the full Ada 95 language It produces efficient and readable C that exactly matches the semantics of the original Ada program A single Ada source file can have any kind of code within it though some compilers are more restrictive than that and use specific naming conventions such as Rational s l ada and 2 ada or AdaCore s ads and adb Ada Tool is designed to handle any organization of code within source files Furthermore even though a source file might contain only a package spec it might still have code that needs to be executed when the package is elaborated This code will be placed in the c file for the package spec Similarly even though a file might contain only a packag
18. Select the project from can generate for this project The generated the drop down list project files are directly imported into the specified IDE Eclipse Visual Studio and this project becomes a project of that IDE Destination Specifies the path to place the generated Click Browse and select Path optimized target code the folderto place the generated code MAPUS FT Porting Made Easy 129 OS PORTING AND ABSTRACTION LAB USER MANUAL If you select an application project OS PAL checks if the application project has any linked in libraries and queries the workspace for any matching library projects If OS PAL finds any libraries then it will listall the available libraries on the page as shown inFigure 88 All the libraries are selected by default and you can select or deselect any all libraries to export library sources along with the application during code generation process Select the libraries and click Next Figure 88 Select the linked in Libraries Optimized Target Code Generator This wizard optimizes target specific source code This application project depends on the following libraries within the current workspace and as such will also be exported along with the application during the code generation process If you prefer not to export any specific library then unselect them Libraries E Doiospal_vx_libproj E E samplet E sample2 NOTE When you export OSPAL libraries it will skip API
19. Wind River s Workbench QNX s Momentics Sun Microsystem s Sun Studio Visual Studio NET 2005 Micro Soft s Visual Studio 2006 Micro Soft s Visual Studio Net 2008 Eclipse s CDT and makefiles AfterGenerating Optimized Target Code select the check box next to Generate a Project File and choose your IDE as shown inFigure 104 Figure 104 Generating Project Files Optimized Target Code Generator Please specify the destination directory Target Version SMP vxWorks 6 x UP Kernel Mode User Mode Architecture 32 bit Target Hardware PPC Load settings from Previous Project WindRiver Workbench 2 6 Destination Path i Cancel MAPUS QFT Porting Made Easy 159 OS PORTING AND ABSTRACTION LAB USER MANUAL Inserting Application Code to Run only on Target OS Environment The user configuration is done by setting up the appropriate value to the pre processor defines found in the cross_os_usr h NOTE Make sure the OS Abstractor libraries are re compiled and newly built whenever configuration changes are made to the cross_os_usr h when you build your application In order to re build the library you would actually require the full source code product version not the evaluation version of OS Abstractor Applications can use a different output device as standard output by modifying the appropriate functions defines in os_target_usr h along with modifying os_setup_serial_port
20. checking will increase the application performance and reduce your code size Figure 97 Debug Tab OS PAL Target Code Optimizer This wizard optimizes target specific source code Task Process Memory Other Resources Debug Output Devices ANSI Mapping Device yo Interface ieee Re E Ars kbs ces appa te b se Enable Debug Output 05_DEBUG_MINIMAL _ Ignore Fatal Errors MAPUS QFT Porting Made Easy 147 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on Debug tab are as follows Field Description Your Action Enable Debug Specifies if you want to Select the debug output from the Output enable the debug output dropdown menu OS_DEBUG_VERBOSE print debug info fatal and compliance errors OS_DEBUG_MINIMUM print minimum amount of debug info OS_DEBUG_VERBOSE Note The default value is OS_DEBUG_VERBOSE Enable Error Checking Specifies if you want to enable the error checking To enable error checking select the check box Use this option to increase performance and reduce code size Note By default this feature is enabled Ignore Fatal Errors Specifies if you want to enable the feature to ignore fatal errors To enable the feature to ignore fatal errors select the check box Note By default this feature is disabled MAPUS FT Porting Made Easy 148 OS PORTING AND ABSTRACTION LAB USER MANUAL 15 On Output De
21. imports that is converted to the main c function that will be started as thread in Cross OS or other interfaces For example Sudoku_Test Note The default value is hello_world Enter Ada File Extensions used in your Ada Project Specifies the source files that have extensions other than the default extensions listed in the drop down list The default extensions listed here are a ada adb ads bdy dat spc sub You can do any one of the following e To add a new extension other than the default ones enter in the text box and click Add Note By default this is enabled e To remove an extension select the extension from the drop down list and click Remove Note 1 Default extensions already available cannot be removed Note 2 Ada Extensions are case sensitive Specify Option File Specifies if the user wants to specify any set of options that are needed for the Ada C C Changer Note This can be created using space as delimiter To specify an option file select the check box and click Browse and select the option file Note If option file is specified then Ada configuration options page will open with the specified options in the option file If not specified then Ada Configuration options page opens with the default options User can select or over ride the options in this page MAPUS FT Porting Made Easy 238 OS PORTING AND ABSTRACTION LAB USER
22. on OS PAL main menu or as shown inFigure 51 Figure 51 Updating Project Settings PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help Ez f B lo R a gt Optimized Target Code Generator r A Update Settings License Full Library Package Generator A Ada C C Changer FEY PaL Profiler pat Projects m 2 eg aw adapal_1 E C demo_cross_os demo_nucleus demo_posix demo_psos demo_uitron demo_yvxworks example projl Ag CiC Projects 53 B A i H E A a CREN Problems E Properties 2 Progress El Console e Property Value Info derived False editable true last modified April 20 2010 10 39 49 AM linked False location C MapuSoft OSPAL workspace sample name samnle sample MAPUS QFT Porting Made Easy 76 OS PORTING AND ABSTRACTION LAB USER MANUAL 2 OS PAL does an auto search for the project updates and updates the settings as shown in the Project Settings Updation window in Figure 52 Figure 52 OS PAL Project Updates PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools AE wh Doe a Om 2Ox BOo H N sF 5 E Pa Profiler PAL Projects demo_cross_os demo_nucleus demo_posi Project s OS PAL Specific Library Paths And Include Paths Are Updated Successfully RN Problems
23. ssseesseseesseseessressrsrrssrsrresresrrseresresseseresressessres 32 OS Changer for Re using Software eesssesseseseseeseesersrrsreesetsrtrriesrtsrrseresresseseresresseese 33 OS Abstractor for Developing Portable Software 0 0 eee eeseesseceseeeeeeeeseecnaeeeseeees 34 Full Library Package Generator goisccescchedeudeticsheadsiaseatarteecnsdcnasadeadd dellesestetaedentiaacdsnadesie 35 Optimized Target Code Generator eeeseeeeeereeseereesttsritrerstrsrtrrresrtsrrseresressrseresressreses 35 Ada PAL Compilef seissisnsoiiinseiscasiiaie niesi ia Ee anii ai asiasi 36 AdaC CFF Chan f ts rnnesa n A E a E T E A 36 Profiling Applications and Platform eeeeeeeseseseeseseseeressessrrseesersserreeseesresereseeseeseeesee 37 CHAPTER 3 OS SIMULATOR WITH HOST DEVELOPMENT 38 List of Available OS Similar sisis a 39 Host Development Enviromiment 2c2c ccce cscececcssecdessseacessanveceusseescecanceeseetasveesaunanecevans 39 CS st cadet eek ae a eee e ean cede i ae a ear EA E E Ea 39 MinGW dase eeacs ted Secs nin A E E E N EE E 39 GNU Compiti ieori taine ieai a E A E A AA RA 40 OS PAL Supplied GDB vessetek riia ea e E S EE 40 Creating an OS PAL C C Project sesssesssssesssesseesesssrssessessssssessresssesrescsssersoesresses 41 OS PAL Project Template Piles o s0ccsiusseacsanncaagadendeacsnavesqsieniaaetvaneiastenteretnuanaaurens 47 Host System Confira onses ieira n E E 50 Creating a Project with Multiple Interfaces o ccccsssacce
24. the adacgen process will restart upon severe internal error such as a segment violation bus error or assertion failure The process will restart with the file that was being processed when the failure occurred If the file causes a severe error again adacgen will restart with the next file to MAPUS FT Porting Made Easy 198 OS PORTING AND ABSTRACTION LAB USER MANUAL Options Description prevent infinite reprocessing of that file nl The nl option specifies that the adacgen process will be restarted with the next file after the file that was being processed when the failure occurred The default behavior without nl is to restart with the file that caused the failure See also ne nonr The nonr option specifies that the compiler front end may release any heap memory to the current heap The nz option initializes all heap memory used by the compiler front end to a nonzero value In hex the nonzero value is BAD1BAD1so it is easy to spot in the debugger and causes a Bus Error on a Sparc when it is dereferenced 2 pL L options The pL option passes the specified L options to the lister t The t option generates a trace message as each declaration and statement is passed to the emitter phase of the front end xB exe path The xB option overrides the default back end and uses exe path instead xddir path The xd option overrides the default ADA MAGI
25. 114 e Statement with no effect 28 e Unused variable 83 e This decimal constant is unsigned only in ISO C90 1 MAPUS QFT Porting Made Easy 254 OS PORTING AND ABSTRACTION LAB USER MANUAL Ada PAL Compiler Build Ada PAL Compiler enables you to build an existing project This feature enables you to either do an incremental build or a full build on your Ada 95 sources e The Build process will incrementally compile the Ada files that have been modified or added since the last build NOTE To do an incremental build you should not do Clean e If any new Ada source files are added removed or modified in the project and want to generate the c sources again you can do a full build by first calling Clean and then Build NOTE Clean will delete all your info files which will result in a full build e You cannot re build if new directories are created or new files are added with differing extension than what was provided during the project creation If you have new directories and new extensions then you must recreate the Ada PAL Compiler project MAPUS FT Porting Made Easy 255 OS PORTING AND ABSTRACTION LAB USER MANUAL Ada PAL Compiler project Build To build an Ada PALCompiler project 1 Create an Ada PALCompiler project using the Ada PAL Compiler Refer to Creating Ada PAL Compiler project section 2 Select the project and right click on it and select Build as shown in the Figure 153 Figure 153 B
26. 3 os application start E your target operating system main int LPSTR LRETKETETFKTFTHATATH ETAT HATA RH AT HAHATHA HATHA AAT int main int argc LPSTR argv amp al gt gt E console 2 Zi Tasks ZL Problems Memory B xX amp Ee EE o rjo demo_vxworks exe OS PAL Local C C Application D runtime ospal product demo_vxworks Debug demo_vxworks exe OS Mainfi MAPUS FT Porting Made Easy 68 OS PORTING AND ABSTRACTION LAB USER MANUAL You can see the debugging on the console as shown in Figure 45 Figure 45 Debug Demo Application Output ce D runtime ospal product demo_vxworks Debug demo_vxworks exe from the high priority task Number of iterations by this task from the low priority task Number of iterations by this task from the high priority task Number of iterations by this task from the low priority task Number of iterations by this task from the high priority task Number of iterations by this task from the low priority task Number of iterations by this task from the high priority task Number of iterations by this task from the low priority task Number of iterations by this task from the high priority task Number of iterations by this task from the low priority task Number of iterations by this task MAPUS QFT Porting Made Easy 69 OS PORTING AND ABSTRACTION LAB USER MANUAL Debuggi
27. Count This feature enables you to count the Ada lines of code with a simple program It just takes a list of file names and prints out the numberof lines of Ada source code lines of comments and blank lines counting lines ofcode the same way the license checker counts them The application name is ada_line_count exe You have to run this exe in cmd prompt Command ada_line_ count file1 file2 file3 2 POSIX ADA Support For Linux only Ada tools now give support to POSIX You have a separate library with POSIX Ada packages for Linux only To make this linked library available to a given user the adaopts command Command adaopts p usr local OSPAL Tools Ada linux posix_ada will link the posix ada library into the search path for the current library 3 Ada Support for GNAT compatibility compiler This feature enables you to link the gnat compatibility library into the search path for the current library The following commands are used to link Linux Command adaopts p usr local OSPAL Tools Ada linux gnat_compat Windows Command adaopts p C OSPAL Tools Ada windows gnat_compat 4 Ada Support for Win32 This feature enables support for Ada on Win32 host The following command is used for the win32ada library Windows Command adaopts p C OSPAL Tools Ada windows win32ada 5 For Ada C C Changer project from Properties page if you change Ada Main procedure it will not build the project with that pro
28. Description Generation For Cross OS Interface successful Generate Project Files Status SUCCESS Description Generation of Project Files successful Ada Projects Status WARNING Description 1 If this is Ada Compiler Projects Code Optimization would not work 2 IF this is Ada Changer Project without Abstractor Integration the generated code WILL NOT work since there is no call to OS_Application_Init MAPUS QFT Porting Made Easy _ 157 OS PORTING AND ABSTRACTION LAB USER MANUAL 20 You can view the OS PAL generated optimized code in Figure 103 Figure 103 OS PAL Generated Example demo_cross_os i File Edit View Favorites Tools Help j Q ex X amp pe Search gt Folders E E Folder sync Address D targetcode demo_cross_os File and Folder Tasks CJ optimized_interface GI Make a new folder Publish this Folder to the Web E2 Share this folder Other Places D targetcode 3 My Documents Shared Documents 5 My Computer E My Network Places Details 0 bytes p My Computer MAPUS FT Porting Made Easy a Y OS PORTING AND ABSTRACTION LAB USER MANUAL Generating Project Files for your Target NOTE This feature requires a target license Click http mapusoft com contact to send a request to receive licenses and documentation OS PAL provides the ability to generate project files for project files for the following targets
29. H i O Q i vith Ff Fy pa Profiler Debug PAL Projects 5 Debug 2 Op 0 m a a E B oe OS PAL Supplied GDB 1 6 10 5 09 PM 5 E w Thread 1 Suspended EnA a L amp ae Thread 2 Suspended v gt a k A _os_init_windows c 53 A B outline 33 Z7 specific code For instance if you wanti GS R x ev i on Linux you could do it here before cal i When optimizing you will need to write a i your target operating system F J PEKTKTFTFTATATAAAHATATATATATATA TAH AATAH ATH AAEAS SI oos_target h SI os_application_star maingint LPSTR int main int argc LPSTR argv OS Mainfi MAPUS FT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL 4 The debugging resumes as shown in Figure 44 Figure 44 Debug Demo Application Perspective PAL Debug demo_vxworks source __os_init_windows c OS Porting and Abstractio Sele File Edit Refactor Navigate Search Project Run Window Help PT EOlm i O Q Oe i i F FE pat Profiler Debug Pat Projects My Aaa CE wl p Thread 1 Running sone p Thread 2 Running a C eclipse3 3 1 1 mingwibin gdb exe 1 t pe D runtime ospal product demo_vxworks s i ml _os_init_windows c 3 B Outline 3 specific code For instance if you want amp X w e P a PENNE yeu could on ie Retere cal Yl os_target h ae en optimizing you wi need to write a
30. MANUAL ADA PAL Compiler Configuration Options On the Ada PAL Compiler Configuration Options page you can set the following configurations Ada Source Ada Listings Ada Messages Ada Drivers Additional NOTE You can change the configuration options on the Ada PAL Compiler Property Page To go to the Ada PAL Compiler Property Page right click on the project and select Properties Ada PAL Compiler Configuration File Ada PAL Compiler options are configurable via an Option s file a b Once you have anAda PAL Compiler project and you want to use the same options that you have used Browse to the workspace directory location and into your project_name directory You will find a file called options file and you can save that file in a different location you can also rename it if you want and use it again and again You can create new Ada PAL Compiler projects by passing the file info in the first screen Ada PAL Compiler reads this info and sets up the GUI configuration values accordingly Note In the next release we are thinking of skipping the entire subsequent configuration screen until the OS Abstractor Integration screen This way you can create an option file and use it repeatedly as a template However if you later want to modify these options after creating the project you can select the Ada PAL Compiler project and right click and choose Properties and select Ada PAL Compiler Configurationpage and change
31. Navigate Search Project Run Tools Window Help DioR BO Dje S w s Fey pat Profiler pat Projects Tacit projets ia 0 JE E adapal_1 a demo_cross_os a demo_nucleus _ demo_posix ka demo_psos La demo_uitron a demo_vxworks La example BEN projl sample 3 Binaries sample exe x86 le GH ja Includes CS include H E source H E Debug H e Problems Properties 23 Progress z Console os_application_start c os_entry c windDemoOriginal c windDemoPorted c E7 7 E7 i E7 Property Value E Binary Info bss cpu data debug needed saname sample Debug sample exe MAPUS QFT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL Executing Binary Files To execute the binary in Windows host 1 Select Project that you have created 2 Select the Binary file right click and select Open With gt System Editor as shown in Figure 40 Figure 40 Executing the Binary File Projects OS Porting and Abstraction Lab OWA Fie Edit Refactor Navigate Search Project Run Tools Window Help wu m OOR BO B er O a i 4 lt P sf PP ba FEY pat Profiler PAL Projects Fig CiC Projects 22 z o Va ES aj adapal_1 demo_cross_os demo_nucleus demo_posix New 4 demo_psos demo_uitron demo_vxwor example Tools p Text Editor projl Exclude From build B system Editor he sample i i i C E Buil
32. Nucleus PLUS based device drivers are not part of the Nucleus PLUS based device drivers C Happy Porting ee pT No ae No al mplement the Yes gt Yes gt unsupported APIs using OS Abstractor 4 target OS AP Modify your application to handle the differences 4 Modify the target OS BSPs to the desired target configuration Port the device driver routines to target OS or modify application to use target OS drivers instead CHECKS Make changes if needed to Are you using interrupt service routines tha Yes make them to work under target OS MAPUS FT Porting Made Easy 93 OS PORTING AND ABSTRACTION LAB USER MANUAL Porting Nucleus Legacy C Code This section explains Porting Nucleus Legacy Applications using OS PAL Porting Plugin A sample porting of Nucleus Legacy application using OSPAL is described with an example here NOTE This feature requires a license Click http mapusoft com downloads ospal evaluation to request an evaluation license 1 Select File gt Porting gt Nucleus gt Import Legacy C Code as shown inFigure 67 You can also click on the Porting icon from the task bar Figure 67 Importing Nucleus Legacy C Code in OS PAL PAL Projects OS Porting and Abstraction Lab File Edit Source Refactor Navigate Search Project Run Tools Window Help m SOX BPO B amp O Q
33. Optimization Target Code Generator will contain the following folders files e Application project sources and project make files e OS Abstractor Interfaces the ones that are included in the project e Library sources without project files MAPUS QFT Porting Made Easy 130 OS PORTING AND ABSTRACTION LAB USER MANUAL 5 On Profiler Configuration tab define your profiler data specifications as shown in Figure 89 Figure 89 Profiler Configuration OS PAL Target Code Optimizer This wizard optimizes target specific source code R Profiler Configuration Platform API Profiling Application Functions Profiling Description Profiler Task Priority File Path To Store Profiled Data e g c profiledData OR shomejuser1 Number of Data in Memory Before Each Write Maximum Profiler Data to Collect MAPUS QFT Porting Made Easy en i G f The field descriptions on Profiler Configuration tab are as follows Field Description Your Action Description Specifies the description for the Cross OS Interface project Type description for the Cross OS Interface project Profiler Task Priority Specifies the priority level of the profiler thread Enter a priority level for the profiler thread The value can be between 0 through 225 The default value is set to 200 Data File Path to Store Profiled Specifies the directory location w
34. PAL Compiler Project meegee Sj Project 9 Source Folder CS Folder Di Source File hy Header File File from Template dass Py Other Ctrl eCSeTmMeERr Projects 05 Porting MAPUS QFT Porting Made Easy Inbox Microsoft Ou f 3 Windows Explorer T 05 Porting and Abst untitled Paint J Think Special Googl IOO am RB Thursda W 11 24 2011 ey OS PORTING AND ABSTRACTION LAB USER MANUAL 3 On OS PAL C Project Wizard window type a project name and give a location next to Project Name text box 4 Under Project Types expand the Executable menu Select Template Project and click Next as shown in Figure 28 Figure 28 OS PAL C Project Wizard Window 3 OS PAL C Project Wizard OS PAL C Project Wizard Creates OS PAL C Project Project name sample Use default location Location G 1 3 8_ Test _BuildsjOSPAL_ Win_1_3 8 ALPHALS 22Nov11iwort l Project type Toolchains Executable MinGW GCC Empty Project Template Project gt Hello World C Project Hello World ANSI C Project H E Shared Library w E Static Library H E Makefile project V Show project types and toolchains only if they are supported on the platform lt n ri 52 OS PORTING AND ABSTRACTION LAB USER MANUAL 5 On Basic Settings window define the basic properties of your project and click Next as shown inFigure 29 Figur
35. Porting POSIX Legacy Applications using OS PAL Porting Plugin A sample porting of POSIX Legacy applications using OSPAL is described with an example here NOTE This feature requires a license Click http mapusoft com downloads ospal evaluation to request an evaluation license To port a sample POSIX legacy application 1 Select File gt Porting gt POSIX gt Import Legacy C Code as shown inFigure 63 You can also click on the Porting icon from the task bar Figure 63 Porting POSIX Legacy C Code in OS PAL Projects OS Porting and Abstraction Lab File Edit Source Refactor Navigate Search Project Run Tools Window Help DAOR BO M O Q v Fey Pat Profiler pac Projects Resource VxWorks gt a p505 3 E C C Projects 3 a Nucleus p H x Import Legacy C Cade B Problem H E Al BASS micro ITRON gt _ demo_ada_to_c iOitems Windows gt E Description Resource fF C demo_cross_os demo_nucleus demo_posix demo_psos demo_uitron demo_vxworks demo_windows lB idemo_ada_to_c MAPUS QFT Porting Made Easy 89 OS PORTING AND ABSTRACTION LAB USER MANUAL 2 On OS PAL Import window select the root directory from where you want to import the legacy code by clicking on Browse button next to the text box and click Next as shown in Figure 64 Figure 64 Import POSIX Legacy Code Window Import Posix Legacy Code Select a Directory to
36. Projects Cross OS interfaces are added directly to the project as target sources if you have a valid and relevant Standalone Package Generator license If Target Code Generation is attempted on these projects all the Cross OS functionality being part of application is again redefined in cross_os c This will give re definition errors on compile time Hence Ada PAL Compiler projects cannot be code optimized NOTE For Ada C C changer projects along with Abstractor if you do target code generation it will generate sample project files You have to generate your own project files to generate binaries Manual Modifications to Projects files generated by Target Code Generator The target code output produced when optimizing Ada projects via the target code optimization process is a little different than that of the standard C C OS PAL project In this case the API level optimization process is skipped as the application needs to link in other required RTL C C libraries and possible other C interface libraries Instead of the OS Abstractor code being included as part of the application it is added into the target directory as a separate code base that should be built as libraries There will be separate libraries for the Cross OS component as well as any other OS Interface components like VxWorks Windows etc included in the project There will also be a separate Ada Run Time Library RTL required to be linked in as well For
37. QB Ada CiC Changer Configuration options Set your configurations for Ada C C Changer tool Ada Source C C output Ada listings Ada messages Ada drivers lt gt Error messages Error messages Show errors in with ed files Limit on number of error messages 999 Warning messages Warning messages C Show warnings in with ed files Info messages _ Info messages Show infos in with ed files Message Format Show given error message only once Show message on each line it applies MAPUS QFT Porting Made Easy 216 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on Ada Messages tab are as follows number of error messages error messages Field Description Your Action Error Specifies if you want You can do any one of the following Messages to select error e To select error messages select the check messages box Note By default this is enabled e To show error sin with ed files select the check box Limit on Specifies the count of Enter a value to specify the limit on number of error messages Note By default the value is 999 Warning Messages Specifies if you want to select warning messages You can do any one of the following e To select warning messages select the check box Note By default this is enabled e To show warnings in with ed files select the check box Info Messages Specif
38. RTOS that OS Changer provides migration to MAPUS QFT MOSCHANGER Flow Diagram STEP ONE Choose an option STEP TWO Option One Option Two Optimized Code Generation Full Source Package Generation Your application Import using eS Porting steps Your application Replace headers Combine main executable Runs application hran Deiana Download run on your target OS Configure target OS Profiler Interface Optimizer amp system settings Generated Profiler Generate Interface data optional code for target OS Output View data using Unmodified application code OS PAL Profiler Optimized interface files Continue to STEP TWO Native compiler Output Cross OS interface object Existing OS Interface object Applicaton objects www mapusoft com Continue to STEP TWO 1 877 MAPUSOFT Figure 79 OS Changer Flow Diagram Your legacy application can be re usable and also portable by the support provided by the OS Changer library and the OS Abstractor library Applications can directly use the native target OS API however doing so will not make your code portable across operating systems We recommend that you use the optimized abstraction APIs for the features and support that are not provided by the OS Changer compatibility library NOTE For more information on configuration and target OS specific information see Cross OS Interface Reference Manual MAPUS QFT Porting Made Easy 107 OS PORTING AND ABSTRACTION LAB USER MANU
39. S m BARB amp vie E PAL Profiler Ecd Debug PAL Projects PAL Profiler Data Expl 3 Pat Profiler view 3 amp A profiler_data_1210 System lt gt Functions lt gt Threads E e Task_1 a Task_2 Platform AF qp 1400000 1 255 187 0s_set_tast 3 1200000 os_create 1000000 i ms ae COREE tne Chart Oo M os_ce ied Area Chart OS_Sle Scatter Chart os_ap os_ce Load Profiler Data File os_set J Generate Report i OS_Del g Generate Comparison Report S O Task_3 H O Task_4 Eul E7 Task_5 OG SS E Properties 83 E Ezg o Task_6 p 3 O Task_7 Property value Average execution time 0 000 277 083 Nano Seconds Instance with the longest exe 11 Instance with the shortest ex 12 of OS_Get_Current_Task_ld led by Task_2 Thread MAPUS FT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL Opening OS PAL Profiler Perspective From OS PAL main menu click OS PAL Profiler perspective button as highlighted Or dis On OS PAL main menu select Window gt Open Perspective gt Profiler as shown in Figure 106 Figure 106 Opening OS PAL Profiler Pers ective Profiler OS Porting and Abstraction Lab File Edit Navigate Search ee Run Tools EATE Help ty on GH a New Window New Edito E PAL Profiler Debug PAL Projects PAL Profiler Data Expl 23
40. This will get stored as the new option file for that project This gives you the flexibility to use the template when you create the project and also let you change if needed MAPUS FT Porting Made Easy 239 OS PORTING AND ABSTRACTION LAB USER MANUAL 3 OS PAL now provides support to multiple Ada source directories You can browse and select the multiple source directories On Ada Source tab page add the Ada source directories as shown in Figure 143 Figure 143 Ada Source QB Ada PAL Compiler Configuration options Set your configurations For Ada PAL Compiler tool Ada Source Ada listings Ada messages Ada drivers Additional Add Additional Ada Source Directories MAPUS QFT Porting Made Easy 240 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on Ada Source tab are as follows Field Description Your Action Add Additional Specifies if you want You can do any one of the following Ada Source to add any additional e To select the additional Ada PAL source Directories Source directories directories click Browse and select the Ada source directories e You can also remove an Ada PAL source directory by clicking Remove 4 On Ada Listings tab set your Ada listings configurations as shown in Figure 144 Figure 144 Ada Listings Page B Ada PAL Compiler Configuration options Set your configurations For Ada PAL Compiler tool
41. To include all run time checks in generated C code select the radio button Limit on the Specifies the length of Enter a value to specify the length of the line in length of the the line in the the generated C Source files generated C generated C Source Note The default value is 80 Source Line files MAPUS FT Porting Made Easy 213 OS PORTING AND ABSTRACTION LAB USER MANUAL 5 On Ada Listings tab set your listing options as shown in the Figure 127 Figure 127 Ada Listings Tab Ada CiC Changer Configuration options Set your configurations for Ada C C Changer tool Ada Source C C output Ada listings Ada messages Ada drivers Source listing No source listing Source listing only if errors Always produce source listing Source listing Format Pagination Continuous source listing Paginated source listing Page length 66 Page width 80 J Listing only of lines with errors or warnings Cross reference listing No cross reference listing O Produce cross reference listing MAPUS QFT Porting Made Easy 214 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on Ada Listings tab are as follows Field Description Your Action Source Listing Specifies how you want the Ada source list to be generated or not You can do any one of the following e To not to generate Ada source list select the radio button e To
42. Wind River Workbench Projects Select a Workspace to Search for existing Workbench Projects Projects In Workspace C Application Projects _ simple_vxworks_app Raj Library Projects location C MapuSoft OSPAL workspace sample name samnle The following are the project types Application Projects Provides an executable application This project type folder contains three templates The makefile for the Executable project type is automatically created by the CDT MAPUS QFT Porting Made Easy f ee 8 OS PORTING AND ABSTRACTION LAB USER MANUAL Library Projects An executable module that is compiled and linked separately When you create a project that uses a shared library libxx so you define your shared library s project as a Project Reference for your application The makefile for this project type is automatically created by the CDT NOTE Select the check box next to your required library or application project to be imported 6 If you select Application project and click Finish you get Application Start up Files windowas shown inFigure 56 Figure 56 Application Startup Files Window PAL Projects OS Porting and Abstraction Lab a lax File Edit Refd PAL Import Hm 1a iv PE Import Wind River Workbench Projects D Select a Workspace to Search for existing Workbench Projects FEY Pa Profile Ye cic Pro i Te Inputs For sim
43. Windows 2000 Windows XP Windows CE Windows Vista from Microsoft If you need to use the Cross OS Interface both under Windows and Windows CE platforms MAPUS FT Porting Made Easy 123 OS PORTING AND ABSTRACTION LAB USER MANUAL Flag and Purpose Available Options then you will need to purchase additional target license OS_TKERNEL Japanese T Kernel standards based OS OS_LYNXOS LynxOS from LynuxWorks OS_QNX QNX operating system from QNX OS_LYNXOS LynxOS from LynuxWorks OS_SOLARIS Solaris from SUN Microsystems OS_ANDROID Mobile Operating System running on Linux Kernel OS_NETBSD UNIX like Operating System OS_UCOS UCOS from Micrium For example if you want to develop for ThreadX you will define this flag as follows OS_TARGET OS_THREADX PROPRIETARY OS If you are doing your own porting of Cross OS Interface to your proprietary OS you could add your own define for your OS and include the appropriate OS interface files within os_target h file MapuSoft can also add custom support and validate the OS Abstraction solution for your proprietary OS platform Running OS PAL Generated Code on your Target MAPUS FT Porting Made Easy 124 OS PORTING AND ABSTRACTION LAB USER MANUAL Generating Optimized Target Code This section describes how to generate optimized target code using OS PAL Most of the configurations described below can also be changed at run time usi
44. and the header files of your ported legacy API instead ans Remove the original OS _ specific initialization code and use OS_Application_Init function call instead refer to the Cross OS Interface Reference Manual Create an OS PAL project for your legacy application and select the legacy API that your application will need Eg to port VxWorks application you need to check the Include VxWorks Interface API s If your application uses any APIs that are not supported under OS PAL re write the code using Cross OS Interface APIs Import your legacy application into the new project Compile and link your application and resolve all compiler and linker errors Run or debug your application under OS PAL host in an x86 environment You should rewrite replace any hardware specific code in your application for this step Step 2 Moving from OS PAL Host to target using OS PAL Optimized Target Code Generator 1 Generate the code for your target OS using the OS PAL Optimized Target Code Generator 2 Using cross compiler compile link and download the OS PAL generated code to your target 3 Port low level drivers and hardware interrupt code as required refer to Cross OS Interface I O and device driver APIs sections in the reference manual 4 Resolve any run time errors MAPUS FT Porting Made Easy a a a 8 8 OS PORTING AND ABSTRACTION LAB USER MANUAL Porting POSIX Legacy C Code This section explains
45. chosen the project will use C specific tasking instead of the OS This will not allow you to migrate to multiple Operating Systems and you cannot enable OS Abstractor Integrationfor this project after importing to OS PAL NOTE 2 If you have enabled the Cross OS APIs you can always enable the additional development APIs after importing to OS PAL MAPUS FT Porting Made Easy 220 OS PORTING AND ABSTRACTION LAB USER MANUAL Figure 131 OS Abstractor Integration Page Ada CiC Changer OS Abstractor Integration IF no OS Abstractor integration is chosen the project will use C specific tasking instead of the OS If you require a C interface check next to the OS Abstractor components required S Interface API s C Include POSIX Interface APT s C Include xWorks Interface APT s C Include p505 Interface API s C Include Nucleus Interface API s C Include micro ITRON Interface API s C Include Windows Interface API s MAPUS FT Porting Made Easy 221 OS PORTING AND ABSTRACTION LAB USER MANUAL 10 After porting Ada code into C Source Code is successfully done the porting report page is displayed as shown in Figure 132 Click Done to complete the process The report gives detailed information on the status of different activities in Ada to C source file generation Figure 132 Porting Report Porting Report Displays the Information about different activities in Ada to C Source File G
46. cmodule if they choose to use the format Input Output calls provided by the OS Abstractor You can add some application code or target specific things such as memory allocations such as Heap Size and Shared memory which are specific to target environments Target OS Selection Based on the OS you want the application to be built set the following pre processor definition in your project setting or make files Flag and Purpose Available Options OS_TARGET The value of the OS_TARGET should be for the Cross OS To select the target Interface product that you have purchased For Example if operating system you have purchased the license for OS_NUCLEUS Nucleus PLUS from ATI OS_THREADX ThreadX from Express Logic OS_VXWORKS VxWorks from Wind River Systems OS_ECOS eCOS standards from Red Hat OS_MQX Precise MQX from ARC International OS_UITRON micro ITRON standard based OS OS_LINUX Open source commercial Linux distributions OS_WINDOWS Windows 2000 Windows XP Windows CE Windows Vista from Microsoft If you need to use the Cross OS Interface both under Windows and Windows CE platforms then you will need to purchase additional target license OS_TKERNEL Japanese T Kernel standards based OS OS_LYNXOS LynxOS from LynuxWorks OS_QNX QNX operating system from QNX OS_LYNXOS LynxOS from LynuxWorks OS_SOLARIS Solaris from SUN Microsystems OS_ANDROID Mobile Operating System running on Lin
47. containing spaces and if not usually other programs used with OS PAL will experience problems with such paths Uninstalling OS PAL To uninstall OS PAL Browse to the installed OSPAL directory and start the Uninstall application You can also uninstall OS PAL by selecting Control Panel gt Add Remove Programs Select OS PAL and click Remove There is a possibility of user generated modified files to be left on your OSPAL installation directory If not necessary delete the files manually to remove the files MAPUS FT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL List of Technical Documentation Reference manuals can be provided under NDA Click http mapusoft com contact to request for a reference manual The document description table lists MapuSoft Technologies manuals Using these documents you can Port applications Perform OS Abstraction Generate optimized code Generate Full Library Package OS Abstractor OS Changer Packages Enable profiling Document Description Table User Guides Description System Configuration Guide Provides detailed description on the system configuration to work with MapuSoft products This guide e Describes the system requirements and configurations to get started with MapuSoft Technologies products OS Porting and Abstraction Guide Provides detailed description of how to do porting and abstraction using OS PAL This guide Explains how to port app
48. disable optimizations that substantially interfere with debugging No optimizations are specified for the C compiler back end e 1 pass O1 to C compiler back end e 2 pass O2 to C compiler back end e 3 pass O3 to C compiler back end If the O option is not specified Olis passed to the C compiler back end e g gcc of file The of option causes the compiler to read options and file names from the specified file These are processed as though the contents of the file were on the command line MAPUS QFT Porting Made Easy 197 OS PORTING AND ABSTRACTION LAB USER MANUAL Options Description pB BE options The pB option passes the specified BE options to the back end All text within the quotations is passed directly to gcc These options precede the other options that adacgen generates and passes to gcc Record layout listing for packed record types The q option specifies quiet mode it suppresses all nonessential messages Record layout listing for all record types The s option suppresses all automatic runtime checking including numeric checking This option is equivalent to using pragma Suppress on all checks Suppress Language Exception Handlers If this option is specified exception handlers that handle predefined exceptions Constraint_Error Program_Error Tasking Error and Storage_Error are removed from the program if the exception is always
49. expand the Platform APIs you can view all the platform APIs called in the application as shown in Figure 110 On the bottom of the window the function properties are displayed such as Average execution time Instance with the longest execution time The Task _1 in square brackets denote that these function properties belong to the Task 1 Thread Instance with the shortest execution time Total number of times function was called If you click on a Platform API you can view the number of instances of the specific function on the x axis and the time taken for each API on the y axis NOTE On top of the profiler view you can view different measures of time such as Seconds milli seconds micro seconds nano seconds as highlighted in the Figure 110 This is used to capture the time taken for each instance of the function in different time measures If you click on nano seconds the time graph will be shown as Time nano seconds as shown in the Figure 111 MAPUS FT Porting Made Easy 175 OS PORTING AND ABSTRACTION LAB USER MANUAL Figure 111 Platform APIs PAL Profiler OS Porting and Abstraction Lab File Edit Navigate a Project Run Tools pe Help iM HS S BEM a a PAL Projects PAL Profiler Data Explorer 53 C PaL 0 System ci Functions a gt O Platform APIs E OS_Create_Event_Group 05_Get_Current_Task Id m 05_Protect i OS_Unprotect ike en 0S_Set_Task_Priority 05_Get_Event_Group
50. file organization or configuration management e There are no significant disk storage requirements for the program library beyond that required for the source and object modules Root Directory In Ada root directory you inform the library of the location of the Ada source for the program The source can be in one directory in multiple directories or in multiple program libraries Once this information is provided the Ada compiler and program builder can automatically locate source files containing the required units as needed The following subsections describe the program library with details about how the Ada compiler and program builder use this program library Two tools are provided for maintaining the program library e The program library options tool adaopts can be used to display or modify the program library parameters This creates ADA LIB e The source registration tool adareg establishes which units are defined in which source files A description of the use of these tools follows the description of the program library This creates UNIT MAP An Ada program library is based in a directory called the program library directory All informationabout the program library and all generated files are kept in the program library directory or inspecified subdirectories The main contents of the program library are the source files and object modules There isconsiderable flexibility with regard to the actual location of the sour
51. files registration isperformed on all files specified on the command line When the source registration tool is invokedwith a directory name it registers all files with the following extensions a ada adb ads bdy dat spc sub This is stored in your newly created Ada PAL Compiler Ada C C Changer project Conflicts during Registration The following restrictions apply to source file registration e Two source files with the same simple file name exclusive of the directory path cannot be simultaneously registered e Two source files containing the same library unit cannot be simultaneously registered If either of these situations arises during source file registration the source files are said to conflict and one of the source files and its units overrides the other depending on whether the registration is explicit or automatic Explicit registration of a source file either by compiling or by the source registration tool overrides any previously registered source files with which it conflicts When a registered source file is overridden it remains in the UNIT MAP but its units are marked as Invalid Source Registration Tool Outputs The source registration tool modifies the UNIT MAP file in the current directory All source registration tool messages are written to standard MAPUS FT Porting Made Easy 194 OS PORTING AND ABSTRACTION LAB USER MANUAL Adacgen The Ada Compiler translates Ada 95 source programs into
52. finish to generate your package 118 OS PORTING AND ABSTRACTION LAB USER MANUAL e The successful library package generation is shown inFigure 84 Figure 84 Full Library Package Generation Verification Report Generator Verification I Displays the Information about different activities in Standalone Generation eate Target Directory Status 900555 Description Creation of C OSPAL_1 3 6 target directory was successful indows Cross OS Generation Status 9 555 Description Standalones Generated for Target OS Windows Successfully VxWorks Interface Generation Status 00555 Description VxWorks Interface Standalones Generated for Target OS Windows Successfully Generation Status 900555 Description demo_cross_os Successfully Generated Documents Generation Status 900655 Description Cross os Interface_reference Manual pdf Successfully Generated MAPUS FT Porting Made Easy es eh OS PORTING AND ABSTRACTION LAB USER MANUAL 2 Show the Full Library Package Created by OS PAL The full library package includes libraries with full source code to manually link into the applications Once the application is recompiled with MapuSoft s products it will run on the new OS To view the generated full library package a Open the folder created by OS PAL b Click on the folder to view the files included in the package as shown in Figure 85 which include A sample application Librar
53. folder inside C drive For Ex C pal_report Figure 118 Saving the Timing Report Save in Se Local Disk C IE Standalone generation Config Msi Adobe Suitecs3 wInpows My Recent workspace yeclipse3 3 1 1 Documents S VersalSoft ospalalphaz checkout 05Pal_1 3 6 Target MapuSoft D nucleus_legacy_code D RoboHelp D Documents and Settings MsOCache Program Files Qminew io souces jtargett My Network Save as type 4 Your Timing Report is successfully generated as an rtf file The Timing Report displays the following information 1 Timing Information The timing information gives a detailed description of the following Best Time Value Specifies the minimum time taken to perform the action on each platform API Worst Time Value Specifies the maximum time taken to perform the action on each platform API Average Time Value Specifies the average time taken to perform the action on each platform API MAPUS QFT Porting Made Easy __ 183 OS PORTING AND ABSTRACTION LAB USER MANUAL Application Information When you perform the application profiling on OS PAL the report displays the following application property values Total system memory limit Specifies the total system memory pool limit of the application Size of the system memory pool Specifies the size of the system memory pool of the application Minimum memory pool segment size Specifi
54. get started with Nucleus interface support that MapuSoft provides This guide e Explains how to use Nucleus interface port applications POSIX Interface Reference Provides detailed description of how to get started with MAPUS FT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL User Guides Description Manual POSIX interface support that MapuSoft provides This guide e Explains how to use POSIX interface port applications Windows Interface Reference Provides detailed description of how to get started with Manual Windows interface support that MapuSoft provides This guide e Explains how to use Windows interface port applications Release Notes Provides the updated release information about MapuSoft Technologies new products and features for the latest release This document e Gives detailed information of the new products e Gives detailed information of the new features added into this release and their limitations if required Supported Host Platforms OS Pal supports the following host platforms e Windows XP 7 e Linux e Solaris Available soon Supported Development APIs e Cross OS Interface e POSIX Interface e VxWorks Interface e psOS Interface e Nucleus Interface e micro ITRON Interface e Windows Interface For a list of OS PAL supported target operating systems click here http mapusoft com products offerings Getti
55. not used variables 3129 e Return with no value in function returning non void 15 e Assignment from incompatible pointer type 52 e Comparison is always false due to limited range of data type 94 e Cast from pointer to integer of different size 3 MAPUS QFT Porting Made Easy 258 OS PORTING AND ABSTRACTION LAB USER MANUAL e Comparison of distinct pointer types lacks a cast 8 e Control reaches end of non void function 71 e Implicit declaration of function 10 e Initialization from incompatible pointer type 5 e Integer constant is so large that it is unsigned 1 e Left shift count gt width type 1 e Missing braces around initializer 2 e Passing arg from incompatible pointer type 114 e Statement with no effect 28 e Unused variable 83 e This decimal constant is unsigned only in ISO C90 1 MAPUS QFT Porting Made Easy 259 OS PORTING AND ABSTRACTION LAB USER MANUAL Ada PAL Compiler Property Page Ada PAL Compiler Property Page enables you to change or modify the configuration options you have set for your project To go to the property page 1 On OS PAL Projects pane select the Ada PAL Compiler project you have created Right click on it and select Properties and shown in the Figure 156 Figure 156 Ada PAL Compiler Properties Projects New DER File Edit Re Window Help Go Into BOQ i v Open in New Window Tools FEY pat Proje i Fie C C Index Build Co
56. platform profiling Platform Profiling means Cross OS Interface APIs profiling NOTE By default Cross OS Interface API profiling is enabled for all projects Enable POSIX Interface API Profiling Specifies if POSIX Interface API Profiling feature is enabled for your project Select the check box if you need profiling for your POSIX APIs Enable micro ITRON Interface API Profiling Specifies if micro ITRON Interface API Profiling feature is enabled for your project Select the check box if you need profiling for your micro ITRON APIs Enable Windows Interface API Specifies if Windows Interface API Profiling feature is enabled Select the check box if you need profiling API Profiling for your project Profiling for your project for your Windows APIs Enable Specifies if VxWorksinterface Select the check box VxWorkslInterface API Profiling feature is enabled if you need profiling for your VxWorksInterface APIs Enable pSOSInterface API Profiling Specifies if pSOSInterface API Profiling feature is enabled for your project Select the check box if you need profiling for your pSOSInterface APIs Enable Nucleus Interface API Profiling Specifies if Nucleus Interface API Profiling feature is enabled for your project Select the check box if you need profiling for your Nucleus Interface APIs MAPUS FT Porting Made Easy 134 OS
57. propagated speh Suppress Propagating Exception Handlers Same as sleh but applies to user defined exceptions as well suppress_aggregate_temps This option has the same effect as using pragma Suppress_Aggregate_Temps The T option causes the compiler to report timing information for the compilation of each source file specified on the command line V The v option specifies verbose mode The marked Adabgen options are already added in Ada PAL Compiler and Ada C C Changer Do not add these in your additional options tab If you add these options it will break your application Options for Maintainers The following options are provided for use by maintainers of the compiler Options Description b The b option causes the message file created by the front end to be retained normally it is deleted as its contents are cryptic f The f option forces the generation of intermediate files even if the compiler finds errors ke The ke option specifies that intermediate files which are normally deleted are to be kept ki Keep the information file generated by the compiler The information file is generated by default except when the a or c option is used or if the compilation terminates without generating an object module file ne The ne option specifies that the adacgen process will not be restarted on failure If the ne option is not specified
58. required by the application Enter the maximum number of mutex control blocks NOTE Default value is 100 Maximum Semaphore Control Blocks Specifies the total number of regular binary count semaphores required by the application Enter the maximum number of semaphore control blocks NOTE Default value is 100 Maximum Event Group Control Blocks Specifies the total number of event groups required by the application Enter the maximum number of event group control blocks NOTE Default value is 100 Maximum Timer Control Blocks Specifies the total number of application timers required by the application Enter the maximum number of timer control blocks NOTE Default value is 100 Maximum Protection Control Blocks Specifies the total number of Protection Control blocks required by the application Enter the maximum number of Protection control blocks Note Default value is 100 Maximum Protection System Handles Specifies the total number of System handles required by the application Enter the maximum number of System Handles Note Default value is 100 MAPUS FT Porting Made Easy 146 OS PORTING AND ABSTRACTION LAB USER MANUAL 14 On Debug configuration tab configure the options to your specifications as shown in Figure 97 The application will be checked for API usage errors by selecting the check box next to Enable Error Checking Disabling error
59. the Project Name text box as shown in the figure 4 Enter the root task prototype next to Root Task Prototype text box as shown in the figure 5 Enter the root task stack size next to the Root Task Stack Size text box as shown in the figure The value should be in bytes MAPUS QFT Porting Made Easy 101 OS PORTING AND ABSTRACTION LAB USER MANUAL 6 Click Finish to complete the importing of legacy code into OS PAL You can see micro ITRON legacy code you have imported as shown in Figure 75 Figure 75 Importing micro ITRON Legacy Code Output PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help TY mn LOR BO N it N a 7 lt P x FEY PaL Profiler pat Projects B Resource TE cic Projects 3 Ezi cT E M demo_ada_to_c La demo_cross_os demo_nucleus La demo_posix La demo_psos a demo_uitron La demo_vxworks nucleuslegacy posixlegacy a psoslegacy DH H HHH E Console E Properties 22 G Progress IGE ea R o Property Value 9 items selected You have successfully imported micro ITRON legacy C code and a project with your given project name is created in the current workspace MAPUS QFT Porting Made Easy 102 OS PORTING AND ABSTRACTION LAB USER MANUAL Porting Windows Legacy C Code This section explains porting of Windows Legacy Applications using OS PAL Porting Plugi
60. the load module In addition the program builder implicitly invokes the compiler as needed so that all object modules are up to date with respect to any source files on which they depend In fact it is not necessary for the user to invoke the compiler directly at all the entire program building process including compilation can be handled by the program builder if desired The load module generated by the program builder is in the format created by specified linker Program Builder Processing Program builder processing is divided into two phases prelinking and linking The prelinking phase handles those Ada 95 requirements that are processed at build time and identifies the list of object modules that make up the program The linking phase invokes the target linker to combine the object modules to form a load module with all references resolved Prelinking The prelinking phase performs three functions e It determines the complete list of units needed for the main procedure e It finds or generates all object modules for the units on this list ensuring that they are up to date e It determines an acceptable elaboration order To perform these functions the prelinker uses the information files generated by the Ada compiler These files contain the names of depended upon and needed units For a description of how the information files in the program library are found Finding the information files results in implicit invocat
61. the target linker For example to pass map foo map to the target linker use Il map llfoo map Options passed via the ll switch follow the options to the linker that is generated by the Ada program builder The nc option prevents recompilation Normally the Ada compiler is invoked by the adabgen command to recompile Ada programs as needed The nl option prevents calling the linker The prelinker is called but the target linker is not no The no option prevents recompilations to recreate o files that are out of date o file The o option specifies the name of the output file used instead of the default filename ol file The ol file option passes file to the target linker q The q option specifies quiet mode F Use a more friendly elaboration order The default is to use an order that is more likely to fail but which can lead to more portable programs v The v option causes the program builder to print informational messages as processing proceeds The v option is also applied to any implicit invocations of the compiler during program building The marked options are already added in Ada PAL Compiler and Ada C C Changer Do not add these in your additional options tab If you add these options it will break your application MAPUS FT Porting Made Easy 202 OS PORTING AND ABSTRACTION LAB USER MANUAL adabgenOutputs
62. to OS PAL Project NOTE This feature requires a license Click http mapusoft com downloads ospal evaluation to request an evaluation license To add source code files 1 Select a project under C C Projects pane 2 Right click on it and select Import as shown in Figure 33 Figure 33 Adding Source Code Files PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help New Alt Shift N gt Porting gt Open File Ctrl Ctrl Shift W Refresh Convert Line Delimiters To ih Print Switch Workspace gt t Export Properties Alt Enter 1 adapal_i exe adapal_1 Debug 2 os_main c demo_cross_os source 3 os_application_start h demo_cross_ 4 demo h demo_cross_ossinclude Exit C C Indexer 14 OS PORTING AND ABSTRACTION LAB USER MANUAL 3 Select your import source and click Next as shown in Figure 34 Figure 34 Importing Files from Local File System Pal import Select Import resources from the local file system into an existing project Select an import source type Filker text gt General Archive File Po Breakpoints wi Existing Projects into Workspace 3 File Systern E Preferences gt CIC H E Team Finish MAPUS FT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL 4 Select the directory on your local f
63. to produce the complete image This image may be downloaded to the target system or placed in ROM on the target system OS Abstractor will also function under various host environments This chapter contains the following topics About OS Abstractor Interfaces Available for OS Abstractor Using OS Abstractor MAPUS FT Porting Made Easy 110 OS PORTING AND ABSTRACTION LAB USER MANUAL About OS Abstractor Developing a solid software architecture that can run on multiple operating systems requires considerable planning development and testing as well as upfront costs associated with the purchase of various OS and tools to validate your software MapuSoft s OS Abstractor is an effective and economical software abstraction alternative for your embedded programming By using OS Abstractor your embedded application can run on many real time RTOS and non real time operating systems to negate any porting issues in the future when your platform changes MAPUSQFT QS ABSTRACTOR Flow Diagram STEP ONE Choose an option STEP TWO Option One Option Two Optimized Code Generation Full Source Package Generation Continue to STEP TWO www mapusoft com 1 877 MAPUSOFT Continue to STEP TWO OS Abstractor Flow Diagram MAPUS FT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL Interfaces Available for OS Abstractor The following are the OS Abstractor products POSIX micro ITRON VxWorks psOs Nucleu
64. tool supports the following functions e Creating a new program library e Listing all or specific values for the program library options MAPUS FT Porting Made Easy 193 OS PORTING AND ABSTRACTION LAB USER MANUAL e Modifying the source directory list the library search list the object file subdirectory the information file subdirectory or the cross reference file subdirectory Listing the source file names or library unit names registered in the program library Program Library Options Tool Outputs The program library options tool modifies the ADA LIB file in the project directory Messages Messages and displays generated by adaopts are written to standard error Source Registration Tool adareg Overview The source registration tool adareg maintains the UNIT MAP file The UNIT MAP file which islocated in the project directory contains the unit to source correlation of all source files thathave been registered in the program library The source registration tool is used to register additionalsource files in the program library The source registration tool provides the following function e Explicit registration of a specified source file s Registration is performed by doing a syntax analysis of a source file to determine the name and kindof the units in the file and then adding that information to the UNIT MAP When the source registrationtool is invoked with a list of source files or directories containing source
65. toolchains only if they are supported on the platform D lt Back Finish 42 OS PORTING AND ABSTRACTION LAB USER MANUAL 5 On Basic Settings window define the basic properties of your project and click Next as shown in Figure 22 Figure 22 Basic Settings Window GS OS PAL C Project Wizard Basic Settings Basic properties of a project Application Name Application Prefix Author Name Copyright notice Application Copyright Notice Greeting Message Application Welcome Message Source Folder Name source Porting Made Easy 43 OS PORTING AND ABSTRACTION LAB USER MANUAL 6 On Select Configurations window select the platforms and configurations for deployment and click Next as shown in Figure 23 Figure 23 Configurations Window Select Configurations Select platforms and configurations you wish to deploy on Project type Executable Tool chains MinGW GCC Configurations i ws 7 5 Debug Select all 5 Release Deselect all Advanced settings J Use Advanced settings button to edit project s properties Additional configurations can be added after project creation Use Manage configurations buttons either on toolbar or on property pages MAPUS QFT Porting Made Easy 44 OS PORTING AND ABSTRACTION LAB USER MANUAL 7 On Select APIs window select the required OS PAL development APIs and click Finish as shown in Figure 24
66. 1 0 Interface C Map ANSI 10 API oO Map ANSI I O Formatting API MAPUS FT Porting Made Easy nD Fe OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on ANSI Mapping tab are as follows Cross OS Interface equivalent functions Field Description Your Action Map ANSI Specifies you want to map To map ANSI to Cross OS Interface Memory API ANSImalloc and free to equivalent functions select the check box Note By default this feature is enabled Map ANSI I O API Specifies if you want to map ANSI device I O functions like open close read write ioctl etc to Cross OS Interface equivalent functions To map ANSI I O functions to Cross OS Interface equivalent functions select the check box Note By default this feature is disabled MAP ANSI I O Formatting API Specifies if you want to map ANSIprintf and sprintf to Cross OS Interface equivalent functions To map ANSI I O formatting functions to Cross OS Interface equivalent functions select the check box Note By default this feature is disabled MAPUS FT Porting Made Easy 152 OS PORTING AND ABSTRACTION LAB USER MANUAL 17 On Device I O configuration tab configure the options to your specifications as shown in Figure 100 Figure 100 Device Input or Output Tab OS PAL Target Code Optimizer This wizard optimizes target specific source code Task
67. 5 15 PM 5 z E or Thread 1 Suspended main source __os_init_witges amp oe Thread 2 Suspended Ft it i it ft lt _os_init_windows c 28 e argc B arg 0x000343e0 nucon MEE vun WOM Chey LAUD LDS LOL This is where you should put an systems specific code on Linux When optimizing For instance if you want you could do it here before cal you will need to write a your target operating system int main int argc LPSTR argv LRTRTFRTAH ETAT AAATATATA TATA RAAT AAAAAAA AAA TT AT TT 3 v gt B Outline 53 Bake lt SI os_target h Y os_application_starl mainlint LPSTR amp E console X 4 Tasks demo_vxworks exe OS PAL Local C C Application D runtime ospal product demo_vxworks Debugidemo_vxworks exe ex Gaele wO r 7o MAPUS FT Porting Made Easy 72 OS PORTING AND ABSTRACTION LAB USER MANUAL 6 To resume debugging click the resume icon on the debugging window as shown in the Figure 49 Figure 49 Resume Debugging Using External Console Terminal Pat Debug demo_cross_os source __os_init_windows c OS Porting and Abstraction Lab BAR File Edit Refactor Navigate Search Project Run Window Help PO Hg 0 4 opi H H y E Debug pat Profiler Pat Projects Resource 5 Debug 3 E a Vari 53 e Brea U Regi Mod m oll a Re eR Pw OBEKT B ge os
68. ACTION LAB USER MANUAL 144 OS PORTING AND ABSTRACTION LAB USER MANUAL 13 On Other Resources configuration tab configure the options to your specifications as shown in Figure 96 Figure 96 Other Resources Tab Optimized Target Code Generator This wizard optimizes target specific source code P Task Process Memory Other Resources Debug Output Devices ANSI Mapping Device I O Interface Maximum Pipe Control Blocks 100 Maximum Queue Control Blocks 100 Maximum Mutex Control Blocks 100 Maximum Semaphore Control Blocks 100 Maximum Event Group Control Blocks 100 Maximum Timer Control Blocks 100 Maximum Protection Control Blocks 100 Maximum Protection System Handles 100 Porting Made Easy 145 Field OS PORTING AND ABSTRACTION LAB USER MANUAL Description The field descriptions on Other Resources tab are as follows Your Action Maximum Pipe Control Blocks Specifies the total number of pipes for message passing required by the application Enter the maximum number of pipe control blocks NOTE Default value is 100 Maximum Queue Control Blocks Specifies the total number of queues for message passing required by the application Enter the maximum number of queue control blocks NOTE Default value is 100 Maximum Mutex Control Blocks Specifies the total number of mutex semaphores
69. AL Interfaces Available for OS Changer The following are the interfaces available for OS Changer e VxWorks e Nucleus e psos e micro ITRON e POSIX e Windows Using OS Changer OS Changer is designed for use as a C library Services used inside your application software are extracted from the OS Changer and TARGET OS libraries and are then combined with the other application objects to produce the complete image This image can be loaded to the target system or placed in ROM on the target system The steps for using OS Changer are described in the following generic form e Remove the TARGET RTOS header file defines from all the TARGET RTOS source files e Remove definitions and references to all the TARGET RTOS configuration data structures in your application e Include the TARGET RTOS _interface h For example nucleus_interface h in case of Nucleus Interface and os_target h in the source files e Modify the OS Changer init code see sample provided and the TARGET RTOS root task of your application appropriately For example Application_Initialize e Compile and link your application using appropriate development tools Resolve all compiler and linker errors e Port the underlying low level drivers to Target OS e Load the complete application image to the target system and run the application e Review the processor and development system documentation for additional information including specific details o
70. AX_EVENT_GROUPS define HOST_MAX_SEMAPHORES 1 1 define HOST_USER_SHARED_REGION1_SIZE 1 OS_HOST This flag is used only in OS PAL environment It is not used in the target environment Host mode defines can be modified in os_main c file For example modify maximum tasks under host environment in HOST_MAX_TASKS NOTE You can manually change the values in the Optimized Target Code GeneratorWizard Refer to Generating Optimized Target Code chapter in the manual MAPUS FT Porting Made Easy 50 OS PORTING AND ABSTRACTION LAB USER MANUAL To create a project with multiple interfaces Creating a Project with Multiple Interfaces NOTE This feature requires a license Click http mapusoft com downloads ospal evaluation to request an evaluation license From OS PAL main window select any project under C C Projects tab on the left pane 2 Select New gt OS PAL C C Project as shown in Figure 27 Figure 27 Creating a Project with Multiple Interfaces rat Projects OS Porting and Abstraction Lab File Edit Source Refactor Navigate Search Project Run Tools Window Help He Bi2 OX BPO Mi O Q iv FE Pat Profiler pat Projects Resource Fie cic Projects 3 zo demo_ada_to_c ic demo_cross_os demo_nucleus E C demo_posix J ke demo_psos demo_uitron ic C demo_vxworks E C demo_windows TRAA P 05 PAL C Project a Import FE O5 PAL C Project r Export A Ada
71. B USER MANUAL 11 You can view the created Ada PALCompiler projectunder projectspane as shown in the Figure 150 File Edit Source Refactor Navigate Search Project Run Tools Window Help Jen SIR 2 OXR BO Mi O Q iv if h E Pat Profiler pat Projects E Resource in bdy h fe Problems J console 23 E Properties 25 Navigator Sg Progress Ex bE 4 Ely Foy gt Ada C C Changer Building project MEg TEMO Het D _ECLIPSE eclipse_helios 3 6 Tools Ada windows bin adaopts exe 1 D _ECLIPSE eclipse_helios 3 6 Tools Ada windows bin adaopts exe z lias ie acg_demo_cpp Info Creating new library for default target from D ECLIPSE eclipse iE a chg_win_cpp amp chg_win_gnat H hcom_win_gnat D _ECLIPSE eclipse_helios 3 6 Tools Ada windows bin adaopts exe 1 E hcomp_cpp D _ECLIPSE eclipse_helios 3 6 Tools Ada windows bin adaopts exe Sudoku_Test E is windows_x86_eclipse_cpp_rtl laa windows_x86_eclipse_cross_os_rtl D _ECLIPSE eclipse_helios 3 6 Tools Ada windows bin adaopts exe i iE 5 windows_x86_eclipse_gnat_rtl D _ECLIPSE eclipse_helios 3 6 Tools Ada windows bin adaopts exe iE B windows_x86_eclipse_rtl A a v MAPUS FT Porting Made Easy 250 OS PORTING AND ABSTRACTION LAB USER MANUAL The Ada PAL Compiler project has the following files e Includes This folder contains the header file paths of your project e Ada2C
72. Build project as shown in Figure 134 Figure 134 Build Project Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help 4m in DOR PS BA O Q 8 FEY Pat Profiler Debug pat Projects Fa cicr Projects 3 aag ees J demo_ada_to_c E E demo_cross_os fe demo_nucleus F demo_posix i E def hew gt OM de s de Go Into a i uh Open in New Window Tools gt Index gt Build Configurations gt Make targets gt Build Project Clean Project 25 Copy 6 Pa 3 Delete Move Rename gy Import t Export a Refresh 6 Properties E console 8 Close Project Ada C C Changer KUA C7 CTTCMAaAnIgeo SG COmpPI R nAs gt Copyright C 1994 2 gt C ECLIPS 1 1 Tools Ada Nahin fe MAPUS QFT Porting Made Easy 227 OS PORTING AND ABSTRACTION LAB USER MANUAL 2 A pop up window is displayed asking if you want to do a Full Build or just a C C Build as shown in Figure 135 Full Build includes Ada Build which will incrementally compile the Ada files that have been modified or added since the last build and C C build Click Cancel for doing a C C build Figure 135 Ada C C Changer Build MB Ada C C Changer Build Do you want full build for just C C build Press Continue For full build Press Cancel For just C C build 3 If you click Continue another pop up window is displayed Click OK to compl
73. C This folder contains all the files generated by Ada tools Ada PAL Proj1 This folder contains the Ada PAL Compiler project related files e Include This folder contains the Ada header files info This folder contains information file subdirectory of the program library directory where information files for the object modules are placed source This folder contains the converted C source files init If OS Abstractor is integrated then you get a folder which contains the OSPAL template files NOTE For more information on the Template files refer to OS PAL Template Files section in this manual xref This folder contains the cross referenced files which are generated by the Ada tools e adaRoot This folder contains the Ada sources added during your project creation In case you add any additional sources you can view this in the Project gt Property page gt Ada Source tab of the respective project e ADA LIB This contains information describing the configuration of the Ada library e UNIT MAP This contains a unit to source mapping for use by the compiler and program builder e options This contains the list of options with which Ada PAL Compiler project or executable is created This is a hidden file You can view this in Navigator view To view select Window gt Show View gt Other gt General gt Navigator NOTE Host Libraries and include paths are automatically added during project creation For viewing this informat
74. C Changer Note This can be created using space as delimiter To specify an option file select the check box and click Browse and select the option file Note If option file is specified then Ada configuration options page will open with the specified options in the option file If not specified then Ada Configuration options page opens with the default options User can select or over ride the options in this page NOTE If you create your Eclipse Workspace in a deeply nested subdirectory you will get an error while creating a project MAPUS FT Porting Made Easy 208 OS PORTING AND ABSTRACTION LAB USER MANUAL ADA C C Changer Configuration Options On the Ada C C Changer Configuration Options page you can set the following configurations e Ada Source e C C Output e Ada Listings e Ada Messages e Ada Drivers e Additional NOTE 1 You can change the configuration options on the Ada C C Changer Property Page To go to the Ada C C Changer Property Page right click on the project and select Properties Ada C C Changer Options Configurations File Ada C C Changer options are configurable via an Option s file a b Once you have an Ada C C Changer project and you want to use the same options that you have used Browse to the workspace directory location and into your project_name directory You will find a file called options file and you can save that file in a diff
75. C environment variable and uses dir path instead xL exe path The xL option overrides the default lister and uses exe path instead bw This displays all warning messages generated by the Ada compiler back end e g by GCC The marked options are already added in Ada PAL Compiler and Ada C C Changer Do not add these in your additional options tab If you add these options it will break your application Compiler Outputs Compiler Output Files Files produced by compilations are Output Files Description file info Information recorded during compilation of a source file which is used by the program builder to determine if the object module is valid file o or file obj Relocatable object module files one for each source file in the compilation These output files are placed according to the program library parameters Also produced are various intermediate files these are usually deleted as a matter of course unless the ke option is specified Additional files that may be produced by a compilation are Output Files Description file lst Source listing if any of the lp lc or lr options are specified file xlst Cross reference listing if the lx option is specified file xref Cross reference information in a binary format This is for use by a browser and the cross reference lister MAPUS FT Porting Made Easy 199 OS PORTING AND ABS
76. D ABSTRACTION LAB USER MANUAL 7 Click Finish to complete the importing of legacy code into OS PAL You can see the output as shown in Figure 69 Figure 69 Importing Nucleus Code Output PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help wk im 2 OR BPO M O Q iv FI pat Profiler PAL Projects S Resource Fe cic Projects 83 So ee E w demo_ada_to_c demo_cross_os demo_nucleus demo_posix demo_psos demo_uitron demo_yvxworks E7 es i E Console E Properties 83 e Progress z panco Property Yalue posixlegacy i simple_yxworks_app 9 items selected You have successfully imported Nucleus legacy C code and a project with your given project name is created in the current workspace MAPUS QFT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL Porting pSOS Legacy C Code This section describes the sample porting of pSOS Legacy Applications using OS PAL Porting Plugin A description for porting pSOS Legacy applications using OSPAL is described with an example here NOTE This feature requires a license Click http mapusoft com downloads ospal evaluation to request an evaluation license 1 Select File gt Porting gt pSOS gt Import Legacy C Code as shown inFigure 70 You can also click on the Porting icon from the task bar Figure 70 Importing pSOSLegacy C Co
77. Generator 262 Reyiston HiSt ry occ ieeceece heated cg tea eset eds aceasta aad eect EEA 264 MAPUS QFT Porting Made Easy 4 OS PORTING AND ABSTRACTION LAB USER MANUAL Chapter 1 Introduction to OS PAL This chapter contains the following topics About OS PAL Installing OS PAL Uninstalling OS PAL List of Technical Documentation Getting a License for OS PAL Supported Host Platforms MAPUS FT Porting Made Easy amaaa OS PORTING AND ABSTRACTION LAB USER MANUAL About OS PAL OS PAL is an Eclipse based IDE It integrates OS Changer and OS Abstractor with Eclipse s CDT to offer an IDE for developing and porting applications on host platforms OS PAL features include Creation of C and C OS PAL projects Automatic configuration of any OS Changer and OS Abstractor APIs needed by the application Custom configuration of OS resources needed by the application Custom configuration of OS Abstractor Resources Custom configuration of OS Abstractor for single or multi application development Process Feature support Create Ada Projects Host simulation Full Source Library Package generation Convert Ada source code to C C code Compile Ada code to an executable Do Platform and Application profiling OS PAL uses OS Abstractor and OS Changer technology to produce optimized target code Up to 9 target configuration tabs to optimize the target code specific for your application Generated target cod
78. If the project name is the same name as an already existing project then it is considered that the user wants to Ada Build the project Enter a name to the project you want to create Note 1 The project name should not be more than 256 characters Note 2 Please avoid creating an eclipse workspace in a deeply nested sub directory Main Ada procedure Specifies the main procedure name of the project the user imports that is converted to the main C function that will be started as thread in Cross OS or other interfaces Select the check box to enter the main Ada procedure name For example Sudoku_Test Note To import a library project use the all option for themain procedure Enter Ada File Extensions used in your Ada Project Specifies the source files that have extensions other than the default extensions listed in the drop down list The default extensions listed here are a ada adb ads bdy dat spc sub You can do any one of the following e To add a new extension other than the default ones enter in the text box and click Add Note By default this is enabled e To remove an extension select the extension from the drop down list and click Remove Note1 Default extensions already available cannot be removed Note 2 Ada Extensions are case sensitive Specify Option File Specifies if the user wants to specify any set of options that are needed for the Ada C
79. Import Legacy Code Into OS PAL Root Directory D legacy posix Project Name posix_legacy Root Task Prototype int px_maintint argc char argv f 7 Root Task Stack Sizefin bytes O5_MIN_STACK_SIZE 3 Enter the project name for which you want to import the legacy code in the Project Name text box 4 Enter the root task prototype next to Root Task Prototype text box 5 Enter the root task stack size next to the Root Task Stack Size text box The value should be in bytes MAPUSS FT Porting Made Easy 90 OS PORTING AND ABSTRACTION LAB USER MANUAL 6 Click Finish to complete the importing of legacy code into OS PAL You can see POSIX legacy code you have imported as shown in Figure 65 Figure 65 Importing POSIX Legacy Code Output PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help LOX BPO M amp O a i a id fr FEY Pat Profiler Pa Projects Resource A cic Projects 3 Hm JEE W demo_ada_to_c demo_cross_os demo_nucleus demo_posix demo_psos demo_uitron demo_vxworks E Includes E H E include E E console Property E Properties 3 J Progress BE scm Value 11 items selected You have successfully imported the POSIX legacy C code and a project with your given project name is created in the current workspace MAPUS QFT Porting Mad
80. K If you are comparing the same two files for the second time click Cancel as shown in Figure 120 Figure 120 ImportPAL File Import PAL File Select the directory containing your PAL file Select PAL File C profier_datalprofler_data 1259150629 pal Pat Fresh Categorization Categorized Data Already Available For File Named profiler_data_1259149626 Do You Want To Categorize Again Cancel Finish Cancel MAPUS QFT Porting Made Easy 186 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions for importing the PAL file are described as follows Field Description Your Action Select PAL Specifies you to To select the PAL file click File select the PAL file Browse and select it from for which the your system Timing Comparison Report has to be generated Report for Specifies what you You can do any one of the are comparing following and click Next e To compare only the differences select the radio button before Differential Data Note By default this feature is disabled e To compare all the data in the PAL files select the radio button before All Data Note By default this feature is disabled Figure 121 Selecting the APIs Comparison Report Generate Timing Comparison Report Current PAL File FEO profiler data 1259149626 CI System av Functions v Platform APIs 0S_Create_Task OS_Aquire_Protection OS_Get_Current_lask_id OS
81. MAPUS QFT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL Release 1 3 8 Copyright c 2010 MapuSoft Technologies 1301 Azalea Road Mobile AL 36693 www mapusoft com OS PORTING AND ABSTRACTION LAB USER MANUAL Table of Contents CHAPTER 1 INTRODUCTION TO OS PAL ccecsceccecscccceccees 5 About OS PAT by sceta diae ia a aaah anaia iae eieae 6 Installing OS PAL renneri aniria neia EEEE EEE REEERE AEREE ESAE 7 Uninstalling OS PALi arretea otas na A AAAA EEEE ANS 7 List of Technical Documentation sseeeseseeseesrseseeereserserreestesresrresersesrresressrseresrensesee 8 Supported Host Platloris scsccscscissesestasieetadesavenedsussdoeavenwaadd iaei iiair 9 Gre ins a Lic ns for OS PA essere ceiiiec neiii ina ia 9 T stalling License for OS PA Luorsiiniionnnnin i nien i ance uceaetd 10 Updatins OS PAD erre eea os e S E EEEn E AEAEE NE E EET 12 Getting Updat s for OS PAL asescar isisa iiaea i a esnada asi 12 Updating Software Using Remote Update Site eeeeeeeneeceseeeceeeeeeseeeeesseeeesaes 13 Updating Software Using Local Update Site ccicccsssccssssccsessscsssasconasstesseccseascesseees 20 CHAPTER 2 OS PAL COMPONENTS cccscccccecscccccccccsceccecs 28 Introduction to OS PAL Components cccccesccscssscecsecceessececsscceessccesssceeesseeesseeeens 29 OS PAL Architecture c23desscascocedecebgeeetereaacepssublc EE EIEEE EEEE ER 31 OS Simulator with Host Development
82. Make sure the OS Abstractor libraries are re compiled and newly built whenever configuration changes are made to the cross_os_usr h when you build your application In order to re build the library you would actually require the full source code product version not the evaluation version of OS Abstractor Applications can use a different output device as standard output by modifying the appropriate functions defines in os_target_usrh along with modifying os_setup_serial_port cmodule if they choose to use the format Input Output calls provided by the OS Abstractor You can add some application code or target specific things such as memory allocations such as Heap Size and Shared memory which are specific to target environments Target OS Selection Based on the OS you want the application to be built set the following pre processor definition in your project setting or make files Flag and Purpose Available Options OS_TARGET The value of the OS_TARGET should be for the Cross OS To select the target Interface product that you have purchased For Example if operating system you have purchased the license for OS_NUCLEUS Nucleus PLUS from ATI OS_THREADX ThreadX from Express Logic OS_VXWORKS VxWorks from Wind River Systems OS_ECOS eCOS standards from Red Hat OS_MQX Precise MQX from ARC International OS_UITRON micro ITRON standard based OS OS_LINUX Open source commercial Linux distributions OS_WINDOWS
83. Maximum File Path Length 1 Maximum File Path Length Specifies the maximum length of the directory path name including the file name for Cross OS Interface use excluding the null char termination Enter the maximum length of the file path Note Default value is 255 This setting does not impact the OS setting for the max path file name Internally Used System Name Path Specifies the temporary directory of the file path Enter the temporary directory of the file path Note Default value is tmp Internal Name Padding Specifies the padding for the internal name Enter the padding for the internal name Note Default value is 20 MAPUS FT Porting Made Easy 154 OS PORTING AND ABSTRACTION LAB USER MANUAL 18 If your project uses pSOSInterface in Interface configuration tab assign the number of unsigned arrays used to store the task s data as shown in Generator Verification Displays the Information about different activities in Target Code Generation License Check Status SUCCESS Description License file contains a valid license for Windows XP Generate Cross OS Interface Status SUCCESS Description Generation For Cross OS Interface successful Generate Project Files Status SUCCESS Description Generation of Project Files successful Ada Projects Status WARNING Description 1 IF this is Ada Compiler Projects Code Optimization would not wo
84. N Interface Demo Application The demo application is located at the mapusoft demo_uitrondirectory location From this location you will find the make files or project files at the appropriate specific lt OS gt lt tools gt lt target gt directory For instance if you need the demo application to be built for micro ITRON OS using Eclipse tools and for x86 target then the make file location will be at specific uitron lt OS gt x86 eclipse directory Windows Interface The Windows Interface library contains the following modules Module Description windows_interface h This header file is required in all of the Windows source modules This header file provides the translation layer between the Windows defines APIs and parameters to OS Abstraction The Windows Interface demo contains the following modules Module Description demo c Contains a sample demo application Building WindowsInterface Before building the WINDOWS Interface library and or application ensure that the flags INCLUDE_OS_WINDOWS and INCLUDE_OS_PROCESS are set to OS_TRUE in the cross_os_usr h configuration file Building WindowsInterface Library The WINDOWS Interface library is located at mapusoft windows_interface directory From this location you will find the make files or project files at the appropriate specific lt OS gt lt tool gt lt target gt directory For instance if you need the demo application to be built for WINDOW
85. ON LAB USER MANUAL For more information on this refer to the OS Abstractor For Developing Portable Software Chapter on page 116 Full Library Package Generator With OS Porting and Abstraction Lab OS PAL you can easily generate a source code package to create libraries and develop application using your own IDE You can manually scale and configure the product by modifying the user configuration file OS PAL provides users an easy to use graphical user interface that is integrated with the Eclipse based CDT environment Target operating systems supported can be found here http mapusoft com products Full Source Library Package Generator chapter includes the following topics e Generating Full Library Packages e How to Use Libraries With Your Application For more information on full source library package generator refer to Full Library Package Generator chapter on page 120 Optimized Target Code Generator With OS Porting and Abstraction Lab OS PAL you can easily port abstract and optimize your code on a host machine and run the application on different target platforms OS PAL leverages the existing OS Changer and OS Abstractor technologies while adding advanced code optimization capacities on multiple OS environments OS PAL provides users an easy to use graphical user interface that is integrated with the Eclipse based CDT environment Target operating systems supported can be found here http mapusoft com product
86. PAL Supplied GDB 12 1 09 5 58 PM 5u Name Yalue i gf Thread 1 Suspended 6 argc 1 E argy 0x00034390 IEA e Roni Thread 2 Suspended ce ie __os_init_windows c 23 A BE outline 32 ft systems This is where you should put any of 13 R xs ev i Specific code For instance if you wanted to on Linux you could do it here before calling it When optimizing you will need to write an equ ft your target operating system ft LER ETTAA TATE ATE EAE ATE E ATA EATER EAA ETAT TET ETT QI os_target h 3 os_application_start maintint LPSTR ir int main int argc LPSTR argv t lt 4 E console Gi Tasks Ei Problems O Memory A m demo_cross_os exe OS PAL Local C C Application C OSPAL_1 3 6 mingw bin adb exe 12 1 09 5 58 PM exe ail REEE A B ri MAPUS FT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL 7 You have now successfully finished debugging by using external console or terminal as shown in Figure 50 File Edit Refactor Navigate Search Project Run Window Help im HS G i w O Q i O eith E Debug PAL Profiler PAL Projects PS Resource hi E ES Debug amp 0 69 vari Eo aE f k p Thread 1 Running p Thread 2 Running pal C OSPAL_1 3 6 mingwibin gdb exe 12 1 0 wl c AosPaL La siworksoaceldemo cross os it f ft f it A os init
87. PORTING AND ABSTRACTION LAB USER MANUAL 7 On Application Functions Profiling tab you can also perform profiling for your specific APIs as shown in Figure 91 Figure 91 Application Function Profiling OS PAL Target Code Optimizer ER This wizard optimizes target specific source code 77 gt Profiler Configuration Platform API Profiling Application Functions Profiling Enter Application Function e g Function_1 or Function_1 Remove MAPUS QFT Porting Made Easy ee I OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on Application Functions Profiling tab are as follows Field Description Your Action Enable Application Functions Profiling Specifies if the Application Functions Profiling feature is enabled or disabled Select the check box to enable Application Functions profiling This profiling is used for User APIs profiling Enter Application Function Specifies the name of the Enter the name of the Specifies if you want to remove any _ application functions from the list Application Function for application function profiling NOTE This field is case sensitive Add Specifies if you want to add T add any application any application functions function enter the name in the text box and click Add Remove To remove any application function from the list select the na
88. Pagination Continuous source listing Paginated source listing Cl Listing only of lines with errors or warnings Cross reference listing No cross reference listing Produce cross reference listing _ Additional Restore Defaults Apply For more information about the Ada Configuration Options refer to ADA C C Changer Configuration Options section When you do an Ada Build you can re import files or import deleted files remove any files or change the Main procedure name on this page You can modify on any of the configurations on the property page NOTE You cannot edit or modify the AdaRoot Directory location MAPUS QFT Porting Made Easy 261 OS PORTING AND ABSTRACTION LAB USER MANUAL Target Code Generation On Ada PAL Compiler Project For Ada PAL Compiler Projects Cross OS interfaces are added directly to the project as targets sources if the user has a valid and relevant Standalone Package Generator license If Target Code Generation is attempted on these projects all the Cross OS functionality being part of application is again redefined in cross_os c This will give re definition errors on compile time Hence Ada PAL Compiler projects cannot be code optimized Manual Modifications to Projects files generated by Target Code Generator The target code output produced when optimizing Ada projects via the target code optimization process is a little different than that of the standar
89. Process Memory Other Resources Debug Output Devices ANSI Mapping Device I O Interface Maximum Number of Device Drivers 20 Maximum Number of Files 30 Maximum File Name Length EMAXPATH 1 Maximum File Path Length 255 Internally Used System Name Path tmp Internal Name Padding 20 MAPUS QFT Porting Made Easy ee be OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on Device I O tab are as follows Device Drivers Interface driver table structure Note This excludes the native drivers the system since they do not use the Cross OS Interface driver table structure Field Description Your Action Maximum Specifies the maximum number of Enter the maximum Number of drivers allowed in the Cross OS number of device drivers Note Default value is 20 Maximum Number of Files Specifies the maximum number of files that can be opened simultaneously using the Cross OS Interface file control block structure Note One control block is used when theCross OS Interface driver is opened These settings do not impact the OS setting for max number of files Enter the maximum number of files that can be opened simultaneously Note Default value is 30 Maximum File Name Length Specifies the maximum length of the file name Enter the maximum number of files that can be opened simultaneously Note Default value is
90. Projects Generate Report i Generate Comparison Report PA Profiler Data Explorer 3 Platform APIs O _Create_Event_Group OS_Get_Current_Task_kd os_Protect Cae OS_Create_Task OS_Set_task_Priority 2900000 0S_Get_tvent_Group_Md wn os_Get_tvents OS_Create_Semaphore os_Sleep_task OS_Take_Semaphore OS_Get_Semaphore_Count OS_Give_Semaphore OS_Delete_Semaphore os_set_tvents 0S_Delete_task 0S_create_Partition_Pool 0s_Aallocate_Partition 0s_Deatlocate_Partition 0s_belete_Partition_Pool Si OS_Create_Queve OS_Suspend_Iask os_Resume_task Property Value OS_Get_Queve_Kd Average execution time 0 000 179 651 Nano Seconds oS_Get_task_id Instance with the longest exe 82 Task_2 Instance with the shortest ex 31 Task_3 s ut NR O O oa oa O amp O Time Nano Second a TT 164 825 Ry 000 269 587 53 384 7 834 6 939 N 04 482 x Task_2 Task_3 Task_3 Task_3 4 6 8 g E Properties 53 gt OS_Receive_From_Queve _os Send To Queue ba ji S MAPUS QFT Porting Made Easy i 185 OS PORTING AND ABSTRACTION LAB USER MANUAL 3 AnImport PAL file window is displayed Select the PAL fileby clicking on the Browse button or entering the second PAL file path in the text box A Profiler Categorization Dialog box is displayed NOTE If you comparing the two PAL files for the first time click O
91. S OS using Eclipse tools and for x86 target then the make file location will be at specific windows lt OS gt x86 eclipse directory Building WindowsInterface Demo Application The demo application is located at the mapusoft demo_windows directory location From this location you will find the make files or project files at the appropriate specific lt OS gt lt tools gt lt target gt directory For instance if you need the demo application to be built for Windows OS using Eclipse tools and for x86 target then the make file location will be at specific windows lt OS gt x86 eclipse directory We need to have the Cross OS Interface Library It has to be included in all the Interface demos Building Application with Multiple Interface Components MapuSoft provides a feature to build application with multiple interfaces For example you can build an application with both Nucleus and VxWorks interfaces MAPUS QFT Porting Made Easy 165 OS PORTING AND ABSTRACTION LAB USER MANUAL Building Application with Multiple Interfaces Before building the multiple Interface library and or application ensure that the corresponding flags are set to OS_TRUE in the cross_os_usr h configuration file For instance If you want to build an application with both Nucleus and VxWorks interfaces set INCLUDE OS NUCLEUS and INCLUDE OS VXWORKS as OS_TRUE Developing Applications with Multiple Interfaces The steps for developing applicatio
92. Show message on each line it applies MAPUS QFT Porting Made Easy 243 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on Ada Messages tab are as follows number of error messages the count of error messages Field Description Your Action Error Specifies if you want you can do any one of the following Messages to generate error Hie e To select error messages select ssages the check box Note By default this is enabled e To show errors in with ed files select the check box Limit on Specifies the limit on Enter a value to specify the limit on number of error messages Note By default the value is 999 Warning Messages Specifies if you want to select warning messages You can do any one of the following To select warning messages select the check box Note By default this is enabled To show warnings in with ed files select the check box Info Messages Specifies if you want to select the info messages You can do any one of the following To select info messages select the check box To show infos in with ed files select the check box Note By default this option is disabled Message Format Specifies the format of the message You can do any one of the following To show given error message only once select the radio button Note By default this is enabled To show message on
93. Simulators e VxWorks e psos e Nucleus e POSIX e ulITRON e Windows Host Development Environment Host development needs a proper environment to run and build embedded programs To develop an environment you need the following GNU tools e Eclipse IDE e MinGW e GNU Compiler e PAL Debugger Eclipse An IDE is a powerful set of tools in the OS Porting and Abstraction Lab PAL development suite The IDE is based on the Eclipse Platform developed by Eclipse org an open consortium of tools vendors The IDE incorporates into the Eclipse framework several OS PAL specific plugins designed for building projects for target systems running on HOST The tools suite provides a single consistent integrated environment regardless of the host platform you are using Windows Linux Solaris Plugins from most vendors should work within the Eclipse framework in the same way NOTE For more information on Eclipse and working on Eclipse framework refer to http www eclipse org documentation MinGW MinGW a contraction of Minimalist GNU for Windows is a port of the GNU Compiler Collection GCC and GNU Binutils for use in the development of native Microsoft Windows applications Offered in easily installed binary package format for native deployment on MS Windows or user built from source for cross hosted use on UNIX or GNU Linux the suite exploits Microsoft s standard system DLLs to provide the C Runtime and Windows API It
94. Supplied GDB to execute debugging NOTE OS PAL does not support Cygwin tools and its use is not recommended Figure 47 Debug Configuration Window Create manage and run configurations Name demo_vxworks exe type fiter text E C C Attach to Local Application E C C Local Application Debugger fos PAL Supplied GDB C C Postmortem debugger E Java Applet M Stop on startup at main D Java Application Ju JUnit Debugger Options GG os PAL Local C C Application Main Shared Libraries GJ demo_vxworks exe i i ge ea Remote Java Application GDB command file gdbinit Warning Some commands in this file may interfere with the startup operation of the debugger for example run Protocol Default Filter matched 9 of 9 items 4 You can change any of the options here and click Apply MAPUS QFT Porting Made Easy 71 OS PORTING AND ABSTRACTION LAB USER MANUAL 5 Click Debug to execute debugging using the external console or Terminal You can view the debugging process in your console as shown in Figure 48 Figure 48 Debugging Output Using External Console Terminal File Edit Refactor Navigate Search Project Run Window Help aF EI Pa Profiler Hs Debug PA Projects i e O av it 5 Debug 83 om m 2 amp 3 Fi 00 var 23 e Bre vv Name Ex s Se OS PAL Supplied GDB 1 6 10
95. TRACTION LAB USER MANUAL Compile Time Messages All compiler messages are written to OSPAL Console View When error messages are printed processing does not proceed beyond the front end No intermediate files or object code files are produced Warning and other informational messages do not prevent further processing The back end i e C compiler may print error messages as well however these will be error messages related to problems internal to the compiler itself The option m a can be used to suppress all warning and informational messages generated by the compiler If there is an internal error in the compiler the options v and or t and or mr a can be used to help determine what part of the compiler contains the error this might help you work around the problem The compiler may implicitly perform semantic analysis of other source files in the program library or in a linked library during an invocation in order to handle semantic dependencies on other compilation units Compile time messages generated during implicit processing are displayed only if the mr option is used Otherwise compile time messages are written only for processing of the source file s specified in the adacgen command adabgen The Ada program builder provides the facilities for creating a load module for an Ada program It finds the object modules needed to build the executable determines the elaboration order and invokes the target linker to generate
96. Update Site 1 of 1 selected Show the latest version of a feature only C Filter features included in other features on the list Cancel MAPUS QFT Porting Made Easy 16 OS PORTING AND ABSTRACTION LAB USER MANUAL 5 On Feature License window select the radio button next to I accept the terms in the license agreements and click Next as shown in Figure 7 Figure 7 Remote Update Host Target Feature License Install Feature License Some of the features have license agreements that you need to accept before proceeding with the installation OS PAL Core Feature 1 3 5 1 license aq I do not accept the terms in the license agreement MAPUS QFT Porting Made Easy 17 OS PORTING AND ABSTRACTION LAB USER MANUAL 6 On Installation window you can view the features that are going to be installed and the Installation Directory as shown in Figure 8 NOTE You can change the Installation Directory if you want to by clicking Change location and click Finish Figure 8 Remote Update Installation Window PAL Install Installation The Following features will be installed You can select a feature and change the location where the feature will be installed Features to install Feature Name Feature Version Feature Size Installation Directory WkOS PAL Core Feature 1 3 5 1 Unknown iC OSPAL Install Location C OSPAL Change Location Required spac
97. XA w w w aa ie EA ae ma E PA profiler_data_1210343810 D System lt Functions Platform APIs a O Application Functions OSA_TEST_0S_Create_Partition OSA_TES1_05_Allocate_Partitior OSA_TEST_0S_Deallocate_Partii J OS A_TEST_OS_Delete_Partition_ Threads 828 444 3 ja Inn a 1 Task_3 Instances of OSA_TEST_OS Create_ Partition_Pool Function X axis shows Api Iteration Thread Name Time Nano Seconds E Properties 3 Property Value Average execution time 21 828 444 397 Nano Seconds Instance with the longest exe 1 Task_3 Instance with the shortest ex 1 Task_3 MAPUS QFT Porting Made Easy 177 OS PORTING AND ABSTRACTION LAB USER MANUAL Threads Threads are created to execute any function in an application INOS PAL Profiler you can view the Thread properties by expanding the Thread tab as shown in Figure 113 On the bottom of the window the thread properties are displayed as shown in Figure 113 such as e Average Function execution time e Instance with the longest total execution time e Instance with the shortest total execution time e Number of Functions used by this thread e Thread ID Figure 113 OS PAL Profiler Threads Profiler 0S Porting and Abstraction Lab File Edit Navigate Search Project Run Tools Window Help Pca om DRM ai vie Fy PAL Profiler F Debug PAL Projects PAL Profiler Gata Explorer X 7
98. _Initialize q_vcreate q_create sm_create tm_evevery t_create Need for Code Optimization Macro function is used to eliminate the time overhead when a function is called It is typically used for functions that execute frequently It also has a space benefit for very small functions and is an enabling transformation for other optimizations Without macro functions however the compiler decides which functions to inline The programmer has little or no control over which functions are macro functions and which are not Giving this degree of control to the programmer allows her him to use application specific knowledge in choosing which functions to macro MAPUS QFT Porting Made Easy 137 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on API Optimization tab are as follows Field Description Your Action Generate Full Specifies if you want to Select the radio button to API Library generate full API library generate full library package Interface package Note If you select this option Note You can do this if you the rest of the fields on this have a valid license for window are disabled standalone generation Generate Specifies if you want to Select the radio button to Optimized API generate optimized API generate optimized API Interface Files interface files interface files Note If the application Note By default this option is includes OS PAL based enabled application librari
99. _Release_Protection OS_Create_Semaphore OS_Create_Pipe Pal nce a ae v 4 Select the APIs you want to generate the Timing Comparison Report for and click Finish MAPUSS FT Porting Made Easy 187 OS PORTING AND ABSTRACTION LAB USER MANUAL 5 A Save As window is displayed Select the directory where you want to save the report and enter a file name for the report and click Save as shown in Figure 122 Figure 122 Saving Timing Comparison Report Save in profiler_data Z My Recent Documents L Desktop My Documents File name timing comparison report My Network Save as type ttt Your Timing Comparison Report is successfully generated as an rtf file MAPUS QFT Porting Made Easy a a ns 88 OS PORTING AND ABSTRACTION LAB USER MANUAL Chapter 9 Introduction to Ada Tool Ada Tool in OS PAL Note This feature requires a license Click http mapusoft com downloads ospal evaluationto request an evaluation license Ada tool integrated in OSPAL tool includes a compiler and a conversion tool They are as follows e Ada PAL Compiler Ada PAL Compiler functions within OS PAL to compile Ada code The tool can also be integrated with various C C cross compilers to generate binaries for a wide variety of target platforms This converts Ada sources in root directory to object or binary executables e Ada to C C Changer Ada C C Ch
100. _os i k demo_nucleus demo_posix demo_psos demo_uitron E k demo_vxworks demo_windows idemo_ada_to_c MAPUS QFT Porting Made Easy 78 OS PORTING AND ABSTRACTION LAB USER MANUAL 3 On OS PAL Import window select a workspace directory to search for existing workbench projects by clicking on Browse button next to the text box and click Next as shown inFigure 54 Figure 54 OS PAL Import Window Pat Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help T EO amp AOR DDO N li A a 7 c gt r Fy pat Profiler PAL Projects Import Wind River Workbench Projects Select a Workspace to Search for existing Workbench Projects Select Workspace Directory D workbench_vxworks_app Finish location C MapuSoft OSPAL workspace sample name carnle sample 79 OS PORTING AND ABSTRACTION LAB USER MANUAL 4 In Import Wind River Workbench Projects window the projects list is displayed in a checkbox Tree Application projects and Library projects are separated into respective categories 5 Select or deselect any one or all of the projects by selecting the check box next to the project name and click Finish to import the project as shown inFigure 55 Figure 55 Selecting Application Window Refactor Navigate Search Project Run Tools m 2OX B O Te FEY Pat Profiler PAL Projects Import
101. _windows c 3 systems This is where you should put any of Al Specific code For instance if you wanted to J on Linux you could do it here before calling When optimizing you will need to write an equ your target operating system LPTTKKTKA TEA TATE ATTRA TATA TAA TAA TAA T ATTA ATTA ATT TTT Te int main int argc LPSTR argv A BE outline 3 Be QI oos_target h Sl os_application_start maingint LPSTR ir eA IL console 3 Zi tasks Zi Problems J Memory a x Ee SGE m ae d demo_cross_os exe OS PAL Local C C Application C OSPAL_1 3 6 workspace demo_cross_os Debug demo_cross_os exe 12 1 MAPUS FT Porting Made Easy 74 OS PORTING AND ABSTRACTION LAB USER MANUAL Inserting Application Code to Run only on Host Environment The below defines are the system settings used by the OS_Application_Init function Use these to modify the settings when running on the host A value of 1 for any of these will use the default values located in cross_os_usr h When you optimize for the target side code the wizard will create a custom cross_os_usr h using the settings you specify at that time so these defines will no longer be necessary You can add some application code or debug statements like printf assert which is mostly used in host environment only This line of code will be ignored by the compiler in target environment OS HOST Selection The flag has to b
102. al Command window Go to the respective folder location by cd OS PAL root directory Tools Ada linux bin Once you are in bin folder run the command like lt chmod 777 gt Now observe files changes color from black to green To create Ada PAL Compiler project 1 From OS PAL main menu select File gt New gt Ada PAL CompilerProjectas shown in Figure 141 oron the projects pane right click and select Ada PAL Compiler Project Figure 141 Creating Ada PAL Compiler Project PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help SENEN C OS PAL C Project Porting gt E 05 PAL C Project sided 4 OSPAL Ada Project Py Project 63 Source Folder C Folder Gt Source File K Header File File more Class Refresh Pj Other Convert Line Delimiters To Switch Workspace Pre 23 Cr Bre errors 0 warnings 0 infos gy Import t Export Description 1 os_main c demo_cross_os source 2 os_application_start h demo_cross_ 3 demo h demo_cross_osjinclude 4 __os_init_windows_host c demo_uitr Exit MAPUS QFT Porting Made Easy 236 OS PORTING AND ABSTRACTION LAB USER MANUAL 2 On Ada PAL Compiler wizard select the importing directory which consists of Ada sources that needs to be converted to C Sources called as the Ada Program Library by clicking on Browse button next to the text box as shown in Figure 142 Fi
103. alues of some variables Some debuggers have the ability to modify the state of the program while it is running rather than merely to observe it It may also be possible to continue execution at a different location in the program The GNU Debugger usually called just GDB and named gdb as an executable file is the standard debugger for the GNU software system It is a portable debugger that runs on many Unix like systems and works for many programming languages While working on OS PAL you must use MapuSoft s GNU Debugger called as OS PAL Supplied GDB MAPUS FT Porting Made Easy 40 OS PORTING AND ABSTRACTION LAB USER MANUAL Creating an OS PAL C C Project NOTE This feature requires a license Click http mapusoft com downloads ospal evaluation to request an evaluation license NOTE 1 In New C projects creation the flag OS_CPU_64BIT will be set to OS_FALSE by default and user needs to make this true if they run on a 64 bit OS NOTE 2 For creating new project OS_HOST flag is set to OS_TRUE NOTE 3 When you are working on 64bit architecture make sure that m32 flag is added to both the compiler and linker options in project properties to avoid compilation errors To create an OS PAL C C project 1 From OS PAL main window select any project under C C Projects tab on the left pane 2 Select New gt OS PAL C C Project as shown in Figure 20 Figure 20 Creating an OS PAL C Project Pat Projec
104. anger allows developers to easily convert software written in Ada code to C C utilizing OS PAL The resultant C C software can be integrated with the robust OS Abstractor environment to support a wide variety of host and target OS platforms The automatic conversion process eliminates the need for costly and tedious code rewrites providing extensive resource savings Ada C C Changer generates ANSI C output as well as certain C features while preserving Ada code s comments files structures and variable names to ease ongoing code maintenance MAPUS FT Porting Made Easy 189 OS PORTING AND ABSTRACTION LAB USER MANUAL Using the Ada Root Directory The Ada root directory contains all information needed to support the separate compilation requirements of Ada The primary contents of the root directory are Ada source files all object modules and info files created by the compiler are stored in the OSPAL Projects Since no intermediate compilation form is saved the Ada compiler performs a semantic analysis of the appropriate source files as necessary to handle any separate compilation requirements This source based program library model simplifies the use of the Ada compiler and program builder e There are no compilation order requirements for compiling Ada source As long as the Ada source for depended upon units is available it is not necessary to compile them first e There are no constraints on the user s approach to
105. antiated e To locate the body of a subprogram in another library unit to which pragma Inline applies e To locate the body of a stub contained in a subprogram MAPUS QFT Porting Made Easy 192 OS PORTING AND ABSTRACTION LAB USER MANUAL This requires a method for locating a source file from a unit name during compilation This is only required if the needed unit is in a source file that has not yet been analyzed in the current invocation of the compiler Locating the Source File The order of the search for locating a unit during compilation is as follows e First check the UNIT MAP of the program library e Then check the UNIT MAP of each linked library in the order of the library search list Ada Program Builder Library Interaction The Ada program builder uses the Ada program library to locate the object module file and theinformation file for each unit needed in the main procedure Since the names of these files are basedon the source file name the unit to source correlation is required The method used to determinethis is similar to that used by the compiler Locating the Information File and Object Module To determine the name of the source file the program builder checks to see if a unit is registeredin the program library or any linked library Thus the effective order of the search by the programbuilder is e First check the UNIT MAP of the program library e Then check the UNIT MAP of each linked library in th
106. apter includes the following topics e List of Available OS Simulators e Host Development Environment e Creating an OS PAL C C Project e C Project Template Files e HOST Defines e Adding Source Code Files to OS PAL Project e Building Binary Files for a Project e Executing Binary Files e Debugging the Demos Supplied by MapuSoft e Debugging Using External Console Terminal e Inserting Application Code to Run only on Host Environment e Inserting Application Code to Run only on Specific Target OS Environment e Updating Project Settings For more information on the host development refer to OS Simulator With Host Development Chapter on page 37 MAPUS FT Porting Made Easy 32 OS PORTING AND ABSTRACTION LAB USER MANUAL OS Changer for Re using Software The OS Changer family of products is COTS porting tools that give users the freedom to change operating systems while reusing their existing embedded code and knowledge base to protect their software investment and avoid costly porting issues OS Changer also allows developers to write code using a familiar application programming interface API and run the application on a wide variety of supported target OS platforms Solutions are available for porting from VxWorks pSOS and Nucleus to many different real time RTOS and non real time operating systems Target operating systems supported can be found here http mapusoft com products OS Changer is designed for use as a C librar
107. are Using Local Update Site 1 From OS PAL main window select Help gt Software Updates gt Find and Install as shown in Figure 11 Figure 11 OS PAL Software Updates File Edit Refactor Navigate Search Project Run Tools Window Help BS on DORA RO B PAL Welcome 2 we 2 Help Contents FE Pat Profiler pa Projects DP Search Fray C C Projects F f Dynamic Help o a B amp j Key Assist Ctrl St Tips and Tricks Cheat Sheets k demo_cross_os L demo_nucleus demo_posix demo_psos demo_uitron demo_yvxworks Aj projl 2 Find and Install Software Updates amp Manage Configuration About OS Porting and Abstraction Lab 2 ee aw ew El Probl E Prope progr El Console 23 E C Build adapal_1 Goh fw B r AIAC OLTA Oo 1 1 e adazCC adapal_1 source helloworld ada m ada2CC adapal_1 source hello world el tab o lwinmm Build complete for project adapal 1 Time consumed 136406 ms can ni jadapal_1 MAPUS QFT Porting Made Easy 20 OS PORTING AND ABSTRACTION LAB USER MANUAL 2 Select Search for new features to install and click Next as shown in Figure 12 Figure 12 Installing New Feature Updates PAL Install Update Feature Updates Choose the way you want to search for Features to install O Search for updates of the currently installed features Select this option if you want to sear
108. ating system specific code For MAPUS FT Porting Made Easy 47 OS PORTING AND ABSTRACTION LAB USER MANUAL instance if you want to add a signal handler on Linux you could do it here before calling OS_Main os _init_lynxos c This function is the entry function for the native operating system This is where you should put any of your operating system specific code For instance if you want to add a signal handler on Lynxos you could do it here before calling OS_Main os _init_mqx c This function is the entry function for the native operating system This is where you should put any of your operating system specific code For instance if you wanted to add a signal handler on MQX you could do it here before calling OS_Main os _init_nucleus c This function is the entry function for the native operating system This is where you should put any of your operating system specific code For instance if you wanted to add a signal handler on Nucleus you could do it here before calling OS_Main os _init_qnx c This function is the entry function for the native operating system This is where you should put any of your operating system specific code For instance if you wanted to add a signal handler on QNX you could do it here before calling OS_Main os init_solaris c This function is the entry function for the native operating system This is where you should put any of your operating system specific code For i
109. ation Include Cross OS Interface API s Include POSIX Interface APT s V Include xWorks Interface API s C Include p505 Interface API s Include Nucleus Interface API s C Include micro ITRON Interface API s C Include Windows Interface API s Porting Made Easy 55 OS PORTING AND ABSTRACTION LAB USER MANUAL You will see the output as shown in Figure 32 Figure 32 A Project with multiple Interfaces Output PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help TaM E OOR BO B x t Aa 4i Sa lt p k EF pat Profiler PAL Projects Ge cic Projects 2 Poe i Basra H adapal_1 a demo_cross_os La demo_nucleus La demo_posix La demo_psos La demo_uitron a demo_vxworks La example ca Includes H B C MapuSoft OSPAL plugins mapusoft ospal host_1 3 6 1 finclude finclude Ci iMapuSoft OSPAL plugins mapusoft ospal host_1 3 6 Lfinclude yxworks_interfac D H amp HAH Ci MapuSoft OSPAL plugins mapusoft ospal host_1 3 6 1finclude nucleus_interface E B C MapuSoft OSPAL plugins mapusoft ospal host_1 3 6 1finclude cross_os_windows examplefinclude w C Mapusoft OSPAL MinGW include B C MapuSoft OSPAL MinGw lib gcc mingw32 3 4 2finclude CS source GS include A proj i sample Property 2 items selected CiC Indexer 14 OS PORTING AND ABSTRACTION LAB USER MANUAL Adding Source Code Files
110. ator with Host Development OS Changer for Re using Software OS Abstractor for Developing Portable Software Full Library Package Generator Optimized Target Code Generator Ada C C Changer About OS PAL Profiler MAPUS FT Porting Made Easy 28 OS PORTING AND ABSTRACTION LAB USER MANUAL Introduction to OS PAL Components With OS Porting and Abstraction Lab OS PAL you can easily port abstract and optimize your code on a host machine and run the application on different target platforms OS PAL leverages the existing OS Changer and OS Abstractor technologies while adding advanced code optimization capacities on multiple OS environments OS PAL provides users an easy to use graphical user interface that is integrated with the Eclipse based CDT environment OS PAL uses OS Abstractor and OS Changer technology to produce optimized target code OS PAL target features include e Generation of project files for your IDE e Generated target code is optimized to contain only the APIs used by the application e Allows for further optimization by in lining user selected API s e Compile Ada source code to a relocatable object or an executable e Enables to convert Ada source code into C C code e Allows application profiling and platform profiling for your APIs e Generate API Profiling timing report and Profiling Timing comparison report e Target selection and configuration tabs to optimize the target code specific for your appli
111. ay already be available You can add new update site URLs to the search MAPUS QFT Porting Made Easy 14 OS PORTING AND ABSTRACTION LAB USER MANUAL 3 On Updates sites to visit window select the check box next to OS PAL Update Site and click Finish as shown in Figure 5 Figure 5 Remote Update Site to Visit install Update sites to visit Select update sites to visit while looking for new Features Sites to include in search New Remote Site g P g P New Local Site E l Eclipse Modeling Framework EMF Updates E l Eclipse Modeling Framework Technologies EMFT Updates New Archived Site C europa Discovery Site J OSPAL Update Site F A The Eclipse Project Updates Edit Remove Import sites Export sites Ignore features not applicable to this environment C Automatically select mirrors MAPUS QFT Porting Made Easy 15 OS PORTING AND ABSTRACTION LAB USER MANUAL 4 On OS PAL Updates Search Results window select the features under the OS PAL Update Site tree parent and click Next as shown in Figure 6 Figure 6 Remote Update Search Results Pat Updates BR Search Results A Select features to install from the search result list A Oy lt Select the features to install SETRIT OPAL Update Site Deselect All S 7 000 Other r VE O5 PAL Core Feature 1 3 5 1 More Into Pr operties Select Required Error Details OS PAL 1 3 5
112. be at specific nucleus lt OS gt x86 eclipse directory MAPUS FT Porting Made Easy 163 OS PORTING AND ABSTRACTION LAB USER MANUAL pSOS Interface The pSOS Interface library contains the following modules Module Description psos_interface h This header file is required in all of the pSOS source modules This header file provides the translation layer between the pSOS defines APIs and parameters to OS Abstraction The pSOS Interface demo contains the following modules Module Description demo c Contains a sample demo application Building pSOS Interface Before building the pSOS Interface library and or application ensure that the flag INCLUDE_OS_pSOS is set to OS_TRUE in the cross_os_usr h configuration file Building pSOS Interface Library The pSOS Interface library is located at mapusoft psos_interface directory From this location you will find the make files or project files at the appropriate specific lt OS gt lt tool gt lt target gt directory For instance if you need the demo application to be built for pSOS OS using Eclipse tools and for x86 target then the make file location will be at specific psos_interface lt OS gt x86 eclipse directory Building pSOS Interface Demo Application The demo application is located at the mapusoft demo_pSOS directory location From this location you will find the make files or project files at the appropriate specific lt OS gt lt tools g
113. being linked into your application OS_LIB_BUILD must be set to the correct value corresponding to the library that is linked If these do not match it will not work OS_LIB_BUILD is set in the project makefile settings Make sure if your application is built for 32bit architecture OS_CPU_64BIT is set as OS_FALSE as a command line option MAPUS FT Porting Made Easy 121 OS PORTING AND ABSTRACTION LAB USER MANUAL Developing Cross OS Application The steps for developing Cross OS applications on host targets are described in the following generic form 1 Include os_target h in all your application source files 2 Set the appropriate compiler switches within the project build files to indicate the target OS and other target configurations 3 Configure the pre processor defines found in the cross_os_usr h header file under each target OS folder to applications requirements 4 Initialize the OS Abstractor library by calling OS_Application_Init function If you are also using POSIX Interface then also use OS_Posix_Init function call to initialize the POSIX component as well If you use OS Changer s you may need to call other appropriate initialization functions as well After initialization create your initial application resources and start the application s first task After this and within the main thread call OS_Application_Wait_For_End function to suspend the main thread and wait for application re start or terminatio
114. c mq adaRoot D E Debug HS ada2CC adapal_1 exe ADA LIB UNIT MAP 1 O demo_cross_os Ez C demo_nucleus E C demo_posix Ei C demo_psos C demo _uitron E C demo_vxworks E Al proji adapal_1 Debug adapal_1 exe ie E Probl i prope progr E console 3 C Build adapal_1 Ex ref B ree landroid o a jada2CC adapal_1 source helloworld ada J lo jada2CC adapal_1 source hello world el itab o lwinmm Build complete for project adapal_ 1 Time consumed 137969 ms NOTE While importing an Ada project you will receive 3617 warning messages It appears that most if not all of them are associated with the rtl files They are as follows Defined but not used variables 3129 Return with no value in function returning non void 15 Assignment from incompatible pointer type 52 Comparison is always false due to limited range of data type 94 Cast from pointer to integer of different size 3 Comparison of distinct pointer types lacks a cast 8 MAPUS QFT Porting Made Easy 253 OS PORTING AND ABSTRACTION LAB USER MANUAL e Control reaches end of non void function 71 e Implicit declaration of function 10 e Initialization from incompatible pointer type 5 e Integer constant is so large that it is unsigned 1 e Left shift count gt width type 1 e Missing braces around initializer 2 e Passing arg from incompatible pointer type
115. cation o Target OS selection o Profiler configuration o Task configuration including a task pooling feature o Process configuration including a process feature o Memory configuration o Resource configuration o Debug configuration o Output configuration including the ability to output to a console or serial port o ANSI Mapping configuration o Device I O configuration MAPUS FT Porting Made Easy 29 OS PORTING AND ABSTRACTION LAB USER MANUAL MapuSoft provides an illustration to describe all the components of OS PAL OS PAL leverages the existing OS Changer and OS Abstractor technologies while adding advanced code optimization capacities on multiple OS environments They are all interlinked and work closely as shown in Figure 19 Figure 19 OS PAL Components Reuse software with OS Changer OS Simulator with host development Develop portable software with OS Abstractor Generate full OS Changer amp OS Abstractor source libraries QS PAL Porting and Abstraction Lab A Generate optimized OS Changer amp Application amp platform profiling Ada PAL OS Abstractor target Compiler A OS source code A Ada C C Changer For more information on OS PAL components refer to the specific chapter MAPUS QFT Porting Made Easy 30 OS PORTING AND ABSTRACTION LAB USER MANUAL OS PAL Architecture A gt www mapusoft com S PAL Porting and Abstraction Lab 1 877 MAPUSOFT Outp
116. ce files This will be evident in the examples that follow MAPUS FT Porting Made Easy 190 OS PORTING AND ABSTRACTION LAB USER MANUAL Configuration with Multiple Source Directories In a larger program the source files composing the Ada program are often located in severaldirectories To support this source configuration the program library provides a source directory listwhich points to the directories containing the source In this configuration the source can be distributed in any convenient way among any number ofsource directories Configuration with Linked Libraries For more complex programming efforts it may be desirable to partition the source code intosubsystems each of which is maintained within a separate program library To support this model the Ada program library supports linking to other existing libraries The user need not know the location of the source for a linked library just its program librarydirectory If the linked library is itself linked to another library that library also needs to be added asa linked library for the current library The source files and object modules of a linked library mayonly be referenced in a read only fashion Specifying the Configuration The program library s configuration is determined by the values of program library parameters The configuration described above is the default configuration created automatically by the firstinvocation of the Ada C C Changer orAda PAL compi
117. ce files the files in a directory must have one of the following file extensions a ada adb ads bdy dat spc sub You can also use any new extensions of user choice as shown in Figure 124 e There is no naming restriction for source files explicitly registered Source files in the UNIT MAPof linked libraries are not contained in the current program library but they are visible for read only reference by the compiler and program builder Generated Files The Ada compiler output also includes files generated by the compiler or program builder These include e Object module files o or obj and information files info for Ada source files in the program library e Executable files exe for main units in the program library e Optional listing files lst e Optional cross reference files for use by the cross reference compiler option e Other intermediate files if kept see the ke option Ada PAL Compiler Library Interaction The Ada PAL Compiler Ada C C Changer uses the program library to locate the source files needed to handle semantic dependencies during compilation of a specified source file Some of the situations in which this may occur are the following e To locate a with ed unit or the parent unit for a separate clause or child unit e To locate the library unit specification if any when a library unit body is being compiled e To locate the body of a generic if any when the generic is inst
118. cedure immediately You need to select the project and refresh 1 2 times and clean the project and then do the build Note On Linux HOST Environment you need to set View Modify permissions to the Tools folder while creating a project To set View Modify permissions e Go to the Tools folder e Right click on the Tools folder and select Properties gt Permissions e Change the required permissions Then provide executable permissions to files under tools Ada linux bin folder before creating any Ada project Otherwise it will give an OS PAL exception while trying to convert Ada to C using Ada C C Changer Options MAPUS FT Porting Made Easy 205 OS PORTING AND ABSTRACTION LAB USER MANUAL To change executable permissions e Go to Terminal Command window e Go to the respective folder location by cd OS PAL root directory Tools Ada linux bin e Once you are in bin folder run the command like lt chmod 777 gt e Now observe files changes color from black to green To create Ada C C Changer project 1 From OS PAL main menu selectTools gt Ada C C Changer Or On the tool bar click Ada C C Changer icon as shown in Figure 123 Figure 123 Creating Ada C C Changer Project Pat Projects OS Porting and Abstraction Lab File Edit Source Refactor Navigate Search Project Run BESSI Window Help Dm D ADOR Po Optimized Target Code Generator FEY Pat Profiler pat Projects Resource Update Sett
119. cess name and the ID User Data Specifies the information provided by the user Profiling start time Specifies the starting time of profiling Profiling stop time Specifies the end time of profiling Total time profiled Specifies the total time taken for profiling Number of profiling messages Specifies the number of profiler messages MAPUS FT Porting Made Easy 184 OS PORTING AND ABSTRACTION LAB USER MANUAL Generating Timing Comparison Report NOTE This feature requires a license Click http mapusoft com downloads ospal evaluation to request an evaluation license OS PAL now provides you a new feature to view the comparison of two different performance reports for the APIs You can generate a timing comparison report only when the following preconditions are met e Both the PAL files must have the same project name e Both the PAL files must have a profiling time less than 5 minutes To generate Timing Comparison Report 1 From the OS PAL main menu go to Profiler perspective and select any Profiler Data on your left pane to generate the report 2 Select Tools gt Generate Comparison Report You can also click on Generate Comparison Report button a on the OS PAL window as shown inFigure 119 Figure 119 Generate Timing Comparison Report Profiler os Porting and Abstraction Lab File Edit Navigate Search Project Run MESSI Window Help ri A BA Load Profiler Data File E pan Profiler ee Debug Pat
120. ch for updates of the features you already have installed Os Select this option if you want to install new features from existing or new update sites Some sites may already be available You can add new update site URLs to the search Cancel MAPUS FT Porting Made Easy 21 OS PORTING AND ABSTRACTION LAB USER MANUAL 3 On Updates sites to visit window select New Local Site and browse for the folder provided by MapuSoft named as mapusoft Ospal update site and click OK as shown in Figure 13 NOTE If the system does not allow you to give the same site name select the previous update site folder from the list and click Remove Or you can also save the Update site folder in any other location on your local disk Figure 13 Installing Updates by Using Local Update Site PAL Install Update sites to visit Select update sites to visit while looking For new features Sites to include in search FF al Business Intellegence and Reporting Tool BIRT Updates New Remote Site F Al Business Intellegence and Reporting Tool BIRT Updates C eclipse Modeling Framework EMF Updates New Local Site o A Eclipse Modeling Framework Technologies EMFT Updates New Archived Site C Meuropa Discovery sity O lospat Update site ETM C Hl the Eclipse Project Select a local update site E O include B mapusoft ospal updatesite O M50Cache E O osabstractor_vxworks O Share folder_Vineela 4 O Songs Ignore
121. clude include lt target dir gt cross os lt target gt include MAPUS QFT Porting Made Easy 234 OS PORTING AND ABSTRACTION LAB USER MANUAL Creating an Ada PAL Compiler Project Compiling Ada C Code Ada PAL Compiler converts Ada Program Library directly into executable binary file For Ada PAL Compiler Projects Cross OS interfaces are added directly to the project as a target sources if user has the relevant Standalone package generator license If a Code Generation is attempted on these projects all the Cross OS functionality being part of application is again redefined in cross_os c This will end up in having re definition errors on compile time Hence Ada PAL Compiler projects cannot be code optimized NOTE When you are working on 64bit architecture make sure that m32 flag is added to both the compiler and linker options in project properties to avoid compilation errors OS PAL now provides support for the following Ada features 1 ADA Line Count This feature enables you to count the Ada lines of code with a simple program It just takes a list of file names and prints out the numberof lines of Ada source code lines of comments and blank lines counting lines ofcode the same way the license checker counts them The application name is ada_line_count exe You have to run this exe in cmd prompt Command ada_line_ count file1 file2 file3 POSIX ADA Support For Linux only Ada tools now give
122. cssanencessonasedvanneoen 125 Optimized Target Code Generation for Ada Projects ecceeeseecseeeeeeeeeeeeneeeeeees 125 Generating Project Files for your Target eesesseseesessreesesresseseresressrsererrensersresreeseeee 159 Inserting Application Code to Run only on Target OS Environment eee 160 Running OS PAL Generated Code on your Target 00 ces eeeeseeseeeeereeesseeeseeeseeeenees 161 Building Cross OS Interface Library eccescesseessccesseecoeeesceeseceenseneoeeeseettensenees 161 WY WV OTS Interface sanye a E A 162 Building VxWorks Interf Cesncennerenann a eeaeetecetegiees 162 Building VxWorks Interface Library eeeeseeseeeeeseeesesressreeresressrsrrerressrseresresseesres 162 Building VxWorks Interface Demo Application ssseeeeeeeeeseeeessreererreesreeresrersereees 162 POSIX nterface iiinn rena A eee ets 162 Building POSIX Interface issiron ena aa a i iiei 162 Building POSIX Interface Library eeseeeeseeeseseeesesrsesressrserrsresrrsrresressrseresresseseees 163 Building POSIX Interface Demo Application sssessseseesessreesesressrsererressrssrerrerssereres 163 N cleus Int rfac sas sestecsts ca rccersceetacdgasuackacdecgastashaaednacenceds E Ea E EA 163 Building Nucleus Inter tace niseni ienaa n E ER AER 163 Building Nucleus Interface Library seeseseeeseseeeseeesesressrserrsressrsrrerressresresresseesees 163 Building Nucleus Interface Demo Application sssssseesreesessessrsererre
123. d C C OS PAL project In this case the API level optimization process is skipped as the application needs to link in other required RTL C C libraries and possible other C interface libraries Instead of the OS Abstractor code being included as part of the application it is added into the target directory as a separate code base that should be built as libraries There will be separate libraries for the Cross OS component as well as any other OS Interface components like VxWorks Windows etc included in the project There will also be a separate Ada Run Time Library RTL required to be linked in as well For example if a converted Ada to C C project that was integrated with OS Abstractor and includes the POSIX Interface were optimized for a windows target it would look like follows lt target dir gt cross os windows source include specific posix interface source include specific include include rel XIL src IL lt app name gt ada2C lt app name gt source include The lt target_dir gt is the directory location where the generated code would be placed The Cross OS and OS Interface directories will include project files specific to your target Project files for the RTL will only be included for Windows and Linux targets On a Windows target you will get a project file for the Eclipse IDE and on Linux you will get both Eclipse and make files For all other targets and toolsets you will need to MAPUS FT
124. d Configurations B In Place Editor Binaries Make targets gt ees EE J Default Editor E E Includes Copy Shee BD incude f paste source J Delete Open Open With i Default Binary File Editor OBE Eee H S Debug AA Im demo h aal r Hkc Rename operties 2s Progress g Console oO z os_applic g Import u 5 Y os_entry a Ex szo port windDem windDem Refresh Add Bookmark Run As gt Debug s Clean Selected Filets Build Selected File s Bem Team gt Compare With 64 OS PORTING AND ABSTRACTION LAB USER MANUAL 3 This approach always will fork a terminal to view the output as shown in Figure 41 Figure 41 Binary Output C OSPAL_1 3 6 workspace Application Copyright Notice Author Name Application Welcome Message Jelcome to Cross OS Interface Application Copyright Notice Author Name Application Welcome Message Melcome to Cross OS Interf Application Copyright Notice uthor Name Application Welcome Message Jelcome to Cross OS Interface Application Copyright Notice Author Name Application Welcome Message Jelcome to Cross OS Interface MAPUS QFT Porting Made Easy a i 65 OS PORTING AND ABSTRACTION LAB USER MANUAL Debugging the Demos Supplied by MapuSoft Example Debugging the demo_cross_os application 1 From OS PAL main window select dem
125. d in the current workspace MAPUS FT Porting Made Easy 105 OS PORTING AND ABSTRACTION LAB USER MANUAL Chapter 4 OS Changer for Reusing the Code OS Changer allows you to reuse the code on any new OS without having to rewrite or port your code This saves time and money by reducing the porting effort OS Changer provides extensive support to various common proprietary libraries widely used by the application developers Further developers can use the native TARGET OS interface as well This works toward getting the migration effort faster and much easier This chapter contains the following topics About OS Changer Interfaces Available for OS Changer Using OS Changer Error Handling MAPUS FT Porting Made Easy 106 OS PORTING AND ABSTRACTION LAB USER MANUAL About OS Changer OS Changer is designed for use as a C library Services used inside your application software are extracted from the OS Changer and TARGET OS libraries and are then combined with the other application objects to produce the complete image OS Changer is optimized to take full advantage of the underlying TARGET RTOS features It is built to be totally independent of the target hardware and all the development tools like compilers and debuggers Please note that there may be some minor implementation differences in some of the OS Changer APIs when compared to the native API s This may be as a result of any missing features within the underlying
126. dditional information including specific details on how to use the compiler assembler and linker MAPUS FT Porting Made Easy 166 OS PORTING AND ABSTRACTION LAB USER MANUAL Chapter 8 OS PAL PROFILER OS PAL provides the Profiler to collect performance data concerning your application and the platform You can graphically view the data with charts and graphs to find bottlenecks system wide or for a specific task It enables you to generate API timing report and also do a comparison for two timing reports This chapter contains the following topics About OS PAL Profiler Opening OS PAL Profiler Perspective Components on the Profiler Window Viewing OS PAL Profiler Data Generating API Timing Report Generating Timing Comparison Report MAPUS FT Porting Made Easy 167 OS PORTING AND ABSTRACTION LAB USER MANUAL About OS PAL Profiler NOTE This feature requires a license Click http mapusoft com downloads ospal evaluation to request an evaluation license The OS PAL Profiler is an add on to the established OS PAL Eclipse based code migration and API optimization technology and is designed to enable data collection OS PAL Profiler offers the following e The data collected by the Profiler provides feedback concerning the utilization of MapuSoft s APIs in the project e The reports allow for performance impact analysis by detailing specific API execution time during a particular time period as well as the avera
127. de in OS PAL Projects OS Porting and Abstraction Lab File Edit Source Refactor Navigate Search Project Run Tools Window Help mn DOX BO B amp O Q FEY PaL Profiler pat Projects Resource VxWorks sy Import Legacy C Code oF gt 8 y T C C Projects Nucleic gt m oes POSIX gt gt gt 4 His Ec Problem micro ITRON ada2 i 7 0 items Windows toc A im ada_to_c Description Resource Path demo_cross_os demo_nucleus demo_posix demo_psos demo_uitron demo_yxworks demo_windows MAPUS QFT Porting Made Easy 97 OS PORTING AND ABSTRACTION LAB USER MANUAL 2 On OS PAL Import window select the root directory from where you want to import the legacy code by clicking on Browse button next to the text box and click Next as shown inFigure 71 Figure 71 Import pSOSLegacy Code Window Import pSOS Legacy Code Select a Directory to Import Legacy Code Into OS PAL Root Directory D legacy psos Project Name psos_legacy Root Task Prototype VOID Function_Root ULONG argument Root Task Stack Sizefin bytes OS_MIN_STACK_SIZE 3 Enter the project name for which you want to import the legacy code in the Project Name text box as shown in the figure 4 Enter the root task prototype next to Root Task Prototype text box as shown in the figure 5 Enter the root task stack size next to the Root Task Stack Size text box as shown in the f
128. do Ada source list only if errors are present select the radio button Note By default this is enabled e To always produce Ada source list select the radio button Source Listing Format Pagination Specifies the format of the Source Listing You can do any one of the following e For continuous source listing select the radio button Note By default this is enabled e For listing only of lines with errors or warnings select the radio button e For paginated source listing select the radio button Page Length Specifies the length of the page Enter a value for the length of the page Note By default the value is 66 Page Width Specifies the width of the page Enter a value for the width of the page Note By default the value is 80 Listing only of Specifies if you want Select the check box not lines with to list only lines with errors or errors or warnings warnings Cross Specifies if you want You can do any one of the following Reference to generate a cross Listing reference listing or e To not to generate a cross reference listing select the radio button Note By default this is enabled e To generate a cross reference listing select the radio button MAPUS FT Porting Made Easy 215 OS PORTING AND ABSTRACTION LAB USER MANUAL 6 On Ada Messages tab set your message options as shown in Figure 128 Figure 128 Ada Messages Tab
129. e Unknown Free space 31 13 GB 7 On Update Manager window you can view the new plugins being downloaded as shown in Figure 9 Figure 9 Remote Updates Download Update Manager 2 Downloading Po plugins mapusoft ospal generation_1 3 5 1 jar 181K of 208K bytes MAPUS QFT Porting Made Easy a a es 8 OS PORTING AND ABSTRACTION LAB USER MANUAL 8 On Feature Verification window click Install All as shown in Figure 10 Figure 10 Remote Update Feature Verification Verification Feature Verification al p dy Warning You are about to install an unsigned feature You may choose to install the feature or cancel its installation This feature has not been digitally signed The provider of this Feature cannot be verified Feature name OS PAL Core Feature Feature Identifier mapusoft ospal core feature_1 3 5 1 Provider Mapusoft Technologies Inc File Identifier mapusoft ospal core feature_1 3 5 1 9 Once all the features and plug ins have been downloaded successfully and their files installed into the product on the local computer a new configuration that incorporates these features and plug ins will be formulated Click Yes when asked to exit and restart the Workbench for the changes to take effect You have now successfully installed new feature updates to your OS PAL using the Remote Update Site MAPUS QFT Porting Made Easy 19 OS PORTING AND ABSTRACTION LAB USER MANUAL Updating Softw
130. e 29 Basic Settings Window GS OS PAL C Project Wizard Basic Settings Basic properties of a project Application Name Application Prefix Author Name Copyright notice Application Copyright Notice Greeting Message Application Welcome Message Source Folder Name source o 53 OS PORTING AND ABSTRACTION LAB USER MANUAL 6 On Select Configurations window select the platforms and configurations for deployment and click Next as shown inFigure 30 Figure 30 Configurations Window Select Configurations Select platforms and configurations you wish to deploy on Project type Executable Tool chains MinGW GCC Configurations i ws 7 5 Debug Select all 5 Release Deselect all Advanced settings J Use Advanced settings button to edit project s properties Additional configurations can be added after project creation Use Manage configurations buttons either on toolbar or on property pages MAPUS QFT Porting Made Easy 54 OS PORTING AND ABSTRACTION LAB USER MANUAL 7 On Select APIs window select the check box before Include Nucleus and VxWorks Interfaces APIs and click Finish as shown in Figure 31 Figure 31 Select APIs Window QS OS PAL C Project Wizard Select APIs List of API sets available Cross O5 InterFace APIs will automatically be included for OS PAL C C Projects Select additional development API s used by your applic
131. e Easy OS PORTING AND ABSTRACTION LAB USER MANUAL Porting Applications from Nucleus PLUS Legacy Code to Target OS In most applications using Nucleus OS Changer is straightforward The effort required in porting is mostly at the underlying driver layer Since we do not have specific information about your application it will be hard to tell how much work is required However we want you to be fully aware of the surrounding issues upfront so that necessary steps could be taken for a successful and timely porting This section provides porting guidelines in a flow chart format This covers issues relating with Nucleus OS Changer device drivers interrupt service routines etc It is possible that we have not addressed all your application specific issues in the flow chart so for further information contact MapuSoft Technologies MAPUS FT Porting Made Easy 92 OS PORTING AND ABSTRACTION LAB USER MANUAL Figure 66 Porting Nucleus PLUS Applications Porting Nucleus PLUS Applications to Linux Guidelines Chart A Kernel APIs interrupts and device drivers E START k CHECK 1 S your application uses kernel APIs are un supported in Nucleus PLUS OS Changer CHECK 2 Do s your application uses kernel APIs are partially supported by Nucleus PLUS OS Changer CHECK 3 oes your application configure the targe hardware differently than default setup in Nucleus PLUS CHECK 4 Are you using
132. e Profiler Configuration Profiling Application values Figure 108 OS PAL Profiler System Details Profiler 0S Porting and Abstraction Lab File Edit Navigate Search Project Run Tools Window Help Smee wo BRB a iv Fy PAL Profiler He Debug PAL Projects PaL Profiler Data Expl 3 O E Properties 3 PA profiler data_1210 Property Value Show Advanced Prop pd Svstem 49 Functions ANSI Format IO Disabled Threads ANSI IO Disabled ANSI Memory Enabled Cross OS Interface Enabled Debug Information level Enabled Error checking Enabled Fatal Error Enabled micro ITRON Interface Disabled Minimum memory pool sec 4 Nucleus Interface Disabled POSIX Interface Disabled Process mode Disabled p505 Interface Disabled Size of the system memor 32768 Task pooling Disabled Total system memory limit 28483 Works Interfare Disabled File name profiler_data_1210343810 pal File size 138220 Bytes Number of profiling messe 1342 Process name and ID lt NA gt 65535 Profiler XML Format v1 1 Profiling start time 13 56 10 Profiling stop time 13 56 33 MAPUS QFT Porting Made Easy _ R A 7 ml 72 OS PORTING AND ABSTRACTION LAB USER MANUAL 2 Functions This displays all the functions called in the application and the time taken to execute these functions as shown in Figure 109 Figure 109 OS PAL Profiler System Profiler os Porting and Abstraction Lab Sele File Edit Navigate Search Project Run Tools Wind
133. e body it might have subunits or inlined subprograms that need access to its local declarations and so those are placed in a h file for the body Ada C C Changer and Ada PAL Compiler are very portable because the Ada Tool sRTS relies mostly on the standard C run time However C run time support is not truly real time as it uses C setjmp longjmp to accomplish multi threading which is not very flexible But by adapting the Ada Tool RTS to use the OS POSIX Interface Mapusoft APIs we can use true multithreading and still be very portable to multiple O Ss and RTOSs MAPUS FT Porting Made Easy 203 OS PORTING AND ABSTRACTION LAB USER MANUAL Chapter 10 Working With Ada Tools This chapter contains the following topics Creating ADA C C Changer Project Creating Ada PAL Compiler Project MAPUS FT Porting Made Easy 204 OS PORTING AND ABSTRACTION LAB USER MANUAL Creating ADA C C Changer Project NOTE This feature requires a license Click http mapusoft com downloads ospal evaluation to request for an evaluation license Ada C C Changer converts Ada 83 or Ada 95 Programs to C Source Code and keeps the C Source Code in Projects NOTE1 When you are working on 64bit architecture make sure that m32 flag is added to both the compiler and linker options in project properties to avoid compilation errors OS PAL now provides support to the following Ada features 1 Ada Line
134. e false for Full Source Library Package generation Flag and Purpose Available Options OS_HOST This flag is set as OS_TRUE by default in OS PAL To select the host operating MVironment system Target 64 bit CPU Selection Based on the OS you want the application to be built set the following pre processor definition in your project setting or make files Flag and Purpose Available Options OS_CPU_64BIT The value of OS_CPU_64BIT can be any ONE of To select the target CPU the following type e OS_TRUE Target CPU is 64 bit type CPU e OS FALSE Target CPU is 32 bit type CPU NOTE In New C projects creation the flag OS_CPU_64BIT will be set to OS_FALSE by default and user needs to make this true if they run on a 64 bit OS MAPUS FT Porting Made Easy 75 OS PORTING AND ABSTRACTION LAB USER MANUAL Updating Project Settings OS PAL provides exclusive way to update the Projects Settings by just a click of a button This is very useful in any one of the following cases 1 Ifthe user has moved his workspace to a different location 2 Ifthe project requires new toolchain that is installed recently The Update button performs an auto update on all the projects updates which include files new directory structures libraries and toolchains to the Project Settings To update project settings 1 From OS PAL main menu select Tools gt Update Settings or click OS PAL Project Settings button
135. e is optimized to contain only the APIs used by the application Allows for further optimization by in lining user selected API s Contact MapuSoft to receive the components needed for using OS PAL The steps for using OS PAL are comprehensively described in the following pages The OS Porting and Abstraction Lab User Manual has screen shots for many of the steps MAPUS FT Porting Made Easy 6 OS PORTING AND ABSTRACTION LAB USER MANUAL Installing OS PAL You can download an evaluation copy from our website or install OS PAL via the evaluation CD given by MapuSoft Technologies To install OS PAL 1 2 3 4 Insert the CD and run it A welcome html page will be auto run Click Port abstract and optimize code on a host OS PAL link Select the host For Example windows or Linux Click Click here to begin installation This will launch the ospal installer which is called os porting and abstraction lab windows jum installer exe NOTE This exe file is what you have if you download OSPAL from the web manually Double click on the exe file to launch the installer You can view the installation system requirements displayed on the installer wizard Browse and select the installation directory NOTE By default it is c MapuSoft OSPAL Do not install OS PAL in any location with spaces in the path name reference such as any subdirectory of Program Files or My Documents or the like OS PAL may have problems with paths
136. e order of the library search list Once the source file name is found it may be that the corresponding information and object modulefiles do not exist because the source was never compiled or they are out of date because the sourcefile or some source file on which it depends has changed If the missing or out of date objectmodule belongs to a source file in one of the linked libraries the program build will fail becauselinked libraries are read only Otherwise the program builder implicitly invokes the Ada PAL Compiler Ada C C Changer to create the needed object module and information file Predefined Run Time System There is C run time sources that provides I O tasking exception handling and memory management modules which are normally required by Ada 95 language for the C converted code base These are called Ada run time system RTS Program Library Options Tool adaopts Overview The program library options tool adaopts supports tailoring the program library to meet the needsof a particular Ada project For small Ada projects it is unlikely that this tool will be needed becausethe behavior of the compiler and builder are by default configured for small projects For more complex programs the user may direct the program library options tool to distribute sourceto multiple directories create links to existing program libraries place object modules in a separatesubdirectory etc The program library options
137. e pools NOTE Default value is 100 Maximum Fixed Memory Pool Control Blocks Specifies the total number of partitioned fixed size memory pools required by the application Enter the maximum number of partitioned memory pools NOTE Default value is 100 Minimum Variable Pool Allocation Size in Bytes Specifies the minimum memory allocated by the malloc and or OS_Allocate_Memory calls NOTE Increasing this value further reduces memory fragmentation at the cost of more wasted memory Enter the minimum memory allocated NOTE Default value is 4 Increasing this value further reduces memory fragmentation at the cost of more wasted memory User Shared Memory Region Size Specifies the application defined shared memory region usable across all Cross OS Interface processes applications Enter the user shared memory region size NOTE Default value is 1024 Bytes Maximum Tiered Memory Pool Control Blocks Specifies the total number of Tiered Memory Pools required by the application Enter the maximum number of Tiered Memory variable pools NOTE Default value is 100 Maximum Tiered Shared Memory Pool Control Blocks Specifies the total number of Tiered Shared Memory Pools required by the application Enter the maximum number of Tiered Shared Memory variable pools NOTE Default value is 100 MAPUS FT Porting Made Easy OS PORTING AND ABSTR
138. e referred also as Ada Program Library The Ada program library contains all information needed to support the separate compilation requirements of Ada The primary contents of the program library are Ada source files and object modules created by the compiler The only additional information maintained by the program library is the correlation between unit names and source files and dependency information associated with object modules For more information on Ada PAL compiler refer to Using Ada PAL Compiler chapter Ada C C Changer MapuSoftTechnologies now offers the Ada to C conversion Ada tool to give developers the ability to automatically convert legacy software written in Ada to the C programming language This automatic code conversion process eliminates the need for a costly and tedious code re write to provide developers extensive cost and time savings Ada tool gives users peace of mind by providing an error free tool that prevents mistakes made in the error prone task of a manual rewrite Ada tool supports converting Ada 83 and Ada 95 source code and generates ANSI C output as well as certain C features while preserving the Ada code s comments files structures and variable names to ease ongoing code maintenance For more information on using Ada to C C Changer refer to Ada to C C Changer chapter on page 210 MAPUS FT Porting Made Easy 36 OS PORTING AND ABSTRACTION LAB USER MANUAL Profiling Applications and Pla
139. each line it applies select the radio button MAPUS FT Porting Made Easy 244 OS PORTING AND ABSTRACTION LAB USER MANUAL 6 On Ada Drivers tab set Ada driversconfigurations as shown in Figure 146 Figure 146 Ada Drivers Tab O Ada PAL Compiler Configuration options Set your configurations for Ada PAL Compiler tool Ada Source Ada listings Ada messages Ada drivers Additional Mode MAPUS QFT Porting Made Easy 245 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions for Ada Drivers tab are as follows Field Description Your Action Mode Specifies the required You can do any one of the following mode for reporting the compiler actions e To select the verbose mode select the radio button e To select the normal mode select the radio button Note By default this is enabled e To select the quiet mode select the radio button 7 On the Additional tab set additional configurations for Ada PAL Compiler and click Next as shown in Figure 147 Figure 147 Additional Tab O Ada PAL Compiler Configuration options Set your configurations For Ada PAL Compiler tool C Add GNAT Compatibility dd POSIX MAPUS QFT Porting Made Easy 3 aa 246 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions for Additional options tab are as follows Field Description Y
140. ebadanaueenieeeiiees 168 Opening OS PAL Profiler Perspective ccascauaswacsiaasetcennseiasnsasiaesvasseaasdaadeataoancencszenaes 170 Components on the Profiler Window cascscccsisodaseanseeacepasouaeatsesvdceseeeitcaqsl dacevaceadeceseudecx 172 Viewing OS PAL Profiler Data ssccce cess teceesecheceiuie ceveticuecnsacacuuen sa ubostoiadecuvaradebenwseadecen 179 Generating API Timing Rep beecccncsccsvdeddsasscveansaecteerecunreegensdudeuyecedeeleudaccsasonteepeesuadeaye 182 Generating Timing Comparison Repott seseseseessesressreerrsresseseresressrseresrensersresresseeee 185 CHAPTER 9 INTRODUCTION TO ADA TOOL ccsesccecceeee 189 Ada Tool in OS PAN secgsteeeesicstects sich ecntanctrusneatheneetusd exes bhauareaiiatdeedea teeter lasleebstedpeendaadtesest 189 Using the Ada Root tO Ysa geucgacecci eng stas pheteaee st candeancecbigeetere eoeeacuneantacneesceantane 190 Root Directory sosoran anid ceased tee E eae E 190 Configuration with Multiple Source Directories seeesseeeeeseeeeesreereereesreereerersrrees 19 Configuration with Linked Libraries ie ccc cocdncsececdeccutensnpsnddessepdeledsawsdecdutoeceensseealanead 191 Specifying th Confis ratiOhsisssens sareen r E EE EEEE 191 Contents of the Ada Toolsin latices te oadeuns canes ogeetencngateauteteoacsivedanieleetins 192 Program Library Options Tool adaopts esseseesseesessessreeesressrsreerressrsererressereres 193 Source Registration Tool adareg essseses
141. ect the additional Ada C C Changer source directories click Browse and select the Ada source directories Directories Source directories e You can also remove an Ada C C Changer source directory by clicking Remove MAPUS FT Porting Made Easy 211 OS PORTING AND ABSTRACTION LAB USER MANUAL 4 On C C Output tab page describe the C Source Options as shown in Figure 126 Figure 126 C C Output Page PAL Ada C C Changer Configuration options Set your configurations for Ada C C Changer tool Ada Source C C output da listings Ada messages Ada drivers Comments Include comments in generated C code Suppress comments in generated C code Suppress co Include C C Full C Output only Include C namespace Exceptions Header files te c and h files Do not generate separate h files Association Place and on same line as associated construct O Place and on their own line Checks Suppress all checks in generated C code Suppress numeric overflow checks in generated C code Include all run time checks in generated C code MAPUS QFT Porting Made Easy 212 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on C C Output tab are as follows Field Description Your Action Comments Specifies if you want the comments to be generated in C Source Files You can do any one of the following
142. eneration License Check Status SUCCESS Description License For Ada C Changer is valid Ada C Changer Status Status SUCCESS Description For More details See Console View Source Listing Details Status Description No Source Listing Files Generated You have now successfully created Ada C C Changer project MAPUS QFT Porting Made Easy 222 OS PORTING AND ABSTRACTION LAB USER MANUAL NOTE While importing an Ada project you will receive 3617 warning messages It appears that most if not all of them are associated with the rtl files They are as follows Defined but not used variables 3129 Return with no value in function returning non void 15 Assignment from incompatible pointer type 52 Comparison is always false due to limited range of data type 94 Cast from pointer to integer of different size 3 Comparison of distinct pointer types lacks a cast 8 Control reaches end of non void function 71 Implicit declaration of function 10 Initialization from incompatible pointer type 5 Integer constant is so large that it is unsigned 1 Left shift count gt width type 1 Missing braces around initializer 2 Passing arg from incompatible pointer type 114 Statement with no effect 28 Unused variable 83 This decimal constant is unsigned only in ISO C90 1 MAPUS FT Porting Made Easy 223 OS PORTING AND ABSTRACTION LAB USER MANUAL 11 To view the C C code expand the pro
143. er This wizard optimizes target specific source code L2 7 Task Process Memory Other Resources Debug Output Devices ANSI Mapping Device yo Interface Maximum Task Control Blocks koo System Time Resolution 05_TIME_TICK_PER_SEC 10 Default Timeslice for Standard Tasks O5_DEFAULT_TSLICE O5_TIME_TICK_PER_SEC 10 Enable Task Pooling Feature Default Taskpool Timeslice Default Taskpool Timeout Value OS_TIME_TICK_PER_SEC 6 NOTE In the current release Task Pooling feature is not supported in ThreadX and Nucleus targets MAPUS QFT Porting Made Easy 139 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on Task tab are as follows Field Description Your Action Maximum Specifies the total Enter a value Task Control number of tasks NOTE The default value is 100 Blocks required by the One control block will be used by application theOS_Application_Init function when the INCLUDE_OS_PROCESS option is true System Time Specifies the system Enter a value Resolution clock ticks NOTE The default value is 10000 OS_TIME_TI not hardware clock micro second 10milli sec CK_PER_SEC tick This value is derived from the For example when you target OS If you cannot derivethe call OS_Task_Sleep 5 value refer to the target OS you are suspending reference manual and set task for a period thecorrect per clock tic
144. erent location you can also rename it if you want and use it again and again You can create new Ada C C Changer projects by passing the file info in the first screen Ada C C Changer reads this info and sets up the GUI configuration values accordingly This way you can create an option file and use it repeatedly as a template However if you later want to modify these options after creating the project you can select the Ada C C Changer project and right click and choose Properties and select Ada C C Changer Configurationpage and change This will get stored as the new option file for that project This gives you the flexibility to use the template when you create the project and also let you change if needed MAPUS FT Porting Made Easy 209 OS PORTING AND ABSTRACTION LAB USER MANUAL 3 On Ada Source tab page add the Ada source directories as shown in Figure 125 Figure 125 Ada Source Ada C C Changer Configuration options Set your configurations for Ada C C Changer tool Ada Source C C output Ada listings Ada messages Ada drivers Additional Add Additional Ada Source Directories MAPUS FT Porting Made Easy 210 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on Ada Source tab are as follows Field Description Your Action Add Additional Specifies if you want You can do any one of the following Ada Source to add any additional e To sel
145. es generating optimized API interface option is disabled Standard Specifies if the APIs used in Select the functions used in Function your application are this application as standard standard functions functions for the target OS project You can select multiple function names at once to place them in the other list You can select all function names in a list using the selectAll Ctrl A action also Macro Specifies that a compiler To select a standard function Function inserts the complete body of into a macro function select the function in every place the API and click the right in the code where that arrow function is used It is used To select a macro function into to eliminate the time a standard function select the overhead when a function is API under macro function and called and execute it click the left arrow frequently Note You can use optimization for this Ifa function is being called repeatedly they can improve the performance by making this a macro function MAPUS FT Porting Made Easy ne 3 OS PORTING AND ABSTRACTION LAB USER MANUAL 10 On Task configuration tab configure the options to your specifications as shown in Figure 93 Applications can create Cross OS Interface tasks during initialization and will be able to re use the task envelope repeatedly by selecting the check box next to Enable Task Pooling Feature Figure 93 Task Tab OS PAL Target Code Optimiz
146. es the minimum size of the memory pool segment of the application VxWorks Interface Specifies if you have enabled VxWorks Interface pSOS Interface Specifies if you have enabled pSOS Interface POSIX Interface Specifies if you have enabled POSIX Interface Cross OS Interface Specifies if you have enabled the Cross OS Interface Process mode Specifies if the Cross OS Interface process feature is enabled or disabled Task pooling Specifies if the Task pooling feature is enabled for this application ANSI Memory Specifies if you want to map ANSImalloc and free to Cross OS Interface equivalent functions ANSI format IO Specifies if you want to map ANSIprintf and sprintf to Cross OS Interface equivalent functions Debug Information level Specifies if you want to enable the debug output Error checking Specifies if you want to enable the error checking Fatal Error Specifies if you want to enable the feature to ignore fatal errors Profiler Configuration When you perform profiling on OS PAL APIs the report displays the following profiling application values File name Specifies the name of the pal file generated by Cross OS Interface Project name Specifies the name of your project Target name Specifies the target OS you have selected for profiling File size Specifies the size of the file to be profiled Profiler XML format Specifies the version of the XML used for profiling Process name and ID Specifies the pro
147. eseesessesssessereseressstrssressresseeessesseeesseese 194 PVG senises E EE E TAA E R 195 Compiler CEU eiiiai E EE E NE A tec yiae 199 ala e1 012A t MEEA P EEEE iandedeastoeeassaghasesiaseoentaiadeened 200 CHAPTER 10 WORKING WITH ADA TOOL cccccccscccecceees 204 Creating ADA C C Changer Project o ciotcsccetszcdecascsiadledeisiabedsesateneeccveledactaauedsaseeatens 205 ADA C C Changer Configuration Options 0 ce eesceeeeeeeeeeneeceeeeneeeeeeeeeaeeeaeens 209 PaO Wanner Builders esses e a a R uence 226 Ada C C Changer Property Page sciiiscinsinncsvasovsasetecesaveansanascancpassastenssedaseaesvandveies 231 Target Code Generation for Ada C C Changer Projects cccceeseeseseeeeeseeeees 233 Manual Modifications to Projects files generated by Target Code Generator 233 Creating an Ada PAL Compiler Project 2c2ccscccsssccecesdscesscsenssasesdesaseestousnteasccnstectucees 235 Compiins Ada ONS at ects ne acct seisseen ressaire aieiai e ERa eS ne EE aS 235 ADA PAL Compiler Configuration Options cecceesseeeeeneeceeeeeceeeeeeeseeeeneeeees 239 Adder eC omipiler Bit ld icctssccnecsiectuesezesiayesgeuteateseeactaccuaenfosicueyenentesesaetuespiedeeias 255 Ada PAL Compiler Property Page eeseeeseseeeseseresesrresressrserrsressrseresressrsererressessee 260 Target Code Generation On Ada PAL Compiler Project 0 0 0 eeeeeeeeeereeeeeeeee 262 Manual Modifications to Projects files generated by Target Code
148. ete the Full build or click Cancelto stop the Ada Build process as shown in Figure 136 Figure 136 Ada Full Build Ada C C Changer Build The Ada Build process will incrementally compile the Ada Files that have been modified or added since the last build Press OK to update your current project with the newly generated C C files Press Cancel to stop the Ada Build process i Cancel MAPUS QFT Porting Made Easy 228 OS PORTING AND ABSTRACTION LAB USER MANUAL 4 The Ada C C Changer project starts to build and generates the exe file as shown highlighted in Figure 137 Figure 137 Building Ada C C Changer project PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools rye OOR PRO B Window FEY PAL Profiler pat Projects BB DDDDE Gee Al E Prob E Prope iG Progr E console 33 Sve senda C Build proj1 BR rf ri ae TIAP a ee auuu CC support include include 00 g3 ia i Vall c fmessage length 0 oada2ZCC supportirtli IL system rts ta sking_interface bdy o ada2CC support rtl IL system rts t asking interface bay c vl ne Iproji NOTE While running any Ada project after build the project sometimes will again build the project before running the application To avoid this do the following configuration Select Window gt Preferences
149. example if a converted Ada to C C project that was integrated with OS Abstractor and includes the POSIX Interface were optimized for a windows target it would look like follows lt target dir gt cross os windows source include specific posix interface source include specific include include rtl XIL src IL MAPUS FT Porting Made Easy 233 OS PORTING AND ABSTRACTION LAB USER MANUAL lt app name gt ada2C lt app name gt source include The lt target_dir gt is the directory location where the generated code would be placed The Cross OS and OS Interface directories will include project files specific to your target Project files for the RTL will only be included for Windows and Linux targets On a Windows target you will get a project file for the Eclipse IDE and on Linux you will get both Eclipse and make files For all other targets and toolsets you will need to create an RTL library project An application project will be created for the target but it will require some manual modifications to build The modifications which need to be made to the application project are as follows Header Inclusion Add include paths for the Ada RTL component lt target dir gt rtl lt target dir gt rtl sre lt target dir gt rtl IL Add include path for any other C library that you need for your application if your Ada project is integrated with Cross OS you will need to add the following lt target dir gt in
150. features not applic Vineela backup C Automatically select mirror z Folder mapusoft ospal updatesite MAPUS QFT Porting Made Easy 22 OS PORTING AND ABSTRACTION LAB USER MANUAL 4 On Edit Local Site pop up window next to Name text box provide a different name and click OK The name can be any name that is not already present on the list as shown in Figure 14 and click Finish Figure 14 Update Sites to Visit PAL Install al x Update sites to visit Select update sites to visit while looking For new Features E Sites to include in search F A Business Intellegence and Reporting Tool BIRT Updates New Remote Site g A Business Intellegence and Reporting Tool BIRT Updates C Eclipse ModeliggEransuosk ieme Lodata New Local Site 3 i te Edit Local Site ST uropa Disca F lospat Upda Name Imapusoft ospal updatesite F The Eclipse H URL file D mapusoft ospal updatesite Import sites Export sites Ignore features not applicable to this environment C Automatically select mirrors Next gt Finish MAPUS QFT Porting Made Easy 23 OS PORTING AND ABSTRACTION LAB USER MANUAL 5 On Updates Search Results window select the features under Others tree parent and click Next as shown in Figure 15 Figure 15 Search Results PAL Updates Search Results Select Features to install From the search result list Se
151. for the length of the page Note By default the value is 66 Page Width Specifies the width of the page Enter a value for the width of the page Note By default the value is 80 Listing only of Specifies if you want lines with to list only lines with errors or errors or warnings warnings Select the check box Cross Reference Listing No cross reference listing Specifies if you want to generate a cross reference listing To not to generate a cross reference listing select the radio button Note By default this is enabled Produce cross reference listing Specifies if you want to generate a cross reference listing To generate a cross reference listing select the radio button Note By default this is disabled MAPUS FT Porting Made Easy 242 OS PORTING AND ABSTRACTION LAB USER MANUAL 5 On Ada Messages tab describe Ada message options as shown in Figure 145 Figure 145 Ada Messages Tab PAL Ada PAL Compiler Configuration options Set your configurations For Ada PAL Compiler tool Ada Source Ada listings Ada messages Ada drivers Additional Error messages Error messages Show errors in with ed files Limit on number of error messages p99 Warning messages M Warning messages C Show warnings in with ed files Info messages Info messages nh ed Mes Message Format Show given error message only once O
152. gacy C Code as shown inFigure 73 You can also click on the Porting icon amp from the task bar Figure 73 Importing micro ITRON Legacy C Code in OS PAL PAL Projects OS Porting and Abstraction Lab File Edit Source Refactor Navigate Search Project Run Tools Window Help ie im DOR BO M O Q FE Pat Profiler pat Projects Resource VxWorks gt p505 gt Fe C C Projects 53 o AE R b gt gt me 5 POSIX oe 2 Problem gums TR a Al ada2 tmicro ITRON A O items Windows r gt Import Legacy C Code f emo_ada_to_c Demo sce toc Description Resource amp demo_cross_os demo_nucleus J demo_posix demo_psos oe Ee a a demo_uitron demo_vxworks demo_windows F idemo_ada_to_c MAPUS QFT Porting Made Easy 100 OS PORTING AND ABSTRACTION LAB USER MANUAL 2 On OS PAL Import window select the root directory from where you want to import the legacy code by clicking on Browse button next to the text box and click Next as shown inFigure 74 Figure 74 Import micro ITRON Legacy Code Window Ek Import micro ITRON Legacy Code IA Select a Directory to Import Legacy Code Into OS PAL Root Directory D legacy uitron Project Name uitron_legacy Root Task Prototype VOID uITRONRoot UNSIGNED argv Root Task Stack Sizefin bytes OS_MIN_STACK_SIZE 3 Enter the project name for which you want to import the legacy code in
153. ge and total API execution times e It enables you to collect data pertaining to the MapuSoft API s Platform API profiling and profiling user specific functions Application Profiling e Users can analyze the data with the included OS PAL Profiler graphical viewer which offers area bar line pie and scatter charts as shown in Figure 105 e Profiler enables you to generate a Timing report to view the performance report for each API e OS PAL Profiler now enables you to generate Timing Comparison Report This compares two different timing reports and compares the performance report for an API at different time and different values NOTE 1 In the current release Profiler feature is not supported in ThreadX and Nucleus targets NOTE 2 The profiler feature does not generate profiler file XXX PAL on Solaris target if you do code optimization for demo_cross_os with profiler ON As a workaround enter the following command at the prompt prior to running the demo prctl n process max msg qbytes r v 512KB i process The 512KB is the desired size of the queue and should be sufficient to run this example If the number of messages is increased in cross_os_usr h then obviously this value will need to be adjusted MAPUS FT Porting Made Easy 168 OS PORTING AND ABSTRACTION LAB USER MANUAL Figure 105 OS PAL Profiler PAL Profiler OS Porting and Abstraction Lab File Edit Navigate Search Project Run Tools Window Help Tes
154. gt Run Debug gt Launching Under General Options deselect the check box for Build if required before launching flag MAPUS QFT Porting Made Easy 229 OS PORTING AND ABSTRACTION LAB USER MANUAL 5 You can view the generated exe file under the project in the DebugFolder as shown in the Figure 138 Figure 138 Generated exe File PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help m SOX BO M A a FEY pat Profiler PAL Projects TBC Projects 52 o Bey j gt w adapal_1 demo_cross_os demo_nucleus demo_posix demo_psos demo_uitron demo_vxworks T projl oe Binaries fA Includes gS ada2cc Gm adaRoot Debug amp ada2Cc proji exe x86 ADA LIB B UNIT MAP B ada_config H H 6 6HE 2 Probl E Prope e Progr E console 3 ie C Build proj1 iF Be g miz jadaZ2CC proji source init os anit anil idroid o lada2cc proji source Sudoku_Test eltab lo leross_os lwinmm Build complete for project projl Time consumed 84953 ms ane proji Debug projl exe NOTE 1 When you build Ada C C project you may get many warnings MAPUS FT Porting Made Easy 230 OS PORTING AND ABSTRACTION LAB USER MANUAL Ada C C Changer Property Page Ada C C Changer Property Page enables you to change or modify the configuration options you have se
155. gure 142 Ada PAL Compiler Wizard Ada PAL Compiler New Ada PAL Compiler Project Select the directory containing your Ada files Project Name Use default location Ada Root Source Directory Main Ada procedure Enter Ada file extensions used in your Ada project C Specify option file MAPUS QFT Porting Made Easy 237 Field OS PORTING AND ABSTRACTION LAB USER MANUAL Description The field descriptions for Import Ada Files page are as follows Your Action Project Name Specifies the user specific project name Enter a name to the project you want to create Use Default Specifies the default location Enable the check box to use the default Location for project creation location for your project If you want to specify another location disable the check box and browse to the necessary folder location Note By default this is enabled Ada Root Specifies the root directory Select the root directory by clicking Source which consists of Ada files Browse Direct ith th ified extensi ad ih the A 1ed extensions Note You cannot enter anything in the Note You can add multiple root directory text box source directories in Ada If you choose an empty directory PAL Compiler Configuration helloworld ada will be copied into this page directory Main Ada Specifies the main procedure Enter the main Ada procedure name procedure name of the project the user
156. he Target OS name you selected this Select the appropriate specifies the available version names listed in the target version Version drop down list SMP This specifies the Symmetric Multi processor Select this if your target supports SMP or UP Kernel If applicable to the Target OS name and version Select the Target kernel Mode this specifies the following modes mode by selecting it from e User mode the drop down list e Kernel mode Architectur This specifies the architecture of the Target OS Select the architecture e The options are you need e 32 bit e 64 bit Target Specifies the type of target hardware used to Select the type of target Hardware complete code optimization hardware used The Note You can select the target hardware only options are when you select VxWorks as your target OS PPC PPC_604 X86 ARM M68K MCORE MIPS SH SIMLINUX SIMNT SIMSO LARIS SPARC Load This specifies the following two options to load Select the option to load Settings settings from settings from by e Previous If you select Previous then initial selecting from the drop values for this wizard are loaded from down list previously saved settings and populated e Default If you select Default then the values from default settings are populated Generate a Specifies if you want to generate a project file Select the check box Project File next to Generate project file Project Specifies the different target project types that you
157. he mail process NOTE Default value is 0 Task Preemption Mode for the Main Process Specifies the preemption status of this task Enter the task preemption status of the task NOTE The valid parameters are OS_PREEMPT Task can be pre empted by the system OS_NO_PREEMPT Task cannot be pre empted MAPUS FT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL 142 OS PORTING AND ABSTRACTION LAB USER MANUAL 12 On Memory configuration tab configure the options to your specifications as shown in Figure 95 Figure 95 Memory Tab Optimized Target Code Generator This wizard optimizes target specific source code P Task Process Memory Other Resources Debug I Output Devices ANSI Mapping Device I O Interface Maximum Variable Memory Pool Control Blocks 100 Maximum Fixed Memory Pool Control Blocks 100 Maximum Tiered Memory Pool Control Blocks 10 Maximum Tiered Shared Memory Pool Control Blocks 100 Minimum Variable Pool Allocation Size in Bytes 4 User Shared Memory Region Size 1024 L gt 143 The field descriptions on Memory tab are as follows Field Description Your Action Maximum Variable Memory Pool Control Blocks Specifies the total number of dynamic variable memory pools required by the application Enter the maximum number of dynamic variabl
158. here the profiler file will be created Enter a data file path The default location set is root on Unix based machines and c on MS Windows machine Number of Data in Memory Before Each Write Specifies the depth of the profiler queue Enter the number of data in memory before each write The default value is set to 3000 Maximum Profiler Data to Collect Specifies the maximum records collected in the XML file Enter the number of profiler messages The default value is set to 30000 MAPUS FT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL 132 OS PORTING AND ABSTRACTION LAB USER MANUAL 6 On Platform API Profiling tab select the check box to enable your appropriate Interface API Profiling as shown in Figure 90 Figure 90 Platform API Profiling Optimized Target Code Generator This wizard optimizes target specific source code Profiler Configuration Platform API Profiling Application Functions Profiling Interface API Profiling e API Profiling Cancel MAPUS QFT Porting Made Easy ee I933 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on Platform API Profiling tab are as follows Field Description Your Action Enable Cross OS Interface API Profiling Specifies if the Cross OS Interface API Profiling feature is enabled or disabled Select the check box to enable
159. id 05_Get_Events i Comer ie 05_Sleep_Task m 05_lake_Semaphore i OS _Get_Semaphore_Count j OS_Give_Semaphore i O _Delete_Semaphore OUE OER O Clee T Cee m OS_Deallocate_Partition 0S_Delete_Partition_Pool O Cees Property _ Value OS_Suspend_lask Average execution time 22 684 490 626 Nano Seconds O Ceca ces Instance with the longest exe 1 Task_1 ie OS_Get_Queuve_id Instance with the shortest ex 1 Task_1 1 Task_1 Instances of OS Create Event_Grou p Function X axis shows Api Iteration Thread Name Time Nano Seconds E Properties 53 MAPUS QFT Porting Made Easy 176 OS PORTING AND ABSTRACTION LAB USER MANUAL Application Functions These are all the user specific functions called in the application On the x axis all the user specific functions are displayed On the y axis all functions iterations are displayed On the bottom of the window the function properties are displayed as shown in Figure 112 such as e Average Function execution time e Function with the longest execution time e Function with the shortest execution time e Number of times Application Functions are called in application Figure 112 Application Functions PAL Profiler OS Porting and Abstraction Lab File Edit Navigate Search Project Run Tools Window Help Sf wh iad om ABB ai wie Fy PAL Profiler Debug PAL Projects PAL Profiler Data Explorer 3 1 pat Profiler View
160. ies containing the MapuSoft products needed to run their application on the new OS Figure 85 Full Library Package Generation Folder File Edit View Favorites Tools Help Back gt E Search Folders E B Folder Sync Address ps stsnd Folders x Name Size Type Date Modified Local Disk C A Dcross_os_windows File Folder 11 24 2011 12 10 PM E Local Disk D include File Folder 11 24 2011 12 10 PM S O 1_3_7_TestBuilds vxworks_interface File Folder 11 24 2011 12 10 PM E E 8d4531aaa8da63bbff39fe3bfde0 C demo_cross_os File Folder 11 24 2011 12 10 PM ALL_WRSLicenses E demo_vxworks File Folder 11 24 2011 12 10 PM applications docs File Folder 11 24 2011 12 10 PM amp applications2 libs File Folder 11 24 2011 12 10 PM Cantata _6_0 CodeGen LabPC_WRS_License Linux_Labmachine_OSPAL_License E O MagicIso a O opt E O Repos Share O special E O stsnd D temp 8 vector CAST machines E WindRiver D DVD RAM Drive E HS Local Disk F E Se New Volume G a O ECLIPSE e ES E3 MapuSoft provides source and libraries in the following folder structure MAPUS QFT Porting Made Easy 120 OS PORTING AND ABSTRACTION LAB USER MANUAL The standalone library package will require the header files The directory structure should be the same as a standalone source package without the source Mapusoft Cross os windows Include lt headers gt Sou
161. ies if you want to select the info messages You can do any one of the following e To select info messages select the check box e To show infos in with ed files select the check box Message Format Specifies the format of the message You can do any one of the following e To show given error message only once select the radio button Note By default this is enabled e To show message on each line it applies select the radio button MAPUS FT Porting Made Easy 217 OS PORTING AND ABSTRACTION LAB USER MANUAL 7 On Ada Drivers tab set your driver options as shown in Figure 129 Figure 129 Ada Drivers Tab B Ada CiC Changer Configuration options Set your configurations for Ada C C Changer tool Ada Source Cic output Ada listings Ada messages Ada drivers Mode Verbose Normal Quiet MAPUS QFT Porting Made Easy 218 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions for Ada driver options tab are as follows Field Description Your Action Mode Specifies the required You can do any one of the following mode for reporting the compiler actions e To select the verbose mode select the radio button e To select the normal mode select the radio button Note By default this is enabled e To select the quiet mode select the radio button 8 On Additional Options tab set your misce
162. igure The value should be in bytes MAPUS QFT Porting Made Easy 98 OS PORTING AND ABSTRACTION LAB USER MANUAL 6 Click Finish to complete the importing of legacy code into OS PAL You can see POSIX legacy code you have imported as shown in Figure 72 Figure 72 Importing pSOS Legacy Code Output PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help C3 Dair BO B ff El e FEY pat Profiler pat Projects Resource FE CiC Projects 53 o 2 BF ii a Al demo_ada_to_c demo_cross_os demo_nucleus demo_posix demo_psos demo_uitron demo_y xworks nucleuslegacy posixlegacy Ge E Console E Properties 3 i Progress IGE Ege ai o Property Value 9 items selected You have successfully imported pSOSlegacy C code and a project with your given project name is created in the current workspace MAPUS QFT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL Porting micro ITRON Legacy C Code This section explains porting of micro ITRON Legacy Applications using OS PAL Porting Plugin A sample porting of micro ITRON Legacy applications using OSPAL is described with an example here NOTE This feature requires a license Click http mapusoft com downloads ospal evaluation to request an evaluation license 1 Select File gt Porting gt micro ITRON gt Import Le
163. ile system which contains the source code files and click OK as shown in Figure35 Figure35 Importing Source Code Files from Directory import from directory Select a directory to import From O Share Folder_Vineela Songs E O Vineela backup xworks demo to port E GA DVD RAM Drive E H O Shared Documents gD vineelavasan s Documents my Network Places Folder vxworks demo to port MAPUS QFT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL 5 Select the check boxes corresponding to the source code files you want to import and click Finish as shown in Figure 36 Figure 36 Selecting Source Code Files for Importing im port File system Import resources From the local file system From directory D xworks demo to port v demo h init c os_application_start c os_entry c windDemoOriginal c windDemoPorted c AlE works demo to port SPSS KSI CSCS Filter Types Deselect All Into Folder Example _ Browse Options CT Overwrite existing resources without warning Create complete folder structure Create selected Folders only MAPUS QFT Porting Made Easy 60 OS PORTING AND ABSTRACTION LAB USER MANUAL 6 You can view the source code files added to your OS PAL project as shown in Figure 37 Figure 37 Importing Source Code Files Output PAL Projects samplefdemo h OS P
164. ing POSIX Interface Before building the POSIX Interface library and or application ensure that the flags INCLUDE_OS_POSIX is set to OS_TRUE in the cross_os_usr h configuration file MAPUS QFT Porting Made Easy 162 OS PORTING AND ABSTRACTION LAB USER MANUAL Building POSIX Interface Library The POSIX Interface library is located at mapusoft posix_interface directory From this location you will find the make files or project files at the appropriate specific lt OS gt lt tool gt lt target gt directory For instance if you need the demo application to be built for POSIX OS using Eclipse tools and for x86 target then the make file location will be at specific posix lt OS gt x86 elipse directory Building POSIX Interface Demo Application The demo application is located at the mapusoft demo_posix directory location From this location you will find the make files or project files at the appropriate specific lt OS gt lt tools gt lt target gt directory For instance if you need the demo application to be built for POSIX OS using Eclipse tools and for x86 target then the make file location will be at specific posix lt OS gt x86 eclipse directory We need to have the Cross OS Interface Library It has to be included in all the Interface demos After every demo application include link in the POSIX Interface library Nucleus Interface The Nucleus Interface library contains the following m
165. ings ae R License gt 57 m Ta CiC Projects oo E Full Library Package Generator AD Ada C C Changer Ea E demo_ada_to_c C demo_cross_os E C demo_nucleus es demo_posix demo_psos D mD demo_windows C sample amp amp Bg Problems El Console 22 E Properties No consoles to display at this time MAPUSS FT Porting Made Easy 206 OS PORTING AND ABSTRACTION LAB USER MANUAL 2 On Import Ada Files page enter the Ada project inputs as shown in Figure 124 Figure 124 Ada C C ChangerWindow Ada CiC Changer Import Ada files Select the directory containing your Ada files Root directory C C project name C Main Ada procedure Enter Ada file extensions used in your Ada project C Specify option file Cancel NOTE OS PAL now provides support to multiple Ada source directories You can browse and select the multiple source directories on the Ada C C Configuration Options gt Additional tab MAPUS QFT Porting Made Easy 207 Field OS PORTING AND ABSTRACTION LAB USER MANUAL Description The field descriptions for Import Ada Files page are as follows Your Action Root Directory Specifies the root directory which consists of Ada sources that needs to be converted to C Sources Select the root directory by clicking Browse C C Project Name Specifies the user specific project name NOTE
166. ion select Ada PAL Compiler Project gt Properties gt C C Build gt Settings MAPUS FT Porting Made Easy 251 OS PORTING AND ABSTRACTION LAB USER MANUAL 12 To generate the exe file select the Ada PAL project you have created and right click and select Build Project as shown in Figure 151 Figure 151 Building the exe PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help S HOo amp i2O8 6 H gt O yi Fy Pat Profiler pat Projects l T CiC Projects X e JA projl E Probi E Prope G Progr E console 7 0O C Build adapal_1 amp Be re g rir Se rep ano oy O Space yaaa pat da2CC support rtl sre 00 g3 Wall ial c fmessage length 0 oada2CC support cross_os_ windows sou ree os_write o ada2CC support cross_os_windows so urce os_write c J 0 gt jadapal_1 Build Project 7 C 252 OS PORTING AND ABSTRACTION LAB USER MANUAL 13 To view the exe file generated expand the project you have created and expand the Debug folder You can view the exe file generated by the Ada PAL Compiler as shown in Figure 152 Figure 152 exe file PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help im O2OR BPOo HB FEY Pat Profiler pat Projects Fig Cic Projects 3 adapal_1 Ha Includes pS ada2c
167. ions of the compiler for source files or units in the current program library if e The source file containing a needed unit has either never been compiled e Or has been modified since it was last compiled MAPUS FT Porting Made Easy 200 OS PORTING AND ABSTRACTION LAB USER MANUAL e Ora source file on which a unit depends has been modified since the unit was compiled The program builder uses time stamps to determine if a source file has been modified The prelinking phase handles all of the compilation order and completeness requirements for building the Ada program If a part of the program is missing or if the Ada source code contains incorrect dependencies the prelinking phase will detect and report this Linking The linking phase of the program builder is handled by the linker See your manual for the specified target linker for more information The linking phase uses the default C runtime library as well as the Ada run time library adabgen Inputs Invocation adabgen option main procedure name The adabgen command creates an absolute load module for the main procedure The adabgen command must be invoked in a program library directory If the current directory is not a program library directory a program library is automatically created there The main procedure name must be a procedure for which the Ada source for all needed units is located either in the program library or in one of the linked libraries M
168. is augmented by additional function libraries for improved ISO C 99 compatibility and further by community supported add on tools and libraries many pre built many more in the form of mingw PORTS to be built by the end user MinGW provides a complete Open Source programming tool set which is suitable for the development of native MS Windows applications and which do not depend on any 3rd party C Runtime DLLs MAPUS FT Porting Made Easy 39 OS PORTING AND ABSTRACTION LAB USER MANUAL GNU Compiler The GNU Compiler Collection includes front ends for C C Java as well as libraries for these languages such as libstdc libgcj OS PAL Supplied GDB A debugger is a computer program that is used to test and debug other programs the target program The code to be examined might alternatively be running on an instruction set simulator ISS a technique that allows great power in its ability to halt when specific conditions are encountered but which will typically be somewhat slower than executing the code directly on the appropriate processor Some debuggers offer two modes of operation full or partial simulation to limit this impact Typically debuggers also offer more sophisticated functions such as running a program step by step single stepping or program animation stopping breaking pausing the program to examine the current state at some event or specified instruction by means of a breakpoint and tracking the v
169. it Navigate Search Project Run Tools Window Help mm a PAB iv Pat Profiler ec Debug PAL Projects Pat Profiler Data Explorer z m Pa Profiler View sa fo fo bol ho gos J PAL profiler_data_1210343811 system lt Functions CE Platform APIs a O Application Eunction Threads 6 y pid 03 fa OS_Get_Events m fas LTA 222 Bee j ia gt 4 OS_Protect OS _Unprotect phore Sleep_Task OS_Take_ Semaphore phore_Count OS_Create_Task OS_Slee OS _Get_Sema OS_Set_Task_Priorit OS_Create_Sema OS_Give_Sema OS_Get_Current_Task_Id Function Iterations OS_Create_Event_Grou OS_Get_Event_Grou Platform API lt E Properties 33 Property Average Function execution t 7 204 292 906 Nano Seconds Function with the longest exe OS_Get_Current_Task_Id Function with the shortest ex OS Delete Oueue gt lt 4 Platform APIs These are all the Cross OS Interface functions called in the application On the x axis all the functions are displayed On the y axis all functions iterations are displayed On the bottom of the window the function properties are displayed such as e Average Function execution time e Function with the longest execution time e Function with the shortest execution time e Number of Cross OS Interface Functions called in application MAPUS QFT Porting Made Easy 174 OS PORTING AND ABSTRACTION LAB USER MANUAL If you
170. ixlegacy psoslegacy J simple _vxworks_app uitronlegacy HAA E ih E 2 m El console Properties 3 Progress E Property Value MAPUSS FT Porting Made Easy ne B G OS PORTING AND ABSTRACTION LAB USER MANUAL b On Full Library Package Generator window select the required Target OS from the list and click Next as shown inFigure 81 Figure 81 Select Target OS Package Generation Choose a target OS from below and select next to continue qrtseencessesceneg Resenascacesceneens ORT Linux O Android O Windows O micro ITRON QNX O VxWorks NetBSD Nucleus Omax O Solaris O LynxOS O Linux O ThreadX Cancel MAPUS QFT Porting Made Easy 116 OS PORTING AND ABSTRACTION LAB USER MANUAL c Select the development OS APIs needed to generatefull library package and click Next as shown inFigure 82 Figure 82 Select OS Changer or OS Abstractor Products Full Library Package Generator Choose your current and or development OS APIs Select next to continue Cross OS Interface Nucleus Interface VxWorks Interface pSOS Interface micro ITRON Interface Windows Interface MAPUS QFT Porting Made Easy 117 OS PORTING AND ABSTRACTION LAB USER MANUAL d Select the destination path to save the generated package and click Finish as shown in Figure 83 Figure 83 Select Destination Path Package Generation Choose a destination path and select
171. ject you have created as shown in the Figure 133 File Edit Source Refactor Navigate Search Project Run Tools Window Help iO BES Ri2OX BO Mi O Q iW i h S fy PaL Profiler PaL Projects Resource ea EL Problems El console 2 E Properties 5 Navigator E Progress Ex BE rf coe gt Ada C C Changer Building projectsvserccveses ACG_CEMO sees e ee eeeee D _ECLIPSE eclipse_helios 3 6 Tools Ada windows bin adaopts exe 1 D _ECLIPSE eclipse_helios 3 6 Tools Ada windows bin adaopts exe e er Info Creating new library for default target from D _ECLIPSE eclipse Aj chg_win_cpp GH Ag cho_win_gnat Ag heom_win_gnat D _ECLIPSE eclipse_helios 3 6 Tools Ada windows bin adaopts exe 1 Al heomp_cpp D _ECLIPSE eclipse_helios 3 6 Tools Ada windows bin adaopts exe Al Sudoku_Test E E windows_x86_eclipse_cpp_rtl w p windows_x86_eclipse_cross_os_rtl D _ECLIPSE eclipse_helios 3 6 Tools Ada windows bin adaopts exe 1 EES windows_x86_eclipse_gnat_rtl D _ECLIPSE eclipse_helios 3 6 Tools Ada windows bin adaopts exe B windows_x86_eclipse_rtl alli il joniiim o MAPUS FT Porting Made Easy 224 OS PORTING AND ABSTRACTION LAB USER MANUAL The Ada C C Changer project has the following files e Includes This folder contains the header file paths of your project e Ada2CC This folder contains all the files generated by Ada to
172. k value 5 NOTE Since the system clock tick OS_TIME_RESOLUTIO resolution may vary across N different OS under different target it is recommended that the applicationuse the macro OS_TIME_TICK_PER_SEC to derive the timing requirementinstead of using the raw system tick value in order to keep the application portable across multiple OS Default Specifies the default Enter a default timeslice for Timeslice for time slice scheduling standard tasks Standard window width among NOTE The default value is 10 ms Tasks the same priority pre If system tick is 10ms then the OS_DEFAUL emptable threads when threads will be scheduled round T_TSLICE they are all in ready robin at the rate of every 100ms state NOTE On Linux operating system the time slice cannot be modified per thread Cross OS Interface ignores this setting and only uses the system default time slice configured for the Linux kernel Enable Task Pooling Feature Specifies if the Task pooling feature is enabled for this application Task pooling feature enhances the performances and reliability of application If you enable the task pooling feature applications can create Cross OS Interface tasks during initialization and be able to re use the task envelope repeatedly To configure task pooling set the following pre processor flag as follows INCLUDE_OS_TASK_ PO To enable task pooling feature select the check box MAPUS FT
173. lect the features to install SERIF OSPAL Update Site Deselect All 00 Other gt OS PAL Core Feature 1 3 5 1 More Into Properties Select Required Error Details OS PAL 1 3 5 Update Site 1 of 1 selected Show the latest version of a feature only C Filter Features included in other features on the list MAPUS QFT Porting Made Easy 24 OS PORTING AND ABSTRACTION LAB USER MANUAL 6 On Feature License window select the radio button next to I accept the terms in the license agreements and click Next as shown in Figure 16 Figure 16 Feature License Agreement PAL Install Feature License Some of the features have license agreements that you need to accept before proceeding with the installation gos PAL Core Feature 1 3 5 1 Yolicense OI do not accept the terms in the license agreement MAPUS QFT Porting Made Easy 25 OS PORTING AND ABSTRACTION LAB USER MANUAL 7 On Installation window you can view the features that are going to be installed and the Installation Directory as shown in Figure 17 and click Finish NOTE You can change the Installation Directory if you want to by clicking Change location Figure 17 Feature Installation PAL Install Installation The Following Features will be installed You can select a feature and change the location where the Feature will be installed Features to install Feature Name Feature Yersio
174. ler The primary difference between the multiple source directories model and the multiplelinked libraries model is what happens when adabgen discovers that a source file needs tobe re compiled e Ifthe source file is part of this program library adabgen will recompile it e Ifthe source file comes from a linked library adabgen will refuse to recompile it and will givean error message Therefore the multiple source directories model is more convenient for most projects MAPUS FT Porting Made Easy 191 OS PORTING AND ABSTRACTION LAB USER MANUAL Contents of the Ada Tools ADA LIB and UNIT MAP An Ada tools contains two files ADA LIB and UNIT MAP These two files which are located in the project are automatically created the first time the Ada compiler is invoked ADA LIB contains information describing the configuration of the library UNIT MAP contains a unit to source mapping for use by the compiler and program builder When the program library is created if a UNIT MAP file already exists in the current directory it will be used for the new program library s UNIT MAP Source Files The Ada source files in the program library include e All Ada source files in the program library directory e All Ada source files in directories specified in the program library s source directory list e Any other source files which have been registered in the UNIT MAP e To be automatically recognized as Ada sour
175. lications Explains how to import legacy applications Explains how to do code optimization Explains how to generate library packages e Explains on Application profiling and platform profiling Cross OS Manual Interface Reference Provides detailed description of how to use OS Abstraction This guide e Explains how to develop code underlying OS e Explains how to make your software easily support multiple OS platforms independent of the VxWorks Manual Interface Reference Provides detailed description of how to get started with VxWorks interface support that MapuSoft provides This guide e Explains how to use VxWorks interface port applications micro ITRON Reference Manual Interface Provides detailed description of how to get started with micro ITRON interface support that MapuSoft provides This guide e Explains how to use applications micro ITRON interface port Interface Reference psoOs Manual Provides detailed description of how to get started with pSOS interface support that MapuSoft provides This guide e Explains how to use pSOS interface port applications psos Classic Reference Manual Interface Provides detailed description of how to get started with psOS Classic interface support that MapuSoft provides This guide e Explains how to use pSOS Classic applications interface port Nucleus Interface Manual Reference Provides detailed description of how to
176. ll C Output Only O Include C namespace Exceptions Header files Association Place 4 and on same line as associated construct O Place 4 and on their own line Checks Suppress all checks in generated C code O Suppress numeric overflow checks in generated C code O Include all run time checks in generated C code Limit on the length of generated C source line 80 When you do an Ada Build the project will build the sources according to the recent changes you have made to the Ada Configuration Options For more information about Ada Configuration Options refer to Ada C C Changer Configurations Options section NOTE For Ada C C Changer project from Properties page if you change Ada Main procedure it will not build the project with that procedure immediately You need to select the project and refresh 1 2 times and clean the project and then do the build MAPUS QFT Porting Made Easy 232 OS PORTING AND ABSTRACTION LAB USER MANUAL Target Code Generation for Ada C C Changer Projects OS PAL allows only Target Code Generation for Ada C C Changer Projects when the projects are created with OS Abstractor Integration Ada C C Changer projects cannot be code optimized For Ada C C Changer projects created without OS Abstractor Integration Target Code Generation should not be done The generated code WILL NOT work since there is no call to OS_Application_Initialize For Ada PAL Compiler
177. llaneous options You can also select the multiple Ada source directories and click Next as shown in Figure 130 Figure 130 Additional Options Tab ada cic Changer Configuration options Set your configurations for Ada C C Changer tool Ada Source C C output Ada listings _ Ada messages Ada drivers Additional C Add GNAT Compatibility MAPUSS FT Porting Made Easy 219 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions for additional options tab are as follows Field Description Your Action Additional Specifies ifyou want To specify additional options select the check Options to include any other box and enter a value in the text box additional options such as custom or optional Add GNAT Specifies if you want To add GNAT compatibility select the check Compatibility to add GNAT box Compatibility eae ae par want This feature is disabled on Windows aaa ie Pier On Linux to add POSIX compatibility select Compatibility the check b Note This feature is e CRECE BOX not supported on Windows It is supported on Linux only 9 On OS Abstractor Integration page select the check box to enable OS Abstractor integration To link the OS Abstractorcomponents to the generated C Source Code select the check box for the corresponding interfacesupport from the available list and click Finish as shown in Figure 131 NOTE 1 If no OS Abstractor Integration is
178. mation dialogue box is displayed on your screen to ask if you want to port the project If you want to port click OK You can see the porting processing results on the window 9 After the porting is successfully done the porting report page is displayed as shown inFigure 58 Click Done to complete the process Figure 58 Porting Reports Page Porting Report Q Displays the Information about different activities involved in Porting Inputs Provided Status SUCCESS Description Input Values Provided for Project simple_vxworks_app simple_vxworks_app Project Ported Successfully Guidelines Status WARNING Description Status Require Application Code Modification Porting steps completed successfully In order to successfully compile your application the Following manual code changes may be required 1 Remove xWorks header file references Use the following header files Sect nd nf tha Mol Merl handar Chan v MAPUS QFT Porting Made Easy 83 OS PORTING AND ABSTRACTION LAB USER MANUAL 10 In order to successfully compile your application follow the guidelines highlighted inFigure 59 Figure 59 Porting Reports Page_ Guidelines Porting Report Displays the Information about different activities involved in Porting Project Porting Status SUCCESS Description simple_vxworks_app Project Ported Successfully Guidelines Status WARNING Description Status Require Application Code M
179. me Win_legacy Root Task Prototype int win_maintint argc Root Task Stack Size in bytes OS_MIN_STACK_SIZE 3 Enter the project name for which you want to import the legacy code in the Project Name text box as shown in the figure 4 Enter the root task prototype like intwin_main intargc next to Root Task Prototype text box as shown in the figure 5 Enter the root task stack size next to the Root Task Stack Size text box as shown in the figure The value should be in bytes MAPUS QFT Porting Made Easy 104 OS PORTING AND ABSTRACTION LAB USER MANUAL 6 Click Finish to complete the importing of legacy code into OS PAL You can see Windows legacy C code you have imported as shown in Figure 78 Figure 78 Importing Windows Legacy Code Output PAL Projects OS Porting and Abstraction Lab File Edit Source Refactor Navigate Search Project Run Tools Window Help rI im 2OR OO M i O Q ig FEY pat Profiler PAL Projects B Resource Fig cic Projects 53 Pap al demo_ada_to_c demo_cross_os demo_nucleus demo_posix demo_psos demo_uitron demo_yvxworks demo_windows Win_legacy fH my Includes Problems E console z Koperio is naia H C Build win_legacy L gt 5l 5 Ai amp rm Ely r lication_start c 10 items selected You have successfully imported Windows legacy code and a project with your given project name is create
180. me of the application function in the text box and click Remove 8 Add your APIs by typing in the name of the API next to Enter Application Function text box and click Add and click Next MAPUS FT Porting Made Easy 136 OS PORTING AND ABSTRACTION LAB USER MANUAL 9 On API Optimization tab you can select either to generate Full API Library Interface or Optimized API interface In API Optimization you can select the API s which needs to be a standard function or a macro function and move the selected API using the double arrow button as shown in Figure 92 Macro functions will execute faster but will increase the memory footprint of the application and click Next Figure 92 API Optimization Optimized Target Code Generator This wizard optimizes target specific source code Generate Full API Library Interface Generate Optimized API Interface Files Select whether the 4PI needs to be a standard or a macro Function Macro Functions will be faster as they do not have a function wrapper To change a standard Function into a macro function select the name in the standard function column and click the gt gt arrow To change a macro Function to a standard function select the name in the macro Function column and click the lt lt arrow Standard Function Macro Function InstallDriver open close read write printf OS_Application_Init OS_Fatal_Error OS_Application_Wait_For_End ps_Initialize ps
181. n A sample porting of Windows Legacy applications using OSPAL is described with an example here NOTE This feature requires a license Click http mapusoft com downloads ospal evaluation to request an evaluation license 1 Select File gt Porting gt Windows gt Import Legacy C Code as shown in Figure 76 You can also click on the Porting icon from the task bar Figure 76 Importing Windows Legacy C Code in OS PAL PAL Projects OS Porting and Abstraction Lab File Edit Source Refactor Navigate Search Project Run Tools Window Help me m DOX BPO M O Q FE pat Profiler pac Projects Resource VxWorks A ma j o b305 TE cic Projects 24 Nucleus PA ov Rp a POSIX eA i Problem micro ITRON ana 1D items Windows E A demo_ada_to_c _ demo_cross_os demo_nucleus demo_posix a demo_psos C C H H A H D H demo _uitron demo_vxworks demo_windows E G demo_ada_to_c MAPUS QFT Porting Made Easy 103 OS PORTING AND ABSTRACTION LAB USER MANUAL 2 On OS PAL Import window select the root directory from where you want to import the legacy code by clicking on Browse button next to the text box and click Next as shown in Figure 77 Figure 77 Import Windows Legacy Code Import Windows Legacy Code Select a Directory to Import Windows Legacy Code into OS PAL Root Directory E LegacyDemos LegacyDemos demo_windows Project Na
182. n Feature Size Installation Directory Los PAL Core Feature 1 3 5 1 Unknown C JOSPAL Install Location C OSPAL Change Location Required space Unknown Free space 31 13 GB MAPUS QFT Porting Made Easy 26 OS PORTING AND ABSTRACTION LAB USER MANUAL 8 On Feature Verification window click Install All as shown in Figure 18 Figure 18 Feature Verification Verification Feature Yerification at 4 Warning You are about to install an unsigned Feature You may choose to install the feature or cancel its installation This feature has not been digitally signed The provider of this Feature cannot be verified Feature name OS PAL Core Feature Feature Identifier mapusoft ospal core feature_1 3 5 1 Provider Mapusoft Technologies Inc File Identifier mapusoft ospal core feature_1 3 5 1 Cancel 9 Once the new feature and plug ins have been downloaded successfully and their files installed into the product on the local computer a new configuration that incorporates these features and plug ins will be formulated Click Yes when asked to exit and restart the workbench for the changes to take effect You have now successfully installed new feature updates to your OS PAL MAPUS QFT Porting Made Easy 27 OS PORTING AND ABSTRACTION LAB USER MANUAL Chapter 2 OS PAL Components This chapter introduces all the OS PAL components They are as follows Introduction to OS PAL Components OS Simul
183. n how to use the compiler assembler and linker MAPUS FT Porting Made Easy 108 OS PORTING AND ABSTRACTION LAB USER MANUAL Error Handling Applications receive a run time error via the OS_Fatal_Error function on some occasions This happens due to e Unsupported API function call or e Unsupported parameter value or flag option in a API call or e Error occurred on the target OS for which there are no matching error codes in Cross O S Interface OS Changer calls OS_Fatal_Error and passes along an error code and error string The OS_Fatal_Error handling function is fully customizable to the application needs At the moment it prints the error message if the OS_DEBUG_INFO conditional compile option is set then OS_Fatal_Error does not return For more details on error handling and definition of this function refer to the Cross OS Interface Reference Guide The non zero value in the error code corresponds to the underlying RTOS API error Refer to the target OS documentation for a better description of the errors Error Handling section lists the errors and the reasons for the occurrence MAPUS FT Porting Made Easy 109 OS PORTING AND ABSTRACTION LAB USER MANUAL Chapter 5 OS Abstractor For Developing Portable Software OS Abstractor is designed for use as a C library Services used inside your application software are extracted from the OS Abstractor libraries and are then combined with the other application objects
184. n re start or termination requests Compile and link your application using appropriate development tools Download the complete application image to the target system and let it run NOTE Make sure to disable User Account Control UAC in order to have administration permission in Windows Vista and Windows MAPUS FT Porting Made Easy 112 OS PORTING AND ABSTRACTION LAB USER MANUAL Turning Off UAC In order to run our products successfully users need to turn off the User Access Control UAC To turn off UAC e On Windows Vista 1 Go to Start gt Control Panel gt Security Center gt Other Security Settings 2 Turn off User Access Control e On Windows 7 1 Go to Start gt Control Panel User Accounts and Family Safety User Accounts 2 Set the notification to Never Notify Refer to the sample demo applications provided with OS Abstractor as a reference point to start your application Please review the target processor and appropriate development tools documentation for additional information including specific details on how to use the compiler assembler and linker MAPUS FT Porting Made Easy ee EE OS PORTING AND ABSTRACTION LAB USER MANUAL Chapter 6 Full Library Package Generator MapusSoft enables you to generate a full library code package to create libraries and develop applications using your own IDE You can manually scale and configure the product by modifying the user configuration file
185. n requests 5 Compile and link your application using appropriate development tools 6 Download the complete application image to the target system and let it run Refer to the sample demo applications provided with OS Abstractor as a reference point to start your application Please review the target processor and appropriate development tools documentation for additional information including specific details on how to use the compiler assembler and linker Generating Binary Packages NOTE If you want to build a library as a Shared Library use the makefile named makefile_s under cross_os_xxxx specific x86 gnu makefile MAPUS FT Porting Made Easy 122 OS PORTING AND ABSTRACTION LAB USER MANUAL Chapter 7 Optimized Target Code Generator OS PAL s Optimized Target Code Generator generates porting and Cross OS interface source code optimized for your application This allows you to create project files This also includes the system settings you chose in the GUI based Wizard Note Before you begin refer to MapuSoft System Configuration Guide This chapter contains the following topics Generating Optimized Target Code Generating Project Files for your Target Inserting Application Code to Run only on Target OS Environment Inserting Application Code to Run only on Target OS Environment The user configuration is done by setting up the appropriate value to the pre processor defines found in the cross_os_usr h NOTE
186. nd calls OS_Application_Wait_For_End which will suspend until OS_Application_Free or OS_Delete_Process is called It also spawns the first OS Independents thread which is the true entry point for Cross OS Interface The application code starts in the os_library_init c file the user defined entry function and name of the application for Cross OS Interface can be specified in define OS ABSTRACTOR BASE ENTRY FUNCTION define OS APPLICATION START TASK NAME For Vxworksinterface the user defined entry function and stack size can be specified in define VXWORKS ENTRY FUNCTION define VXWORKS ENTRY FUNCTION STACK SIZE Similarly this is how it works for all the remaining changers abstractors You can insert code that is only included when they use OS PAL host in the following way e For windows host you can insert code in __os_init_windows_host c inside main function before calling OS_MAIN that is only included in OS PAL windows host e For Linux host you can insert code in __os_init_linux_host c inside main function before calling OS_MAIN that is only included in OS PAL Linux host You can insert code that is specific to a target OS inside main function before calling OS_MAIN in the following way e For LynxOS target insert in _os_init_lynxos c e For mqx target insert in __os_init_mqx c e For Linux target insert in __os_init_linux c e For Nucleus target insert in ___os_init_nucleus c e For QNX ta
187. nfigurations Make targets 4da Build Ada Clean Build Project Clean Project W E Di EE Copy D 6 in NE Past a mn in 2 Delete gt sq M al ove B TE Rename al D5 Import oF Ay Export 4 B C d mol is Pore pA ee eee ee ee Hf demo amp a demol S Refresh l 65b197e5280 da5 5 Close Project AGIC environment variable not se demo darie Run As 5ls Ada windows bin adacgen exe simple Debug s Convert To Team Compare With Restore from Local History E Properties i AI Eie PAl Comniler CH OSPaL1 1 Ri TA gt Properties Alt Enter MAPUS QFT Porting Made Easy 260 OS PORTING AND ABSTRACTION LAB USER MANUAL 2 The Ada PALCompiler property page is displayed as shown in the Figure 157 Make the necessary changes and click Apply 3 To change the Main Procedure Name on the Ada PAL property page click on Additional tab and make the necessary changes and click Apply Figure 157 Ada PAL Compiler Property Page PAL Properties for adapal1 type filter text Resource Ada Changer Property Page 4da Compiler Property Page Builders C C Build fH C C General O5 PAL Property Page Project References Refactoring History Run Debug Settings Ada Compiler Property Page D Ada listings Ada messages Ada drivers Source listing O No source listing Source listing only if errors O Always produce source listing Source listing Format
188. ng Made Easy 141 The field descriptions on Process tab are as follows Field Description Your Action Enable Cross OS Interface Process Feature Specifies if the Cross OS Interface process feature is enabled or disabled Select the check box to enable this feature Maximum Process Control Blocks Specifies the total number of processes required by the application Enter the maximum number of process control blocks for the application NOTE Default value is 100 Process Memory Pool Minimum Size in Bytes Specifies the minimum size of the process memory pool in Bytes Enter the minimum size of the process memory pool NOTE Default value is 1024 Bytes Process Memory Pool Maximum Size in Bytes Specifies the maximum size of the process memory pool in Bytes Enter the maximum size of the process memory pool NOTE Default value is Oxffffffff Bytes Stack Size for the Main Process in kilobytes Specifies the stack size for the main process in Kilobytes Enter the stack size for the main process NOTE Default value is 1024 200 Kilobytes Heap Size for the Main Process in kilobytes Specifies the heap size for the main process in Kilobytes Enter the heap size for the main process NOTE Default value is 1024 400 Kilobytes Task priority for the Main Process Specifies the task priority for the main process Enter the task priority for t
189. ng Using External Console Terminal Debugging can be done using an external console or terminal in the following way 1 From OS PAL main window select the demo_cross_os project 2 Right click on the project and select Debug as gt Open Debug Dialog as shown in Figure 46 Figure 46 Open Debug Dialog pat Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help Bike PJR BO A 0 Q iv Lt A A com FEY Pat Profiler pat Projects Ta cicat Projects 53 T ajj gt 0 a aas E w adapz New gt a demo E demo Go Into E d EP sib Open in New Window E C demo demo Tools p H A demo Exclude from build CI exam index a Al nroj Build Configurations i C ee Make targets Build Project Clean Project a Copy We 1 Paste 3 Delete E wild Tal Move perties 2s Progress E console 0 Rename Se ale y Se GE Import Value is r Export false 3 amp Refresh ays 3 Close Project April 20 2010 10 39 49 AM 3 false Run s gt P E S T A EEA p B Debug As 4 E 1 Local C C Application g Convert To C 2 O5 PAL Local C C Application Beee Team gt Coaranare likh Dialog MAPUS FT Porting Made Easy 70 OS PORTING AND ABSTRACTION LAB USER MANUAL 3 On Debug Configuration window you can set your options for debugging as shown in the Figure 47 NOTE You must use MapuSoft
190. ng a License for OS PAL OS PAL is licensed by the following host and target licenses A 30 day advanced evaluation license is available for the host licenses Click http mapusoft com downloads ospal evaluation to request an evaluation license MAPUS FT Porting Made Easy 9 OS PORTING AND ABSTRACTION LAB USER MANUAL Installing License for OS PAL MapuSoft provides a license key to the customers Once the customers provide the Mac Address of their system MapuSoft Technologies provides a License key for that particular system This establishes security for the license To install the license 1 Save the license file given to you by MapuSoft 2 On OS PAL main menu click the down arrow next to Key button and select Install License as shown in Figure 1 Figure 1 Importing License File Edit Refactor Navigate Search Project Run Tools Window Help we ion amp FEY Pa Profiler PAL Projects Ta C C Projects 3 E ladana rege _Cross_osS demo_nucleus demo_posix demo_psos demo_uitron demo_vxworks projit L i Probl E tienen G Progr EE console xE a C Build adapal_1 Ee rf B Fue lanaroras O adazcc adapal_ 1 sourceihellowvorld adal lo jadazcC adapal_1 source hello_world el jtab o lwinmm Build complete for project adapal_1 Time consumed 138406 ms MAPUS QFT Porting Made Easy 10 OS PORTING AND ABSTRACTION LAB USER MANUAL
191. ng the OS_Application_Init function NOTE 1 This feature requires a target license Click http mapusoft com contact to send a request to receive licenses and documentation NOTE 2 For all Optimized Target Code Generation the preprocessor OS_HOST flag is set to OS_FALSE If the user intends to do the host development on the optimized target code they need to change this preprocessor flag to OS_TRUE manually NOTE 3 On Linux target PC hangs while running demo_uitron from terminal if you terminate the execution by Ctrl C Make sure that define OS_BUILD_FOR_SMP is set to False when compiling for non SMP processors NOTE 4 On Linux target System hangs while Target Code Optimized application runs As a workaround do not terminate the application till profiler is generated If you terminate in between your PC will hang NOTE 5 If you select a library project which either has a C C generic library project or OS PAL library project Target Code Generator icon is disabled NOTE 6 API optimization is not supported for OS PAL libraries linked with application project during target code generation To enable Indexer 1 SelectProject gt Properties gt C C General gt Indexer 2 ClickEnable Project Specific Settings check box and _ clickEnable Indexercheck box 3 Click Applyand OK Optimized Target Code Generation for Ada Projects OS PAL allows Optimized Target Code Generation for Ada C C Changer Projects when the projects a
192. ns on host targets are described as follows Is 2 Include os_target h in all your application source files Set the appropriate compiler switches within the project build files to indicate the target OS and other target configurations Initialize the OS Abstractor library by calling OS_Application_Init function If you are also using POSIX Interface then also use OS_Posix_Init function call to initialize the POSIX component as well For instance to develop an application with both Nucleus and VxWorks application development go to os_library_initc and give your appropriate entry function in NUCLEUS ENTRY FUNCTION Define the name of the Nucleus entry task The default entry task is NU_ROOT Give your appropriate entry function in VXWORKS ENTRY FUNCTION You also have to give the appropriate stack size for your entry function in VXWORKS ENTRY FUNCTION STACK SIZE The default stack size given by MapuSoft is OS MIN STACK_SIZE In the main thread call OS_Application_Wait_For_End function to suspend the main thread and wait for application re start or termination requests Compile and link your application using development tools provided by Mapusoft Download the complete application image to the target system and let it run Refer to the sample demo applications provided with OS Abstractor as a reference point to start your application Please review the target processor and development tools documentation for a
193. nstance if you want to add a signal handler on Solaris you could do it here before calling OS_Main os _init_threadx c This function is the entry function for the native operating system This is where you should put any of your operating system specific code For instance if you want to add a signal handler on ThreadX you could do it here before calling OS_Main os init_uitron c This function is the entry function for the native operating system This is where you should put any of your operating system specific code For instance if you want to add a signal handler on micro ITRON you could do it here before calling OS_Main os _init_vxworks c This function is the entry function for the native operating system This is where you should put any of your operating system specific code For instance if you want to add a signal handler on VxWorks you could do it here before calling OS_Main os _init_windows_host c These functions are the various entry functions for the different operating systems This is where you should put any of your operating system specific code For instance if you want to add a signal handler on Windows host you could do it here before calling OS_Main When optimizing you will need to write an equivalent function for your target operating system __os_init_windows c These functions are the various entry functions for the different operating systems This is where you should put any of yo
194. o_cross_os project 2 Right click on the project and select Debug as gt Local OS PAL C C Application or click on debugging icon as highlighted in Figure 42 Figure 42 Debugging the Demo Application New gt File Edit Re Go Into Is Window Help fe Ph Open in New Window Ee Tools r EY amp Java E Index gt Tac Git Build Configurations gt Make targets gt E3 A Build Project E Al proji Clean Project E Al proja a CET 5 Cop 4 zz H E 3 Delete Move Rename y Import e Export o 52 z amp Refresh Pr Glico X Eber e Press BF De Close Project consoles to display at this time B r gt Run s E fe 1 Local C C Application Convert To C Team Compare With gt Open Debug Dialog Restore from Local History i PAL Local C C Application AS NOTE If the user uses the Debug dialog to create a new configuration then they need to select OS PAL Local C C Application before creating The other option is to not use the debug dialog but instead select OS PAL Local C C Application from the Debug As menu This method will create the correct configuration automatically MAPUS QFT Porting Made Easy 66 OS PORTING AND ABSTRACTION LAB USER MANUAL 3 Debugging stops at the main function Click Resume icon to resume the debugging process as shown in Figure 43 File Edit Refactor Navigate Search Project Run Window Help iO HSl
195. odification Porting steps completed successfully In order to successfully compile your application the Following manual code changes ay be required 1 Remove xWorks header file references Use the Following header files instead of the VxWorks header files include os_target h include yxworks_interface h 2 If your application uses any VxWorks APIs that are un supported by Interface then manually port your code using Cross OS Interface APIs 3 If your application have a main Function then move the necessary code from your main to he the main provided by Cross OS Interface in os_main c MAPUS QFT Porting Made Easy 84 OS PORTING AND ABSTRACTION LAB USER MANUAL 11 In OS PAL projects perspective the ported projects are displayed as shown in Figure 60 Figure 60 Project Perspective of the Ported Projects PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help i ri B OQORAR PO B O Q 4 FEY Pat Profiler pat Projects ERS Resource Fig CiC Projects 33 mas 5 Tal E E demo_ada_to_c demo_cross_os demo_nucleus demo_posix demo_psos demo_uitron demo_vxworks Problems 52 El Console E Properties Progress e T O errors 3 534 warnings 0 infos Description Resource i Warnings 100 of 3534 items return with no value in function return system rts
196. odules Module Description nucleus_interface h This header file is required in all of the Nucleus PLUS source modules This header file provides the translation layer between the Nucleus PLUS defines APIs and parameters to OS Abstraction The Nucleus Interface demo contains the following modules Module Description demo c Contains a sample demo application Building Nucleus Interface Before building the Nucleus Interface library and or application ensure that the flag INCLUDE_OS_Nucleus is set to OS_TRUE in the cross_os_usr h configuration file Building Nucleus Interface Library The pSOS Interface library is located at mapusoft nucleus_interface directory From this location you will find the make files or project files at the appropriate specific lt OS gt lt tool gt lt target gt directory For instance if you need the demo application to be built for Nucleus OS using Eclipse tools and for x86 target then the make file location will be at specific nucleus lt OS gt x86 eclipse directory Building Nucleus Interface Demo Application The demo application is located at the mapusoft demo_nucleus directory location From this location you will find the make files or project files at the appropriate specific lt OS gt lt tools gt lt target gt directory For instance if you need the demo application to be built for Nucleus OS using Eclipse tools and for x86 target then the make file location will
197. ols Ada C C Project name This folder contains the Ada C C project related files e Include This folder contains the Ada Include folder e info This folder contains information file subdirectory of the program library directory where information files for the object modules are placed e source This folder contains the converted C C source files If OS Abstractor is integrated then you get a folder init which contains the OSPAL template files NOTE For more information on the Template files refer to OS PAL Template Files section in this manual e xref This folder contains the cross referenced files which are generated by the Ada tools e adaRoot This folder contains the Ada sources added during your project creation In case you add any additional sources you can view this in the Project gt Property page gt Ada Source tab of the respective project e ADA LIB This contains information describing the configuration of the Ada library e UNIT MAP This contains a unit to source mapping for use by the compiler and program builder e options This contains the list of options with which Ada C C project or executable is created This is a hidden file You can view this in Navigator view To view select Window gt Show View gt Other gt General gt Navigator NOTE Host Libraries and include paths are automatically added during project creation For viewing this information select Ada C C Changer Project gt Properties gt
198. on Select your target OS Windows Windows If you require a C inter Windows CE p the OS Abstractor components required Include Cross OS Ir Nucleus C Include POSIX Interface _JInclude VxWorks Interface C Include p505 Interface C Include Nucleus Interface C Include micro ITRON Interface MAPUS QFT Porting Made Easy 248 OS PORTING AND ABSTRACTION LAB USER MANUAL 10 After compiling the Ada code to executable file generation is successfully done The porting report page is displayed as shown in Figure 149 Click Done to complete the process Figure 149 Ada PAL Compiler Porting Report Ada PAL Compiler Project Report Displays status report regarding your Ada Project License Check Status SUCCESS Description License for Ada PAL Compiler is valid Ada PAL Compiler Status SUCCESS Description For more details see console view Windows Cross OS Generation Status SUCCESS Description Standalones generated for target OS Windows Successfully Target configuration settings Status WARNING Description You need to change the Following configuration files in order to build your project for your target successfully ada_config adapal1 cross_os_usr h cross_os_Windows source cross_os_Windows include Source Listing Details Status SUCCESS You have successfully converted Ada sources to object or binary executables MAPUS FT Porting Made Easy 249 OS PORTING AND ABSTRACTION LA
199. orting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help 18 OOR BO M er c fey pat Profiler par Projects Fi demo h 2 JASCO IO a a eR a a Ra ee A 7 gt Q aA adapal_1 p a demo cros Ge is Copyright c 2007 MapuSoft 7 demo_nucleus ae A PROPRIETARY RIGHTS of MapuSoft Technoloc a demo_posix subject matter of this material All me La demo_psos i pa sath Mis ws F demo_uitron oe a MEAE es rights Se Gee i ix PF demo vxworks y the license agreement e recipient accepts the terms of the license f ae projl AF i i a C sample or information please contact if E E Includes B include i MapuSoft Technologies GS source 2s Business Innovation Center Zt 1301 Azalea Road Zt Mobile Alabama 36693 Tals aCA ECE gad La k lication_start c s m ATES i Problems E Properties 3 E Progress l Console windDemoPorted c flee Property Value g 6 items selected MAPUS QFT Porting Made Easy 61 OS PORTING AND ABSTRACTION LAB USER MANUAL Building Binary Files for a Project NOTE This feature requires a license Click http mapusoft com downloads ospal evaluation to request an evaluation license 1 Creating an OS PAL C C Project Adding Source Code Files to OS PAL Project Select a project under C C Projects pane right click and select Build Project as shown in Figure 38
200. our Action Additional Specifies ifyou want To specify additional options select the check Options to include any other box and enter a value in the text box additional options such as custom or optional Add GNAT Specifies if you want To add GNAT compatibility select the check Compatibility to add GNAT box Compatibility ee eee ae a want Note This feature is disabled on Windows oe ace ah Pir On Linux to add POSIX compatibility select Compatibility ie Shack b Note This feature is CERESE DOK not supported on Windows It is supported on Linux only 8 On OS Abstractor Integration page select the check box to enable OS Abstractor Integration And select your target OS by selecting from the drop down list of available Ossas shown in Figure 148 NOTE 1 If no OS Abstractor Integration is chosen the project will use C specific tasking instead of the OS 9 If you require a C interface select the check box next to the required OS Abstractor component and click Finish as shown in Figure 148 NOTE 2 If you have enabled the Cross OS APIs you can enable the additional development APIs after importing to OS PAL MAPUS FT Porting Made Easy 247 OS PORTING AND ABSTRACTION LAB USER MANUAL Figure 148 OS Abstraction Integration Page Ada PAL Compiler OS Abstractor Integration IF no OS Abstractor Integration is chosen the project will use C specific tasking instead of the OS Enable OS Abstractor Integrati
201. ow Help ae oo BHA a iv fey pat Profiler Debug PAL Projects PAL Profiler D 23 C pat Profiler view 3 a o E PL profiler_data_ system Functions Threads q aji 1 p_Task y p_id protect OS_Create_Task 009008080000080860 OS_ Protect OS_Un phore phore e Count phore phore OS_Create_Sema OS_Take_Sema phor 0S_Give_Semal OS_Get_Events OS_ Slee OS _ Get_Event_Grou OS_Get_Current_Task_ OS_Set_Task_Priorit OS_Get_Sema OS_Delete_Sema OS_Create_Event_Grou w oO Q Q lt E Properties 3 Property Average Function execution 4 6 334 751 601 Nano Seconds Function with the longest exe OS_Get_Current_Task_Id Function with the shortest ex OS_Delete_Queue Number of Functions called in_33 On the bottom of the window as highlighted the function properties are displayed such as e Average Function execution time e Function with the longest execution time Function with the shortest execution time Number of Functions called in application MAPUS QFT Porting Made Easy 173 OS PORTING AND ABSTRACTION LAB USER MANUAL On the left pane expand the Functions tab It displays the following information as shown in Figure 110 Platform APIs Application Functions Figure 110 Platform APIs and Application Functions aL Profiler OS Porting and Abstraction Lab File Ed
202. ple_vxworks_app 2 Root Task Prototype Enter prototype Function definition of applic Root Task Stack Sizetin bytes OS_MIN_STACK_SIZE ee Ie 5 0 errors 0 warnings 0 infos Description val m lv n inucleus_legacy 7 Ifyou are importing a kernel application click Yes to automatically create start up files to connect the imported application to the OS platformas shown in the Figure 50 MAPUS QFT Porting Made Easy 81 OS PORTING AND ABSTRACTION LAB USER MANUAL NOTE If you are porting a library project click No to continue with the porting 8 If you select any application type project provide the inputs for the project and click OK as shown inFigure 57 If you do not want to provide the inputs you can just click Cancel Figure 57 Provide Inputs for Projects Window Projects dems Import ET YH Import Wind River Workbench Projects Select a Workspace to Search for existing Workbench Projects KEKE IA ft Tech PAL Inputs For simple _vxworks_app Enter prototype Function definition of application s 1 Root Task Prototype O5_MIN_STACK_SIZE se E Root Task Stack Sizetin bytes MAPUS QFT Porting Made Easy 82 OS PORTING AND ABSTRACTION LAB USER MANUAL NOTE If you select an application project and if it contains any referenced projects not selected by you then a Confir
203. ppropriate graphical viewer to view your profiler data You can view the profiler data in a line chart bar chart area chart or a scatter chart Figure 116 Selecting the API to view the Profiler Data Profiler OS Porting and Abstraction Lab File Edit Navigate Search Project Run Tools Window Help pes m BAB a amp iv E PAL Profiler He Debug PAL Projects PAL Profiler Data Expl 2 T E pat t Profiler yen 53 Bm oO E PAL profiler data 1210 System Functions lt gt Threads E e Task_1 a Task_2 Platform AF lt gt 1400000 1 255 187 os_Set_tast 2 1200000 os_create 5 1900000 3 Line Chart os_uni Bar Chart os_ce m Area Chart os se E3 E Scatter Chart os os_ eo Load Profiler Data File Os _Set 2 Be Generate Report FOSG Cu T k it OSs Del E cenerate Comparison Report o et_ z rrent_Task B s Task_3 led by Task_2 Thread i x El Properties 33 E 2 H O Task 7 Property Value Average execution time 0 000 277 083 Nano Seconds Instance with the longest exe 11 Instance with the shortest ex 12 lt Cy MAPUS QFT Porting Made Easy 181 OS PORTING AND ABSTRACTION LAB USER MANUAL Generating API Timing Report NOTE This feature requires a license Click http mapusoft com downloads ospal evaluation to request an evaluation license OS PAL now provides you a new feature to view the pe
204. ption Ic The lc option causes the compiler to generate a continuous source listing without pagination or headers Any errors or other compiler generated messages are interspersed in the listing The listing is written to file Ist le The le option causes the compiler to generate a source listing only if there are errors If neither lc lp or lr are specified the listing is generated without pagination or headers with interspersed error messages as if lc had been specified The listing is written to file lst lf filename When used in conjunction with the lc le lp or lr option the lf option causes the compiler to write the listing to filename instead of the default file 1st lp The lp option causes the compiler to generate a line numbered listing with pagination and a header at the top of each page The page is 60 lines long and 80 columns wide Any errors or other compiler generated messages are interspersed in the listing which includes all messages generated by the compiler The listing is written to file lst lr The lr option causes the compiler to generate a listing containing only those lines for which compiler messages were generated as well as the compiler MAPUS FT Porting Made Easy 195 OS PORTING AND ABSTRACTION LAB USER MANUAL Listing Options Description messages The listing is written to file Ist lx The lx option causes the compiler
205. rces lt source file gt Lib Windows X86 Vs2008 MapuSoft provides six different settings for libraries as shown below cross_os_usr h will use the correct settings for the library build specified using the OS_LIB_BUILD pre compile flag as described below e OS_LIB_REL_PROC_PROF If OS_LIB_BUILD is set to OS_LIB_REL_PROC_PROF as the compiler option the library linked must be the one built as release with Process mode and Profiling turned on e OS_LIB_REL_PROC_NOPROF If OS_LIB_BUILD is set to OS_LIB_REL_PROC_NOPROF as the compiler option the library linked must be the one built as release with Process mode and Profiling turned off e OS_LIB_REL_NOPROC_PROF If OS_LIB_ BUILD is set to OS_LIB_REL_NOPROC_PROF as the compiler option the library linked must be the one built as release without Process mode and Profiling turned on e OS_LIB_REL_NOPROC_NOPROF If OS_LIB_BUILD is set to OS_LIB_REL_NOPROC_NOPROF as the compiler option the library linked must be the one built as release without Process mode and Profiling turned off e OS_LIB_DEBUG_PROC If OS_LIB_BUILD is set to OS_LIB_DEBUG_PROC as the compiler option the library linked must be the one built with Debug mode and Process turned on e OS_LIB_DEBUG_NOPROC If OS_LIB_BUILD is set to OS_LIB_DEBUG_NOPROC as the compiler option the library linked must be the one built with Debug mode and Process turned off You must also ensure that the matching library is
206. re created with OS Abstractor Integration For Ada C C Changer projects created without OS Abstractor Integration Optimized Target Code Generation should not be done The generated code WILL NOT work since there is no call to OS_Application_Initialize For Ada PAL Compiler Projects Cross OS interfaces are added directly to the project as target sources if you have a valid and relevant Standalone Package Generator license If Optimized Target Code Generation is attempted on these projects all the Cross OS functionality being part of application is again redefined in cross_os c This will give re definition errors on compile time Hence Ada PAL Compiler projects cannot be code optimized NOTE 1 The project file generated to QNXMomentics 4 x IDE using optimized target does not enable the build variant so you need to manually enable the build variant after importing in the QNX IDE To enable the Build Variant e Select the project and go to Project Properties gt C C General gt QNX C C Project MAPUS FT Porting Made Easy 125 OS PORTING AND ABSTRACTION LAB USER MANUAL e Select Build variant tab e To enable the build variant select the X86 check box NOTE 2 Check if the Indexer is enabled Generating Optimized Target Code will not work if Indexer is OFF NOTE 3 For all Optimized Target Code Generation the preprocessor OS_HOST flag is set to OS_FALSE If the user intends to do the host development on the optimized ta
207. reads E a Task_1 8 Task_2 Platform AF zp 1400000 os_set_toss 1200000 05 create_ S 1000000 o PAL Profiler View 23 1255 18 7 Time Nano S Sec os_Protect OS_Unprote 600000 08_Get_tve 400000 os_sieep_h OS_Applica er i e GEA rc N oo t WD w co m OS_Set_Evei o5_Delete_ Instances of OS Get _Current_Task id S Task 3 q called by Task_2 Thread O Task_4 lt Task_5 f EES i p S Task_6 E Properties 3 E ag Task_7 Property Value Average execution time 0 000 277 083 Nano Seconds Instance with the longest exe 11 Instance with the shortest ex 12 MAPUS QFT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL Components on the Profiler Window OS PAL Profiler window contains two panes The left pane has three Profiler components listed and on the right pane you can view the respective details and information in a graphical view The three main components of OS PAL Profiler are Profiler_data file This is the generated profiler data file You can view the performance report of each API A profiler data file is saved as a dat file It has the following three components 1 System This displays the system details of your application as shown in Figure 108 If you selectSystem tab you have the following details which are displayed on the right pane as shown inFigure 108 e Application Info Application property values
208. relocatable object modules and records dependency information for use by the program builder It optionally generates source listing assembly listing and debugger information for use by the symbolic debugger The Ada PAL compiler consists of two phases the front end and the back end The front end performs syntactic and semantic analysis It generates C source files as input to the back end The back endof the Ada PAL compiler is an ISO ANSIC compiler It performs code generation applies optimizations and generates a relocatable object module Compiler Inputs Invocation adacgen option file The adacgen command invokes the Ada PAL compiler for one or more files If the specified source files have semantic dependencies on other units the source files for those units must be located either in the program library or in one of the linked libraries If a source file depends on a library unit not yet processed by the current invocation of the compiler the compiler will find and process that library unit through the front end only provided that the source file containing the required library unit has been registered in the program library or is in a linked library This proceeds recursively if necessary until the closure of all depended upon library units have been processed Listing Options For the listing options the compiler generates the requested listing for each file specified on the command line Listing Options Descri
209. return with no value in Function returt system rts return with no value in Function returi system rts ZA m Path A am j demo_ demo_ demo_ijsy lji 12 g 8 items selected You have successfully imported your VxWorks application to OS PAL To know more about the project template files go to OS PAL Project Template Files on page 60 MAPUS QFT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL Method 2 Porting VxWorksLegacy C Code This section explains Porting VxWorksLegacy Applications using OS PAL Porting Plugin A sample porting of VxWorks Legacy application using OSPAL is described with an example here NOTE This feature requires a license Click http mapusoft com downloads ospal evaluation to request an evaluation license 1 Select File gt Porting gt VxWorks gt Import Legacy C Code as shown inFigure 61 You can also click on the Porting icon from the task bar Figure 61 Importing VxWorksLegacy C Code in OS PAL Projects OS Porting and Abstraction Lab File Edit Source Refactor Navigate Search Project Run Tools Window Help ci m DORX BPO M O Q i FEY pat Profiler PAL Projects fy Resource VxWorks 4 C gt Import Workbench C Project EES p505 Import Legacy C Code TA Projects o Nucleus gt iS z Be it POSIX gt s EK Problem icro ITRON gt Ditems Windows Description Resource
210. rf rte k i i da2CC support rtl sre 00 g3 Wall c fmessage length 0 oada2CC supporti cross_os_windows sou ree os_write o ada2CC support cross_os_windows so urce os_write c n jadapal_1 Build Project 7 m 257 OS PORTING AND ABSTRACTION LAB USER MANUAL 15 To view the exe file generated expand the project you have created and expand the Debug folder You can view the exe file generated by the Ada PAL Compiler as shown in Figure 155 Figure 155 exe file PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help m m ZOR BO B FEY pat Profiler pat Projects Faci Projects 2 5 Al adapal_1 ER Includes Hf ada2cc h adaRoot Debug H E ada ft lar ADA LI UNIT MAP demo_cross_os demo_nucleus demo_posix demo_psos C demo_uitron demo_vxworks projl Fw i H E Bk Probl C Prope ie Progr El console 0O Eas adapal_1 Ge tg Fir android o a adaZCC adapal_1 source helloworld ada o ladaZCC adapal 1 source hello world el tab o lwinmm Build complete for project adapal 1 Time consumed 137969 ms adapal_1 Debug adapal_1 exe NOTE While importing an Ada project you will receive 3617 warning messages It appears that most if not all of them are associated with the rtl files They are as follows e Defined but
211. rformance report for each API To generate API Timing Report 1 2 From the OS PAL main menu go to Profiler perspective and select any Profiler Data on your left pane to generate the report Select Tools gt Generate Report You can also click on Generate Report button a on the OS PAL window as shown in Figure 117 Figure 117 Generate Timing Report Profiler OS Porting and Abstraction Lab File Edit Navigate Search Project Run MESSI Window Help P wei B 2 B PA Load Profiler Data File E pat Profiler s Debug PAL Projects erate Report Generate Comparison Report PUREE Gane PAL Profiler Data Explorer 3 E A T 1 fol fol g profiler_data_1210343810 System lt Functions Oo no amp O OS_Get_Current_Task_Id p_id protect OS_Protect OS_Un OS_Get_Events OS_Create_Task Function Iterations OS_Get_Event_Grow OS_Create_Event_Grou Functions IE il E Properties 52 B SP Property MAPUS Q FT Porting Made Easy 182 OS PORTING AND ABSTRACTION LAB USER MANUAL 3 A Save As window is displayed Select the directory where you want to save the report and enter a file name for the report and click Save as shown in Figure 118 NOTE In Windows Vista and Windows 7 you cannot generate the profiler report on c if UAC is turned on To turn off UAC refer to the Turning Off UACsection on page 123 You can generate the Timing report to generate in any sub
212. rget code they need to change this preprocessor flag to OS_TRUE manually NOTE 4 The QNX Momentics IDE has an issue where relative path names are not updated unless there is a modification to the project settings This will cause the initial build of the Full Source version of OS Abstractor to fail since the project files were created in a different location than where they were installed To force Momentics to update these paths e Right click on the project and select Properties from the context menu Then click Apply and close the properties window NOTE 5 To generate optimized target code on Windows Interface ensure that the flag INCLUDE_OS_PROCESS is set to OS_TRUE in the cross_os_usr h configuration file To generate Optimized Target Code 1 From OS PAL projects select a project 2 From OS PAL main menu click Tools gt Optimize Target or click on the OS PAL Optimized Target Code Generator button as shown in Figure 86 MAPUS FT Porting Made Easy 126 OS PORTING AND ABSTRACTION LAB USER MANUAL Figure 86 OS PAL Target Code Generator PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help r3 ell E R X ad oO X A Optimized Target Code Generator A O 2 Update Settings License P Full Library Package Generator TO CHCH Projects E2 a 0 A Ada C C Changer a 8S it k od TF FEY pat Profiler PAL Projects amp Resource
213. rget insert in __os_init_qnx c e For Solaris target insert in __os_init_solaris c e For Threadx target insert in __os_init_threadx c e For ulTRON target insert in __os_init_uitron c e For VxWorks target insert in __os_init_vxworks c e For Android target insert in _os_init_android c e For uCOS target insert in __os_init_ucos c e For NetBSD target insert in __os_init_netbsd c MAPUS FT Porting Made Easy 49 OS PORTING AND ABSTRACTION LAB USER MANUAL Host System Configuration The below defines are the system settings used by the OS_Application_Init function Use these to modify the settings when running on the host A value of 1 for any of these will use the default values located in cross_os_usr h When you optimize for the target side code the wizard will create a custom cross_os_usr h using the settings you specify at that time so these defines will no longer be necessary define HOST_DEBUG_INFO 1 define HOST_TASK_POOL_TIMESLICE 1 define HOST_TASK_POOL_TIMEOUT 1 define HOST_ROOT_PROCESS_PREEMPT 1 define HOST_ROOT_PROCESS_PRIORITY 1 define HOST_ROOT_PROCESS_STACK_SIZE 1 define HOST_ROOT_PROCESS_HEAP_SIZE 1 define HOST_DEFAULT_TIMESLICE 1 define HOST_MAX_TASKS 1 define HOST_MAX_TIMERS 1 define HOST_MAX_MUTEXES 1 define HOST_MAX_PIPES 1 define HOST_MAX_PROCESSES 1 define HOST_MAX_QUEUES 1 define HOST_MAX_PARTITION_MEM_POOLS 1 define HOST_MAX_DYNAMIC_MEM_POOLS 1 define HOST_M
214. rk 2 If this is Ada Changer Project without Abstractor Integration the generated code WILL NOT work since there is no call to OS_Application_Init Figure 101 MAPUS QFT Porting Made Easy ae ce ee ee ee _ IMMM 1 55 OS PORTING AND ABSTRACTION LAB USER MANUAL Figure 101 Interface Tab OS PAL Target Code Optimizer A i This wizard optimizes target specific source code ILEA Task Process Memory Other Resources Debug Output Devices ANSI Mapping Device I O Interface Number of p505 Interface Task Registers MAPUS QFT Porting Made Easy OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on Interface tab are as follows Field Description Your Action Number of Specifies the number of Enter the number of psOSInterface Task pSOSInterface Task Registers psSOSInterface task Registers registers Note Default value is 32 19 Click Finish The target code will be generated into the destination path you defined in step 5 as shown in Figure 102 NOTE If it is not able to generate the target code the system will throw up an error Figure 102 Target Code Generation Output Generator Verification Displays the Information about different activities in Target Code Generation License Check Status SUCCESS Description License file contains a valid license For Windows XP Generate Cross OS Interface Status SUCCESS
215. roject Template Files To view the OSPAL C project template files expand the project folder you have just created by clicking on the sign beside the Project name as shown in Figure 26 Figure 26 C Project Template Files PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help et Gel ODOR PRO D LE A 7 9 x E pat Profiler PAL Projects Fle CIC 4 Projects 3 a F _ m f a H F _ demo_psos a demo_uitron demo_yvxworks ER Includes 2S include amp source __os_init_lint __os_init_lyn __os_init_qn __9s_init_ ee ae ie 5 i Probl i Prope 28 E Progr E Console z __os_init_ucos c ulg Y Property Value __os_init_windows __os_init_windows c pplica os_library_init c ES GES CCM Ce GM GHGS GN EM EM EME EMEN SAHARA ee B os_main c 18 items selected You can view the following template files for your project on the left pane of the window os _init_ linux_host c This function is the entry function for the native operating system This is where you should put any of your operating system specific code For instance if you want to add a signal handler on Linux host you could do it here before calling OS_Main os _init_linux c This function is the entry function for the native operating system This is where you should put any of your oper
216. rt PAL Profiler Data Explorer 23 profiler_data_1210343810 System Functions E 6 w4 om 22 i i r a Ee 3 J 8 8 8 u 5 a g 2 ie gt x a o a 1 Z ie Fe 1 3 v o Q 5 a o w 5 Fe 5 oO in amp 5 5 s w S Si 3 sat 2 T pm a ao 6 o cat Fi O 8 o Functions SED E Properties 53 A E lt S Property Value gt AY MAPUS QFT Porting Made Easy 179 OS PORTING AND ABSTRACTION LAB USER MANUAL 3 Browse to your saved profiler data file and click Open as shown in Figure 115 Figure 115 Selecting the pal Extension File to Analyze Choose the pal extension file to analyze Look in amp Local Disk C J osem Standalone generation Config Msi adobe Suitecs3 winvows My Recent workspace Seclipse3 3 1 1 Documents VersalSoft Sospalalpha2 checkout ospPat_1 3 6 Ei Target B profiler_data_1231531899 pal Mapusoft nucleus _legacy_code RoboHelp Documents and Settings MS0Cache O Program Files lO minew Pr D souces q l target1 My Computer File name profiler_data_1231531899 My Network Files of type pal MAPUS FT Porting Made Easy 180 OS PORTING AND ABSTRACTION LAB USER MANUAL 4 Select an API to view the data and right click on Profiler Data Explorer tab to view the different graph options as shown in Figure 116 NOTE You can select an a
217. s OS PAL reads application source code to determine the services used by your application and produces OS specific interface code optimized for your specific application and for each target OS platform OS PAL gives you the ability to support multiple OS It is also easily expandable to generate code for your proprietary OS Optimized Target Code Generator chapter includes the following topics e Generating Target Code e Generating Project Files for your Target e Running OS PAL Generated Code on your Target For more information on optimized target source code generator refer to Optimized Target Code Generator chapter on page 128 MAPUS FT Porting Made Easy ee OS PORTING AND ABSTRACTION LAB USER MANUAL Ada PAL Compiler The Ada PAL compiler translates Ada source programs into re locatable object modules and records dependency information for use by the program builder It optionally generates source listing assembly listing and debugger information for use by the symbolic debugger The Ada PAL compiler consists of two phases the front end and the back end The front end performs syntactic and semantic analysis It generates C source files as input to the back end The back end of the Ada PAL compiler is an ISO ANSIC compiler It performs code generation applies optimizations and generates a re locatable object module The importing directory which consists of Ada sources that needs to be converted to C Sources This may b
218. s Windows Application developers need to specify the target operating system that the application and the libraries are to be built for inside the project build scripts Application developers can also customize OS Abstractor to include only the components that are needed and exclude the ones that are not required for their application If the Application also uses Interface products additional configuration may be necessary Please refer to the individual Interface documents Using OS Abstractor The steps for using OS Abstractor are described in the following generic form l 2 3 Include os_target h in all your application source files Set the appropriate compiler switches within the project build files to indicate the target OS and other target configurations Configure the pre processor defines found in the cross_os_usr h header file under each target OS folder to applications requirements Initialize the OS Abstractor library by calling OS_Application_Init function If you are also using POSIX Interface then also use OS_Posix_Init function call to initialize the POSIX component as well If you use OS Changer s you may need to call other appropriate initialization functions as well After initialization create your initial application resources and start the application s first task After this and within the main thread call OS_Application_Wait_For_End function to suspend the main thread and wait for applicatio
219. sample demo application that is provided by the OS vendor on your target Refer to the OS vendor provided documentation on how to compile link download and debug the demo applications for your specific target and toolset After this step you are ready to use the Cross OS Interface library to develop your applications Building Cross OS Interface Demo Application The demo application is located at the mapusoft demo_cross_os directory location From this location you will find the make files or project files at the appropriate specific lt OS gt lt tool gt lt target gt directory For instance if you need the demo application to be built for Nucleus PLUS OS using visual studio 6 tools and for x86 target then the make file location will be at specific nucleus visual_studio_6 x86 directory MAPUS FT Porting Made Easy 161 OS PORTING AND ABSTRACTION LAB USER MANUAL VxWorks Interface The Nucleus Interface library contains the following modules Module Description vxworks_interface h This header file is required in all of the VxWorksPLUS source modules This header file provides the translation layer between the VxWorks defines APIs and parameters to OS Abstraction The VxWorks Interface demo contains the following modules Module Description demo c Contains a sample demo application Building VxWorks Interface Before building the VxWorksInterface library and or application ensure tha
220. sasiecacasddancesasnacendasievecsasdedncsasbaventes 51 Adding Source Code Files to OS PAL Project ces cssccessceeessescenseccensencenteseenseee 57 Building Binary Piles for a Project scsscccvnesceieseccececsiicavseioaceseieidcentoeieceavneereadaens 62 Executing Binary PUG oes cip wetocacrasesceutuosractvagueacsvessnsecpencoseuieedencen arene R a 64 Debugging the Demos Supplied by MapuSoft 0 0 0 eeeeesseceseeeeeeeeeeeenaeenseeees 66 Debugging Using External Console Terminal cceeeeceeeeeeeeeeeeeceeeeeseteeeenseeeesaes 70 Inserting Application Code to Run only on Host Environment 75 Updating Project Settings iiie r E E E EE E A 76 Porting VxWorks Applications using OSPAL ssseeseseesessreeseeeeesersresreesresrrereesrrserseresee 78 Method 1 Porting a WindRiver Workbench C Project ceeceseeseeneeereeeeeeeeeneee 78 MAPUS FT Porting Made Easy 2 OS PORTING AND ABSTRACTION LAB USER MANUAL Method 2 Porting VxWorksLegacy C Code 0 ceeeeeeseeeeeeeecesecesecneeeaeeeeeeeeeeaeenaes 86 Method 3 Manually Porting Legacy Applications using OS PAL Import Feature 88 Porting POSIX L gacy C Cod saesniensa e a Eeay 89 Porting Applications from Nucleus PLUS Legacy Code to Target OS eee 92 Porting Nucl s Legacy C COde jearaaesndssnastnancravanonsndvardaneaumadisanmuanstiuoedenmasmniedsanat 94 Porting pSOS Legacy C CGodeeriseaninssan ene a en aeaee 97 Porting micro ITRON Legacy C Code sssssesess
221. seseseseseesesseseesssesersseseesesseseesesseseesees 100 Porting Windows Legacy C Code s sssesseeseeseseeesesesresresesresesseserssrsrestssrsresesseseessts 103 CHAPTER 4 OS CHANGER FOR REUSING THE CODE 106 PA UCSF OE sninen asanes AE eie aai eE NaRa SEEE in 107 Interfaces Available for OS Changer eeessseseeseeerseseereesersrrsrrrsersstsreesresrreeresressesere 108 Using OS Changer sieges caenteetecisticte peasseceneiet adage E eens 108 Error ic c816 1100 geomet nee ate Nee Penn re eter rer teers a E E reeset rere 109 CHAPTER 5 OS ABSTRACTOR FOR DEVELOPING PORTABLE SOFTWARE chissnsscsscacsncsnscuneenasssaceonsssnesseseansenesnaeess 110 Abo t OS Abstractot ote ies edd cea edema ai a ae ede aa ted R eisi 111 Interfaces Available for OS Abstractor ssseseessseesesrsresrrsrrrrsrrsrreresrsrrsrssrsrrnresresrsses 112 Usine OS PAS EAC tO rsisi orar eara AE EEEE E EE ES EES ERS 112 CHAPTER 6 FULL LIBRARY PACKAGE GENERATOR 114 Generating Full Library Packages eesesesseseeeseeseesressreeresresseseresressesererrenserseesresseeee 115 Developing Cross OS Application eessseseeesseseeseesersresreestesrsrresersstsrresresrrseresressesee 122 Generating Binary Packages oe secsasioccascicaviesasheredsattenendasegeneiuasaeendasnadanteanacnivaanaceesaieruns 122 CHAPTER 7 OPTIMIZED TARGET CODE GENERATOR 123 Generating Optimized Target Code siisicsississsacecistasiedsaoassndsaaradessansees
222. source code gC Generate C oriented debugging information The gc option causes the compiler to generate the appropriate code and data for operation with the C debugger This option also causes the intermediate C source files to be saved for use as program source files for the debugger providing C source level debugging help or h The help option shows the different options that can be used with the adacgen command late_inlines The late inlines option allows pragma Inline to be specified after a specless subprogram body This option provides compatibility with Ada 83 and allows more aggressive inlining N check Suppresses numeric checks The check can be one of e division_check e overflow_check These checks are described in the RM Using N reduces the size of the code and increases its speed Note that there is a related adacgen option s to suppress all checks for a compilation noeo The noeo option disables optimizations that are performed by the front end noxr The noxr option disables generation of cross reference information by the compiler for use by a browser This is the default Olevel The O option that s an oh not a zero controls the optimizations that are performed by the compiler back end The accepted values for level are none all debug 1 2 and 3 These have the following effect e None disable all optimizer options e All same as O3 e Debug
223. ssreererressersees 163 PSS Interface oases atest r ee N 164 Building pPSOS Interface arnis nn aaea iea iai a aSa 164 Building pSOS Interface Library esesseeeeseeeseseresesssesressrsrrssressrseresressrseresresseeeees 164 Building pSOS Interface Demo Application sseseseeeseeeeeseesesressrseresressrrererressereres 164 MAPUS FT Porting Made Easy 3 OS PORTING AND ABSTRACTION LAB USER MANUAL micro ITRON Interface sessies ieii an E A asaiadsesaananedaasposanasauabadagnenens 164 Building micro ITRON Interface ssseseseeeeeseeeseessesrresressrserrsressrreresressrseresresseesess 164 Building micro ITRON Interface Library 222 2c scccsscesssees cccessseseeenstntdscevancessnesaneens 164 Building micro ITRON Interface Demo Application eeeeseeeerseeereesreererrrseree 165 Windows TMMGE ACE 35 cedraccaraszonnncstucanevsuteng styyansesvascninsatsententiedaapeacdeattunttoastueancipeandesss 165 Building Windows Sr gee ss as ete de caves ead oeeaceayodecceeiedeneseeeeee eared 165 Building WindowsInterface Library cee eeeeeseeceeceeeeeeeeeeneeceaeceeeeseeesneeenaeens 165 Building WindowsInterface Demo Application 0 ei ceeeeeeseseeeneceeeeeeneeeseeenaeens 165 Building Application with Multiple Interface Component ee eeeeeseeeseeeereeenees 165 CHAPTER 8 OS PAL PROFILER sceccccccccccccccccccsccccccceese 167 AboutOS PAL Profilet s sissdecsss siavedeieeprdonticdeesemetcaieuicadiedesabedcetaboaedan
224. support to POSIX You have a separate library with POSIX Ada packages for Linux only To make this linked library available to a given user the adaopts command Command adaopts p usr local OSPAL Tools Ada linux posix_adawill link the posix ada library into the search path for the current library Ada Support for GNAT compatibility compiler This feature enables you to link the gnat compatibility library into the search path for the currentlibrary The following commands are used to link Linux Command adaopts p usr local OSPAL Tools Ada linux gnat_compat Windows Command adaopts p C OSPAL Tools Ada windows gnat_compat Ada Support for Win32 This feature enables support for Ada on Win32 host The following command is used for the win32ada library Windows Command adaopts p C OSPAL Tools Ada windows win32ada NOTE On Linux HOST Environment you need to set View Modify permissions to the Tools folder To set View Modify permissions e Go to the Tools folder e Right click on the Tools folder and select Properties gt Permissions e Change the required permissions MAPUS FT Porting Made Easy 235 OS PORTING AND ABSTRACTION LAB USER MANUAL Then provide executable permissions to files under tools Ada linux bin folder before creating any Ada project Otherwise it will give an OS PAL exception while trying to convert Ada to C using Ada PAL Compiler options To change executable permissions Go to Termin
225. t lt target gt directory For instance if you need the demo application to be built for pSOS OS using eclipse tools and for x86 target then the make file location will be at specific psos lt OS gt x86 eclipse directory micro ITRON Interface The micro ITRON Interface library contains the following modules Module Description uitron_interface h This header file is required in all of the uITRON source modules This header file provides the translation layer between the uITRON defines APIs and parameters to OS Abstraction The Nucleus Interface demo contains the following modules Module Description demo c Contains a sample demo application Building micro ITRON Interface Before building the micro ITRON Interface library and or application ensure that the flag INCLUDE_OS_UITRON is set to OS_TRUE in the cross_os_usr h configuration file Building micro ITRON Interface Library The micro ITRON Interface library is located at mapusoft uitron_interfacedirectory From this location you will find the make files or project files at the appropriate specific lt OS gt lt tool gt lt target gt directory For instance if you need the demo application MAPUS FT Porting Made Easy 164 OS PORTING AND ABSTRACTION LAB USER MANUAL to be built for uITRON OS using Eclipse tools and for x86 target then the make file location will be at specific uitron lt OS gt x86 eclipse directory Building micro ITRO
226. t for your project To go to the property page 1 On OS PAL Projects pane select the Ada C C Changer project you have created Right click on it and select Properties and shown in the Figure 139 Figure 139 Ada Properties Project New File Edit F Go Into ols Window Help 4 mi ad Open in New Window a Za Tools gt E g a lude from t b T CiC H F Index ti Build Configurations gt Make targets E Al aa Build Project Al Clean Project E w proj a O simp COPY E zz B Paste 3E Delete Move Rename Import r Export amp Refresh Close Project Pres E co x B pr hex Pres E De a o consoles to display at this time r Run s Debug As gt Convert To Team gt Compare With gt TE Restore from Local History ii Ada Build Ada Clean Properties Alt Enter MAPUS QFT Porting Made Easy 231 OS PORTING AND ABSTRACTION LAB USER MANUAL 2 The Ada C C Changer property page is displayed as shown in the Figure 140 Make the necessary changes and click Apply Figure 140 Ada C C Changer Property Page PAL Properties for adal Resource Ada Changer Property Page Ada Compiler Property Page Builders amp C C Build C C General OS PAL Property Page Project References Run Debug Settings Ada Changer Property Page C C output Adalistings Adamessages Adadrivers Additional Comments Include C C Fu
227. t the flag INCLUDE_OS_VxWorks is set to OS_TRUE in the cross_os_usr h configuration file Building VxWorks Interface Library The VxWorksInterface library is located at mapusoft vxworks_interface directory From this location you will find the make files or project files at the appropriate specific lt OS gt lt tool gt lt target gt directory For instance if you need the demo application to be built for VxWorks OS using Eclipse tools and for x86 target then the make file location will be at specific vxworks lt OS gt x86 eclipse directory Building VxWorks Interface Demo Application The demo application is located at the mapusoft demo_vxworks directory location From this location you will find the make files or project files at the appropriate specific lt OS gt lt tools gt lt target gt directory For instance if you need the demo application to be built for VxWorks OS using Eclipse tools and for x86 target then the make file location will be at specific vxworks_interface lt OS gt x86 eclipse directory POSIX Interface The POSIX Interface library contains the following modules Module Description posix _interface h This header file is required in all of the POSIX source modules This header file provides the translation layer between the POSIX defines APIs and parameters to OS Abstraction The POSIX Interface demo contains the following modules Module Description demo c Contains a sample demo application Build
228. tform OS PAL enables you to view API performance data The OS PAL Profiler feature enables API data collection Collected data provides feedback concerning the utilization of MapuSoft s APIs in the project Reports allow for performance impact analysis by detailing API execution time Offers area bar line pie and scatter charts for data analysis Generate API timing report and Timing comparison report Platform API Profiling System specific API profiling Application Profiling User specific API profiling Platforms Supported for OS PAL Profiler VxWorks 6x and VxWorks 5x Linux 2 4 and Linux 2 6 LynxOS and LynxOS SE Solaris Unix Windows CE Windows XP QNX For more information on Profiling refer to OS PAL Profiler chapter on page 167 MAPUS FT Porting Made Easy 37 OS PORTING AND ABSTRACTION LAB USER MANUAL Chapter 3 OS Simulator with Host Development This chapter contains the following topics List of Available OS Simulators Host Development Environment Creating an OS PAL C C Project Adding Source Code Files to OS PAL Project Building Binary Files for a Project Executing Binary Files Debugging the Demos Supplied by MapuSoft Debugging Using External Console Terminal Inserting Application Code to Run only on Host Environment MAPUS FT Porting Made Easy ee OS PORTING AND ABSTRACTION LAB USER MANUAL List of Available OS Simulators The following is the list of available OS
229. to generate a cross reference listing This cross reference listing is a line numbered listing followed by a cross reference table This listing is written to file xlst A binary cross reference file file ref will also be generated pl length This sets the page length for the paginated source listing to length lines This option has no effect unless used in conjunction with the lp option pw width This sets the page width for the paginated source listing to width columns This option has no effect unless used in conjunction with the lp option nh No headers in listings The marked Adabgen options are already added in Ada PAL Compiler and Ada C C Changer Do not add these in your additional options tab If you add these options it will break your application Message Options m msg_kind This suppresses the display of any messages of msg kind m msg kind This enables the display of any messages of msg kind mrmsg_kind This suppresses the display of any messages of msg_ kind for the current invocation of the compiler and for any recursive invocation of the compiler mrmsg kind This enables the display of any messages of msg kind for the current invocation of the compiler and for any recursive invocation of the compiler The valid values for msg kind are a all messages except that m a does not suppress error messages d implementation dependent messages
230. ts OS Porting and Abstraction Lab File Edit Source Refactor Navigate Search Project Run Tools Window Help mi QO PO Mi te O Q iv FEY Pat Profiler pax Projects Resource Fie C C Projects 3 x H EagY i demo_ada_to_c n C demo_cross_os H C demo_nucleus E C demo_posix f demo_psos m demo_uitron demo_vxworks C demo_windows HE F O 05 PAL C Project y Import EE os Pat C Project r Export A Ada PAL Compiler Project i F Project 63 Source Folder C3 Folder Source File K Header File File from Template Class Poy Other Ctri N MAPUSS FT Porting Made Easy 41 OS PORTING AND ABSTRACTION LAB USER MANUAL 3 On OS PAL C C Project Wizard window type a project name and give a location next to Project Name text box 4 Under Project Types expand the Executable menu Select Template Project and click Next as shown in Figure 21 Figure 21 OS PAL C Project Wizard Window GS OS PAL C Project Wizard OS PAL C Project Wizard Creates OS PAL C Project Project name sample Use default location Location E 3 8_Test Builds OSPAL Win 13 8 ALPHAI9 22Novil wor i Project type Toolchains Executable MinGW GCC gt Empty Project Template Project Hello World C Project Hello World ANSI C Project H E Shared Library H E Static Library gt Makefile project Show project types and
231. uild Ada PAL Compiler Project PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help DDOR BO B E Pat Profiler pat Projects Tig Cic Projects 3 New Go Into Open in New Window Tools Exclude from build Index Build Configurations Make targets Build Project Clean Project E Copy 3 Delete Move bl E Prope E Progr a Console E adapal_1 E Ek A Ely For s Import rao g Export CC adapal_1 source helloworld ada Rename o amp Refresh CC adapal 1 source hello world el Close Project o lwinren d complete for project adapal 1 Run As consumed 138406 ms Debug As Convert To Team Farmsen ik You can view the changes or modifications if any in adaRoot folder MAPUS QFT Porting Made Easy 256 OS PORTING AND ABSTRACTION LAB USER MANUAL 14 To generate the exe file select the Ada PAL project you have created and right click and select Build Project as shown in Figure 154 Figure 154 Building the exe PAL Projects OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help ime HGB AOR PRO B dt A yi 4 a FEY pat Profiler PAL Projects ty CiC Projects X e Build Project i Building project a C 8 Probl E Prope G Progr E console O C Build adapal_1 8 R
232. ultiple main procedures may be built in a single invocation of the builder NOTE Donot confuse the name of the source file containing the main unit e g simple ada with the main unit name e g simple MAPUS FT Porting Made Easy 201 OS PORTING AND ABSTRACTION LAB USER MANUAL Options In addition to the options listed below adabgen accepts all compiler options These are applied to all invocations of the compiler that are made by the program builder Options Description 0 The 0 option identifies the version number of the executable That s a zero not an oh f The f option forces linking to occur even if there are prelinker errors ga Generate Ada oriented debugging information The ga option causes the program builder to build an executable containing Ada oriented debugging information The ga option is also applied to any implicit invocations of the compiler during program building Generate C oriented debugging information The gc option causes the program builder to build an executable containing C oriented debugging information The gc option is also applied to any implicit invocations of the compiler during program building h or help The help option shows the options that can be used with the adabgen command ke The ke option specifies that intermediate files which are normally deleted are to be kept ll option The ll switch passes option to
233. ur operating system specific code For instance if you want to add a signal handler on Windows you could do it here before calling OS_Main When optimizing you will need to write an equivalent function for your target operating system os _init_android c This function is the entry function for the native operating system This is where you should put any of your operating system specific code For instance if you want to add a signal handler on android you could do it here before calling OS_Main _os_init_ucos c This function is the entry function for the native operating system This is where you should put any of your operating system specific code For MAPUS FT Porting Made Easy 48 OS PORTING AND ABSTRACTION LAB USER MANUAL instance if you want to add a signal handler on uCOS you could do it here before calling OS_Main _os_init_netbsd c This function is the entry function for the native operating system This is where you should put any of your operating system specific code For instance if you want to add a signal handler on NetBSD you could do it here before calling OS_Main os_application_start c This function is the first OS agnostic function and should be the start point for the application development os _library_init c This function initializes the required Interface products and creates the entry threads for each product Os main c This function initializes the Cross OS Interface layer a
234. ut CROSS OS INTERFACES Host Platform Windows or Linux A HOST ENVIRONMENT EEEE EEEEEEETETETEETETEETTEETTTETTETETETETTTETETETEFETETEETETEETEEETET YV TARGET ENVIRONMENT Full Target Source Optimized c 3 OS Specific ode of Required Teccet Coda Interface Components arge plus profiling TARGET OS LynxOS SE Nucleus ThreadX VxWorks 6x Sx micro ITRON QNX T Kernel Windows XP Vista 7 MQX RT Linux uCos Your OS NetBSD Solaris Unix Target Hardware 31 OS PORTING AND ABSTRACTION LAB USER MANUAL OS Simulator with Host Development OS PAL simulates various OS interfaces such as VxWorks pSOS POSIX and Nucleus on host development environments so users can develop embedded code with preferred OS APIs and without the target hardware OS PAL s state of the art Eclipse based IDE offers seamless integration into existing development flows With OS Porting and Abstraction Lab OS PAL you can easily port abstract and optimize your code on a host machine and run the application on different target platforms OS PAL leverages the existing OS Changer and OS Abstractor technologies while adding advanced code optimization capacities on multiple OS environments OS PAL provides users an easy to use graphical user interface that is integrated with the Eclipse based CDT environment Target operating systems supported can be found here http mapusoft com products OS Simulator with Host Development ch
235. ux Kernel OS_NETBSD UNIX like Operating System OS_UCOS UCOS from Micrium For example if you want to develop for ThreadX you will define this flag as follows OS_TARGET OS_THREADX PROPRIETARY OS If you are doing your own porting of Cross OS Interface to your proprietary OS you could add your own MAPUS FT Porting Made Easy 160 OS PORTING AND ABSTRACTION LAB USER MANUAL Flag and Purpose Available Options define for your OS and include the appropriate OS interface files within os_target h file MapuSoft can also add custom support and validate the OS Abstraction solution for your proprietary OS platform Running OS PAL Generated Code on your Target NOTE This feature requires a license and documentation Click http mapusoft com contact to send a request to receive licenses and documentation After Generating Optimized Target Code for your target OS using the OS PAL Optimized Target Code Generator 1 Using a cross compiler compile link and download the OS PAL generated code to your target 2 Port low level drivers and hardware interrupt code as required refer to Cross OS Interface I O and device driver APIs sections in the reference manual 3 Resolve any run time errors Building Cross OS Interface Library Before using Cross OS Interface make sure the OS and tools are configured correctly for your target To ensure this compile link and execute a native
236. vices configuration tab select your output device from the drop drown list as shown in Figure 98 Figure 98 Output Devices Tab OS PAL Target Code Optimizer This wizard optimizes target specific source code Task Process Memory Other Resources Debug Output Devices ANSI Mapping Device I O Interface Console Output Device OS_WIN_CONSOLE MAPUS QFT Porting Made Easy 149 OS PORTING AND ABSTRACTION LAB USER MANUAL The field descriptions on Output Devices tab are as follows application Field Description Your Action Console Output Specifies the console Select the output device from the Device output device for the dropdown menu OS_WIN_CONSOLE print to console OS_SERIAL_PORT print to serial NOTE The default value is OS_WIN_CONSOLE User can print to other devices by modifying the appropriate functions within usr h and use Cross OS Interface s format I O calls MAPUS FT Porting Made Easy 150 OS PORTING AND ABSTRACTION LAB USER MANUAL 16 On ANSI Mapping configuration tab choose whether to use ANSI mapping as shown in Figure 99 If the ANSI mapping is checked the application will use MapuSoft s malloc Figure 99 ANSI Mapping Tab OS PAL Target Code Optimizer This wizard optimizes target specific source code Task _ Process Memory Other Resources Debug Output Devices ANSI Mapping Device
237. w Profiler view 83 profiler_data_1210343810 System gt Functions gt Threads D E E 1 1 N Eal 6 4 2 0 amp a P OS_Protect protect Group_Id OS_Get_Events OS _Un OS_Create_Task w c S k Q c e S Q c IL OS_Create_Event_Grow OS_Get_Current_Task_Id OS_Get_Event_Grou Functions s gt i sr E Properties 3 Property Value Average Function execution t 3 243 023 384 Nano Seconds Instance with the longest tot OS_Get_Events Instance with the shortest tol OS_Get_Event_Group_Id Tasks These are functions called for each task If you expand the Task tab you have the following as already discussed under the Functions tab e Platform APIs e Application Functions MAPUS YFT Porting Made Easy 178 OS PORTING AND ABSTRACTION LAB USER MANUAL Viewing OS PAL Profiler Data NOTE This feature requires a license Click http mapusoft com downloads ospal evaluation to request an evaluation license 1 Open the OS PAL Profiler perspective 2 From the OS PAL main menu select Tools gt Load Profiler Data File as shown in Figure 114 Figure 114 Viewing OS PAL Profiler Data Profiler OS Porting and Abstraction Lab File Edit Navigate Search Project Run MESSI Window Help A ami an a aL Load Profiler Data File E pat Profiler Debug Pat Projects Generate Report aa z Generate Comparison Repo
238. wd Figure 38 Building Binary Files PAL Projects Samplefdemo_h OS Porting and Abstraction Lab File Edit Refactor Navigate Search Project Run Tools Window Help ri Be DOR BO P i c gt Re g FEY pat Profiler pat Projects T citt Projects 63 E E demo h 23 amp B F v7 f AAAAAA ARTA TATA TART a AAT AAA aaa ATA Tea Tas TAA i New Copyright c 2007 MapuSoft 7 Go Into TARY RIGHTS of MapuSoft Technoloc Open in New Window matter of this material All me d sales rights pertaining to this license agreement The recipient the terms of the license Tools Exclude From build Index projl Build Configurations Make targets Build Project MapuSoft Technologies Clean Project Business Innovation Center Pen ew ormation please contact copy 1301 Azalea Road Mobile Alabama 36693 Tels far W E S cecce fq Paste 3 Delete Move operties 2 Progress Console Rename Import Value e Export False true amp Refresh Close Project April 20 2010 10 37 27 AM False C MapuSoft OSPAL workspacels _sarnnle Run As Debug As Convert To Porting Made Easy 62 OS PORTING AND ABSTRACTION LAB USER MANUAL 4 You can view how the binary files are built in Figure 39 Figure 39 Output for Building Binary Files for a Project PAL Projects OS Porting and Abstraction Lab File Edit Refactor
239. y Services used inside your application software are extracted from the OS Abstractor libraries and are combined with the other application objects to produce the complete image OS Changer is graphically represented in the following diagram QS CHANGER Interface Overview Diagram Your Cross OS Your Application Target Specific Target OS Module OS Changer for reusing software chapter includes the following topics e About OS Changer e Interfaces Available for OS Changer e How to Use OS Changer e Conditional Compilations e OS Changer Defines e Error Handling For more information on OS Changer refer to OS Changer for Reusing the Code chapter on page 112 MAPUS QFT Porting Made Easy ee e OS PORTING AND ABSTRACTION LAB USER MANUAL OS Abstractor for Developing Portable Software Developing a solid software architecture that can run on multiple operating systems requires considerable planning development and testing as well as upfront costs associated with the purchase of various OS and tools to validate your software MapuSoft s OS Abstractor is an effective and economical software abstraction alternative for your embedded programming By using OS Abstractor your embedded application can run on many real time RTOS and non real time operating systems to negate any porting issues in the future when your platform changes Target operating systems supported can be found here http mapusoft com products

Download Pdf Manuals

image

Related Search

Related Contents

R&S FSH Analizador de espectros  笑 顔 太 郎 株式会社 NTT スマイルエナジー  2/#/ /7.%2 3  コンパクトクールオイルクーラーキット 取扱説明書  Kenmore 50522 / 50524 Side by Side Refrigerator  Kurzeinführung in den Altium Designer  DYNA 4 - PEI Group  

Copyright © All rights reserved.
Failed to retrieve file