UUWL aka Unix to Unix Wrapper Library

649 views

Published on

Presentation on a Library helping C/C++ developers to port applications from RISC/Unix platoorms to Linux on Intel Architecture.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
649
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

UUWL aka Unix to Unix Wrapper Library

  1. 1. Unix to Unix Wrapper Library (B64) UUWL Shanghai Solution Center TeamCheng Yan-Zhang, HP RISC Migrations Solutions LeadBruno Cornec HP EMEA Open Source Profession LeadArnaud Meurant HP WW OSSI & RISC Migrations
  2. 2. Introducing Myself● Software engineering and Unices since 1988 ● Mostly Configuration Management Systems (CMS), Build systems, quality tools, on multiple commercial Unix systems ● Discover Open Source & Linux (OSL) & first contributions in 1993 ● Full time on OSL since 1995, first as HP reseller then @HP● Currently: ● Master Technology Architect on OSL for the HP/Intel Solution Center, Grenoble ● OSL HP Advocate ● EMEA OSL HP Profession Lead ● Solutions Linux Conference and OWF board member ● MondoRescue, Dploy.org, Project-Builder.org project lead ● LinuxCOE, mrepo, tellico, rinse, fossology, collectl contributor ● FOSSBazaar and OSL Governance enthusiast ● Mandriva, Mageia, Fedora packager2 Bruno Cornec
  3. 3. Agenda3 ©2010 ©2009 HP Confidential Hat restricted / Intel / Red
  4. 4. Agenda• UUWL Introduction • Project Outline • Goals and phased approach• Architecture • Global Architecture • Implementation details• Demo• Project Deliverables• Wrap-up / Next steps4 HP / OSSI / Bruno Cornec
  5. 5. Context & StatusHP Intel RISC Migrations ProgramContext: ● Work done as part of the joint HP Intel Solution Centers and Open Source Solutions Initiative work on RISC to Linux migrationsGoal: ● Accelerate and ease customer transitions from competition RISC/Unix to HP IA. ● Allow for easy integration inside their own developmentsTimeline: ● 2011-Oct-17: Solution Stack approved by HP/Intel - First phase targets Solaris to Linux migration, with a global architecture to support more migrations ● 2011-12 → 2012-04: First phase Development ● 2012-04-19: Second phase targets AIX to Linux migration, approved by HP TS WW ● 2012-05 → 2012-11: Second phase Development ● 2012-12 → 2013-03: Finalize tests, documentation and packaging ● More information available on http://www.hpintelco.net5 HP / OSSI / Bruno Cornec
  6. 6. Project GoalsDefinition and TargetsUUWL is: UUWL is targeted at:• A porting tool for speeding up the Unix to • Reducing the cost of migration by saving 40% Unix/Linux migration of C/C++ of total migration effort. applications. • covering >70% of all incompatibility issues in• Reducing the number of changes to be Linux porting, which may take about 60% of made to the original source code while porting effort migrating Unix-based applications, to cut down the time and effort it takes to be up • taking 5% of the porting effort in its study and running on Linux. • Taking out 15% of the porting effort of each• Designed to support porting from any Unix project by leveraging code in it to any Unix, with phase 1 focussing on Solaris (9 and upper) to Linux and phase 2 • Improving the stability of the migrated system from AIX to Linux. with a tested layer• NOT a tool to detect porting issues nor to • RHEL 6 x86_64 as the test platform (gcc 4.1.x help with porting the build environment as and above), with support of 32 bits apps as other tools like SLPK. well.6 HP / OSSI / Bruno Cornec
  7. 7. Architecture & Realization7 ©2010 ©2009 HP Confidential Hat restricted / Intel / Red
  8. 8. Technical Architecture on SolarisConceptual Approaches Two migration approaches : • modifying the code of the original application to make it use a set of new portable system calls providence by the UUWL, themselves being identical from an interface perspective from one Unix to another • keeping the original application untouched. In that case, the adaptation required should be performed with an additional piece of software, called the adapter, which will in turn call the UUWL, and should exist for each pair of source/target OS8 HP / OSSI / Bruno Cornec
  9. 9. Technical Architecture on AIXConceptual Approaches Two migration approaches : • modifying the code of the original application to make it use a set of new portable system calls providence by the UUWL, themselves being identical from an interface perspective from one Unix to another • keeping the original application untouched. In that case, the adaptation required should be performed with an additional piece of software, called the adapter, which will in turn call the UUWL, and should exist for each pair of source/target OS9 HP / OSSI / Bruno Cornec
  10. 10. Technical Details Approach 1 Design and Implementation of UUWLfor Approach 1 Change the source file to include A new entry is created in the UUWL the related UUWL .h file for this function and realized •new function names corresponds to theAn incompatible call is found based on its specification on the original one prefixed by “uuwl_” as much as possible, and similarly for include files source OS. It just calls the source function on the source OS. The application is now portable byApplication to be linked with the calling uuwl_ consistent andUUWL library (with -luuwl) to work available system calls acrosscorrectly OSes. 10 HP / OSSI / Bruno Cornec
  11. 11. Technical Details Approach 2Design and Implementation of UUWLfor Approach 211 HP / OSSI / Bruno Cornec
  12. 12. UUWL characteristicsSummary of the Development• Delivered: Sloccount Results Effort: ● UUWL Source code Development Effort Estimate, Person-Years ● User Guide (Person-Months) = 0.72 (8.63) ● Function List (Basic COCOMO model, Person-Months = 2.4 * ● Tested sample programs ported with UUWL (KSLOC**1.05))• Coverage Summary: Schedule Estimate, Years (Months) = 0.47 (5.67) ● Functions covered: 321 ● Macros covered: 537 (Basic COCOMO model, Months = 2.5 * (person- ● Structures covered: 51 months**0.38))• Sloccount Results Code: Estimated Average Number of Developers ● Include ansic=2002 (Effort/Schedule) = 1.52 ● src_top_dir ansic=1367 Total Estimated Cost to Develop = $97112 ● Total Physical Source Lines of Code (SLOC) ansic 3369 (99.62%) (average salary = $56,286/year, overhead = 2.40). sh 13 (0.38%)12 HP / OSSI / Bruno Cornec
  13. 13. UUWL usageGeneric Steps to Use UUWL in Porting Approach 1 :To Implement: To Verify:1. Find the most commonly-used header file (ask • Is the program using the UUWL ? to the program owner, search for keywords e.g. $ ldd <executable_file> “common.h”)2. Adds a #Include uuwl/UUW.h line in the • Does the program run on the target OS ?  identified commonly-used header files or in all souce files if it doesn t exist3. Update the makefile by adapting compile options and referencing the UUWL library (- luuwl)4. Update the original source code to replace non- portable system calls by the corresponding uuwl_ ones.5. Compile the source code with new makefile6. Fix other errors according to the compilation output13 HP / OSSI / Bruno Cornec
  14. 14. UUWL usageGeneric Steps to Use UUWL in Porting Approach 2 :To Implement: To Verify:1. Find the most commonly-used header file (ask • Is the program using the UUWL ? to the program owner, search for keywords e.g. $ ldd <executable_file> “common.h”)2. Adds a #Include uuwl/ • Does the program run on the target OS ?  UUWLSolaristoLinuxAdapter.h line in the identified commonly-used header files or in all souce files if it doesn t exist3. Update the makefile by adapting compile options and referencing the UUWL library (- luuwl) and the related adapter --lUUWLSolarisToLinux)4. Compile the source code with new makefile5. Fix other errors according to the compilation output14 HP / OSSI / Bruno Cornec
  15. 15. Sample UUWL ImplementationTo prove the design and part of the functionsSample Programs: Sample Sourcecode Compilation: • $ gcc -DLINUX -DNFS -DVPRINTF -DKVM -DSVR4 -DSUNOS=55• sps on Solaris -DMAXUSERS=30000 -DMAXTTYS=2500 -D_GNU_SOURCE -I/usr/include -I. -lm -lrt -lcrypt -c -g -O2 -Wall filecount.c• apcd on Solaris• lpr on Solaris • Before adding UUWL header to the common header-sps.hTargets: • sps.h:151:9: warning: extra tokens at end of #endif directive• Work on Linux after adding the UUWL layer • In file included from filecount.c:1: • sps.h:273: error: field pr_pi has incomplete type into the Solaris source-codes • sps.h:276: error: field pr_p has incomplete type • sps.h:282: error: field pr_pu has incomplete type• Functions kept • sps.h:300:9: warning: extra tokens at end of #endif directive• Changes to the source code reduced compared to a direct porting • After adding UUWL header to the common header-sps.h• Simple implementation process • sps.h:151:9: warning: extra tokens at end of #endif directive • sps.h:300:9: warning: extra tokens at end of #endif directive15 HP / OSSI / Bruno Cornec
  16. 16. Demo of portingsps from Solaristo Linux using theUUWL16 HP / OSSI / Bruno Cornec
  17. 17. Wrap-up / Next steps17 ©2010 ©2009 HP Confidential Hat restricted / Intel / Red
  18. 18. DeliverablesProject URL and ResourcesProject home URL• http://uuwl.project-builder.org/• Source code viewer• Reference documents, a Users guide and links• Test code• The project is an HP OSRB approved project since 2012-02-17 (#10686 at http://pts.corp.hp.com/proposal_editor/?10686).• The code is delivered under the dual licences MIT and LGPLv2.1To checkout source code from SVN:• svn co svn://svn.project-builder.org/uuwl/devel develTo submit issues:• http://uuwl.project-builder.org/newticket18 HP / OSSI / Bruno Cornec
  19. 19. Next stepsProject usage in PoCs• Large plane manufacturer interested to use it in 3 migration projects (US). Shanghai team asked to contribute to the setup and extend the UUWL.• 2 Banks in UK are also in the funnel list.Next phases :• Funding is under discussion for an HP-UX to Linux proprietary module (Phase 3) with HP WW TSOther developments• Discussions are held with the SLPK team to see what commonalities and synergies can be setup.• Project has been internally announced (5000 persons) and also externally.• 2 webinars done for phase 1 in May 2012 – 1 new webinar in Nov. 2012 for phase 1&2.• Use project-builder.org to produce packages for 120+ distribution tuples.• Official Mageia/Fedora packaging is a next step.19 HP / OSSI / Bruno Cornec
  20. 20. Thank you ! Q&A (B64)20 ©2010 ©2009 HP Confidential Hat restricted / Intel / Red

×