Cover image for Unix to Linux porting : a comprehensive reference
Title:
Unix to Linux porting : a comprehensive reference
Personal Author:
Series:
Prentice Hall open source software development series
Publication Information:
Upper Saddle River, NJ : Prentice-Hall, 2006
ISBN:
9780131871090

Available:*

Library
Item Barcode
Call Number
Material Type
Item Category 1
Status
Searching...
30000010134566 QA76.76.O63 M464 2006 Open Access Book Book
Searching...

On Order

Summary

Summary

'Unix to Linux Porting' shows application developers how to port thier Unix-based C, C++, and Java applications to Linux.


Author Notes

Alfredo (Freddie) Mendoza is an IT specialist in the Business Strategy and Enablement group within the IBM Systems and Technology division with more than 19 years in application architecture and management. He currently works with independent software vendors to port and migrate their applications into IBM cross-platform operating system offerings. Prior to his current position, Mr. Mendoza worked in IBM's Global Services, for AIX Kernel development organizations, and as an independent consultant for different software development organizations. Mr. Mendoza has authored and coauthored several patent invention publications on thread management and software algorithms. He is the author of the book Introduction to Utility Computing and coauthor of "Design of an Enablement Process for On-Demand Applications" in the Utility Computing issue of the IBM Systems Journal .

Chakarat Skawratananond , Ph.D., is a technical consultant in the IBM Business Strategy and Enablement organization. He provides technical assistance to software vendors to bring their applications to IBM POWER processor-based systems running AIX and Linux. He has 10 years of experience in UNIX software development and has published several articles related to Linux software migration and performance tuning. He holds a Ph.D. in electrical and computer engineering from the University of Texas at Austin.

Artis Walker is a consultant in the IBM Business Strategy and Enablement group. He provides assistance in porting software vendors' applications and databases to pSeries servers running AIX and Linux on IBM POWER. He has more than 15 years' experience working on both Microsoft Windows and UNIX platforms, including AIX and Sun Solaris. He has extensive software development experience in IBM DB2 Universal Database (DB2 UDB), ORACLE, ODBC, JDBC, C, C++, and Java. He has published numerous tutorials and articles on migration and performance tuning on AIX and DB2. In addition, he is the originator and main author of a series of articles titled "IBM Embraces Open Source," which highlights various open-source solutions and their operability and setup on AIX and Linux on the POWER platform. He holds a BA in computer science from St. Mary's University in San Antonio, Texas.


Reviews 1

Library Journal Review

Every public and academic library should stock current Linux guides (see Computer Media, LJ 6/1/05). PC Magazine Linux Solutions covers installing, configuring, and administering Linux systems. It is most useful to beginning home Linux users, although it does have information on using Linux on a small business network. The discussions on choosing an appropriate Linux distribution, dual-booting with Windows, and using live-CD distributions are particularly helpful; the companion CD contains Knoppix, a live-CD Linux distribution. Straightforward and clear; for all libraries. Windows to Linux Business Desktop Migration addresses businesses considering Linux migration, with straightforward comparisons and reasoning to help readers make informed decisions. Moving from why businesses should migrate to the Linux desktop to thin client computing, the coverage is very nice. Readers will especially benefit from the author's treatment of alternatives for business desktop applications, data migration, case studies, and a Linux distribution competitive analysis; the CD contains Knoppix. For medium and larger libraries. User Mode Linux, written by the creator of the UML project, features step-by-step instructions to UML's various uses. UML is a virtual Linux machine, useful for test environments and other projects that need to isolate users and processes. Users of a given UML instance, for example, can be given root privileges without worrying if they'll affect the rest of the network. UML instances can be easily and quickly created and discarded, which makes them ideal for such purposes. Thorough and useful for larger libraries. As the business use of Linux grows, so does demand for applications that mirror the functionality of UNIX versions. UNIX to Linux Porting addresses experienced developers and project managers needing to port their applications from UNIX OS such as Solaris, HP-UX, and AIX over to Linux. Nicely thorough, the book moves from scoping projects and analysis to testing and debugging. An overview of the porting process is especially useful. Recommended for large libraries. For beginning through advanced users but most useful for newbies and those moving from Windows, Beginning Ubuntu Linux covers topics from installation through replacements for Windows programs to ongoing administration and troubleshooting. Ubuntu is built around Debian; the CD-ROM contains the complete Ubuntu distribution. A newer version came out in June but can be freely downloaded (changes are minor, and the title remains relevant). Very clear, very thorough, and very solid background explanations; highly recommended. (c) Copyright 2010. Library Journals LLC, a wholly owned subsidiary of Media Source, Inc. No redistribution permitted. All rights reserved.


