= POSIX Compliance = [[TOC(GSoC/2019/POSIX_Compliance , depth=2)]] '''Student(s):''' Vaibhav Gupta. '''Mentors:''' Joel Sherrill, Aditya Upadhyay, Hesham . '''Ticket: ''' [https://devel.rtems.org/ticket/2966 POSIX Compliance] ''' Development Blog:''' [https://medium.com/my-gsoc-2019-journey My GSoC 2019 Journey] == Introduction to Project == === Project Description === (Content Derived from my Proposal) This Project deals with the implementation of a subset of functions that is defined in FACE [#point8 (8) ] Technical Standard 3.0 and POSIX [#point6 (6) ] IEEE Standard 1003.1™ . Due to physical resource constraints some real time systems like small embedded system needs limited set of operating system functionality. For these type of system it is necessary that the standards allow implementation to support only a particular subset of POSIX functions. For instance, there is an approved change request against FACE 3.0 to make support for multiple processes optional. Any method listed in the FACE Technical Standard Edition 3.0, in Appendix A.1 as POSIX_MULTI_PROCESS is now optional. This is logical for embedded systems like RTEMS which follows Single Process Multi Threading Concept. === Project Goal === The goal is to add missing functions and libraries to newlib, which in turn will make RTEMS complaint to latest POSIX and FACE standards. == Project Setup == * ''' Steps I followed to setup RTEMS on host OS (my system): ''' https://github.com/VARoDeK/MyNotes/tree/master/RTEMS/InstallOnHost == Project Sandboxing on my System == {{{ Home Folder (~): /home/varodek ~/development | |____/rtems | | | |____/5 #- Directory for toolchain for rtems5 | |____/rsb #- contains RSB | |____/kernel | |____/erc32 #- contains RTEMS kernel for SPARC | |____/xilinx_zynq_a9_qemu #- contains RTEMS kernel for ARM | |____/rtems #- rtems clone from git repository | | | | |____/newlib |____/b-sparc-rtems5-newlib #- newlib compiled for SPARC using rtems5 toolchain |____/b-arm-rtems5-newlib #- newlib compiled fro ARM using rtems5 toolchain |____/newlib-cygwin #- Clone of newlib from git repository }}} == Managing Autoconf versions in sub-directories of Newlib Source Tree == For my GSoC project, I need to port some codes in Newlib. As other good projects, Newlib also uses Autoconf tools for producing **“Makefile.in”** and various other useful scripts. The situation is, inside its source tree, `newlib-cygwin/uses` autoconf tools version 2.64. Whereas `newlib-cygwin/newlib/libc` uses autoconf tools version 2.69. I wrote a blog for this: [https://medium.com/my-gsoc-2019-journey/how-to-handle-two-versions-of-autoconf-b1e28de8617b How To Handle Two Versions of autoconf?] == Apply Newlib Patche to RTEMS Source Builder == After creating patches for Newlib, I need to submit them to Newlib mailing list for review. But before I must make sure that the changes are successfully working. As Newlib is used by RTEMS as its C Library, one way is to use the patch in RTEMS and design a testsuite for it. If tests are successful, the changes are fine. [https://medium.com/my-gsoc-2019-journey/apply-newlib-patch-to-rtems-source-builder-6873b0fb31b8 Apply Newlib Patch to RTEMS Source Builder] == Task: Add psxinttypes01 for `` methods == //This task was continued by me, original work belongs to the GSoC 2017 student of same project//. The working directory is : `rtems/testsuites/psxtests`. ==== Modify the testsuite `psxinttypes01/init.c` ==== There was need to modify the original code to add some more tests and fix some bugs. `inttypes` uses [http://pubs.opengroup.org/onlinepubs/009695399/functions/strtoimax.html strtoimax] and [http://pubs.opengroup.org/onlinepubs/009695399/functions/wcstoimax.html wcstoimax]. The 'opengroup' page contains every information to write testcases. For a good testsuite, every output (expected or error value) has to be verified. The patch: https://devel.rtems.org/changeset/d9fcb22/rtems ==== Add `psxinttypes01/psxinttypes01.doc` and `psxinttypes01/psxinttypes01.scn` ==== ==== Modify `configure.ac` ==== Entry had to be made for `psxinttypes01` in `configure.ac`, so as it gets build with rest of the testsuites of rtems. Note, not to change the alphabetical order of the previous entries. {{{ diff --git a/testsuites/psxtests/configure.ac b/testsuites/psxtests/configure.ac index cdd6ee7e4e..85559e4aa5 100644 --- a/testsuites/psxtests/configure.ac +++ b/testsuites/psxtests/configure.ac @@ -91,6 +91,7 @@ RTEMS_TEST_CHECK([psxid01]) RTEMS_TEST_CHECK([psximfs01]) RTEMS_TEST_CHECK([psximfs02]) RTEMS_TEST_CHECK([psxintrcritical01]) +RTEMS_TEST_CHECK([psxinttypes01]) RTEMS_TEST_CHECK([psxitimer]) RTEMS_TEST_CHECK([psxkey01]) RTEMS_TEST_CHECK([psxkey02]) }}} ==== Modify `Makefile.am` ==== This entry is made to generate `make` commands inside `Makefile.in`. Note `$(support_includes)` CPPFLAG is necesaary to include required header files. {{{ diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am index 1e354c0df7..59c9f2085b 100755 --- a/testsuites/psxtests/Makefile.am +++ b/testsuites/psxtests/Makefile.am @@ -523,6 +523,13 @@ psxintrcritical01_CPPFLAGS = $(AM_CPPFLAGS) \ endif endif +if TEST_psxinttypes01 +psx_tests += psxinttypes01 +psxinttypes01_SOURCES = psxinttypes01/init.c +psxinttypes01_CPPFLAGS = $(AM_CPPFLAGS) $(TEST_FLAGS_psxinttypes01) \ + $(support_includes) +endif + if HAS_POSIX if TEST_psxitimer psx_tests += psxitimer }}} == References == * [=#point1 (1) ] ''' My Notes: ''' https://github.com/VARoDeK/MyNotes/tree/master/RTEMS * [=#point5 (5) ] https://www.sourceware.org/newlib/ * [=#point6 (6) ] https://en.wikipedia.org/wiki/POSIX * [=#point7 (7) ] https://en.wikipedia.org/wiki/C_standard_library * [=#point8 (8) ] https://en.wikipedia.org/wiki/Future_Airborne_Capability_Environment * [=#point9 (9) ] https://en.wikipedia.org/wiki/Institute_of_Electrical_and_Electronics_Engineers