Excerpts

Excerpts

Preface Having started off as a hacker's exploratory journey to create a free UNIX-like operating system (OS), today Linux represents a viable competitive solution in use worldwide. Being freely redistributed and with all the strengths of UNIX-based operating systems, it is everywhere. People use it to deploy intensive industry solutions such as file servers, Web servers, e-mail, and middleware support. And yet, the operating system is flexible enough to be run as a desktop client on personal computers (PCs). Although the journey to success has been bumpy, it was worth it. Linux has always been popular within the university setting, but it has really taken off within the corporate world only in the past few years, in part because of the support of and acceptance by large companies. Slowly, over the past few years, Linux has come closer to becoming an enterprise-ready OS for use in such areas as telecom, government, manufacturing, and others. Recent news of accelerated Linux adoption is all over trade magazines, and studies done by the large research firm Forrester Research report that Linux is the fastest-growing OS (running mission-critical applications in 53 percent of 140 large North American companies 1 ). The same Forrester study reports that 52 percent of the same 140 companies run their new applications on Linux, and 44 percent of them use Linux to port their older applications to newer hardware. A similar study 2 done by SG Cowen suggests that, more and more, Linux is becoming the OS of choice. Therefore, developers need a structured and concise book that examines the differences between Linux and UNIX operating systems such as Solaris, HP-UX, and AIX. Software programmers familiar with writing applications on UNIX operating systems such as Solaris, HP-UX, and AIX now have to learn how to program on Linux. This book is written for those tasked with porting applications to the Linux environment (developers, application architects, and project managers): For application developers, this book identifies the differences between UNIX operating systems used in today's IT infrastructure. For application architects, this book provides information to help them decide which modules of their applications can best fit the Linux OS. For project managers, this book gives them a clear understanding of requirements and what it takes to port to the Linux environment. How This Book Is Organized Chapter 1, "Porting Project Considerations," supplements existing project management material by pointing out specific tasks that project managers and application architects need to think about before and during a porting project. It introduces you to the porting process and methodology we use in porting projects. Each step in the porting process presented forms the basis of discussion for the chapters that follow. Chapter 2, "Scoping," discusses the first step in the porting process. Its general presentation of the Linux environment includes an examination of the available compilers, the GNU binutils, the Java environment, shells, and packaging options available on Linux. With the help of the assessment questionnaire in Chapter 1, you can assess the application to be ported to determine the level of work required to port the application. At the end of this chapter, a checklist of project management tasks helps you scope out the preliminary tasks for the project. Chapter 3, "Analysis," discusses how to investigate the application architecture at a deeper level. Like Chapter 2, this chapter examines technical features available in Linux. This chapter covers, among other things, what Linux makes available in terms of application programming interfaces (APIs), library functions, library versioning implementation, and system features such as large page support. Each topic invites the porting engineer to ascertain that the application can be ported using Linux functionalities and features. As part of our porting methodology, and to eliminate risk as much as possible, the analysis step exists to uncover any variables (known and unknown) that can come up during the porting phase. Chapter 4, "Porting Solaris Applications," Chapter 5, "Porting AIX Applications," and Chapter 6, "Porting HP-UX Applications," are the three core chapters of this book. Each comprehensive chapter details differences and similarities between the source (Solaris, AIX, or HP-UX) and the target (Linux) operating system. Topics discussed include standards support, compiler options, linker options, a comparison of system calls, a comparison of library calls, and threads. Each chapter helps porting engineers quickly find answers to questions about porting applications to Linux. These chapters answer common questions such as, "Do the APIs used in my application exist on Linux?" and "How do Linux POSIX threads compare to Solaris threads?" Chapter 7, "Testing and Debugging," covers Linux debugging and performance tools. As the porting work progresses to the testing and debugging phase, porting engineers will encounter diverse issues from software bugs to performance bottlenecks. This chapter discusses the tools that porting engineers can use to address these issues. Debugging tools such as the GNU debugger, memory leak tools, cscope, and performance tracing tools are discussed. This chapter also identifies Web sites where you can download these tools. Theappendixesinclude tables of APIs, compilers, and linker options, providing a quick reference when you are porting from the source to the Linux OS. You also learn about Linux on POWER (that is, the porting differences when porting to Linux running on the IBM POWER architecture). How to Use This Book You can go through this book in several ways. However, we recommend that you start with Chapter 1 to gain an understanding of our methodology and thinking. After reading the first chapter, proceed with Chapters 2 and 3. When you get to the porting step, choose the operating system from which the application is being ported, and read that chapter. Then, after you have completed the porting, proceed to Chapter 7. This process is shown in Figure P-1. Figure P-1 Recommended way to work through this book Another way to work through this book is to skip Chapters 1, 2, and 3 entirely and jump directly to one of the porting chapters (4, 5, or 6). In this way, you can use this book as reference material for porting projects already under way (rather than as a guide). Some technical information in Chapters 4, 5, and 6 is intentionally repeated so that those who want to port only from one particular UNIX platform to Linux will have one self-contained chapter to reference. Although our original intent with this book was to create a porting guide (from UNIX to Linux), it has also become a comprehensive development and troubleshooting reference. As a development reference, it contains code examples to solve specific problems (such as building shared and static archive libraries, using POSIX threads, interprocess communications, and more). And depending on the platform you are porting from, it gives a side-by-side solution comparison of the three popular UNIX platforms (HP, Solaris, and AIX), including what it would take to create the same solution on Linux. In essence, this book is three books in one. Regardless of your porting needs, this book explores solutions to some of the most common coding practices and provides a wide array of solutions (based on experience) to the most common problems Linux porting engineers face. As a troubleshooting reference, this book provides code examples, compiler and linker flags, and alternatives for solving the most common nuances that porting engineers face when porting code to Linux. We have attempted to cover as much material as possible and believe the information will, at least, provide a starting point for additional research that may be required on your part to address specific needs. For additional assistance on porting, you can research the Internet and some of the following references: UNIX Porting Guide (various guides to porting software from one UNIX variant to another), at http://www.unixporting.com/porting-guides.html Guide to Porting from Solaris to Linux on POWER (white paper on porting to Linux on the IBM POWER architecture), at http://www-128.ibm.com/developerworks/linux/library/l-pow-portsolaris/ Porting references from Novell (various white papers about porting to Linux), at http://developer.novell.com/wiki/index.php/Porting_and_Migration Solaris-to-Linux Porting Guide (by Ulrich Drepper; a white paper on porting from Solaris to Linux on Intel), at http://www.redhat.com/docs/wp/solaris_port/book1.html We hope you enjoy reading this book as much as we have enjoyed writing it! Footnotes "Linux Crosses Into Mission-Critical Apps," Forrester Research Inc., April 26, 2004 "Linux and Open Source Gain Momentum," SG Cowen, December 11, 2003 (c) Copyright Pearson Education. All rights reserved. Excerpted from Unix to Linux Porting: A Comprehensive Reference by Chakarat Skawratananond, Artis Walker, Alfredo Mendoza All rights reserved by the original copyright owners. Excerpts are provided for display purposes only and may not be reproduced, reprinted or distributed without the written permission of the publisher.

Table of Contents

Preface xix
Acknowledgments xxv
About the Authors xxvii
Chapter 1 Porting Project Considerationsp. 1
Chapter 2 Scopingp. 29
Chapter 3 Analysisp. 51
Chapter 4 Porting Solaris Applicationsp. 97
Chapter 5 Porting AIX Applicationsp. 203
Chapter 6 Porting HP-UX Applicationsp. 345
Chapter 7 Testing and Debuggingp. 445
Appendix A Solaris to Linux
Reference Tablesp. 493
Appendix B AIX to Linux
Reference Tablesp. 541
Appendix C HP-UX to Linux
Reference Tablesp. 569
Appendix D Linux on POWERp. 653
Appendix E Gprof helperp. 659
Appendix F Porting Issues Specific to the IBM zSeriesMainframep. 663
Appendix G Solaris to Linux Migration: A Guide for System Administratorsp. 675
Indexp. 697