Most of the time, when we refer to Unix and Linux migrations we are talking about moving from Unix to Linux. But what about the reverse scenario, moving from Linux to Unix? This raises a few questions: Why would someone want to port to Unix from Linux? What are some of the technical challenges in doing this kind of port? Where do we start?
Usually, organizations port their Linux applications to Unix for one of two reasons:
Take IBM's Unix flavor, AIX, for example. Unlike Sun's version of Unix, Solaris -- which is available on RISC and CISC platforms -- AIX is available only on IBM's RISC platform. AIX is based on the ATT System V UNIX operating system, though it has incorporated so many features from BSD that many consider it a hybrid of the two. IBM has considerably enhanced the OS to take advantage of its hardware and the many virtualization innovations in recent years. Linux, unlike AIX, does not conform to the IEEE Std 1003.1-2001 standard (POSIX) and has its own standards.
Endianness
One reason users choose UNIX over Linux is greater endianness, a term that describes the ordering of memory used for data representation. Endian-neutral code does not have any dependencies on byte ordering and allows for greater portability between systems. Because most Linux users are running the OS on commodity based Intel hardware, there are already built-in challenges. AIX runs on System p servers, which are big-endian, while PCs are little-endian. We must first determine if the code is endian-neutral. In order for an application or a device driver to use the same source code base on both platforms, it must be endian-neutral. The exception is to use conditional compilation, selecting only appropriate code modules which are neutral. The only way to confirm this is to do appropriate User Acceptance Testing (UAT) to ensure that the application retains its functionality while being ported across different platforms.
To continue reading for free, register below or login
To read more you must become a member of SearchEnterpriseLinux.com
');
// -->

>32-bit or 64-bit?
Is the application 32- or 64-bit? If it's 32-bit, confirm that you want to stay 32-bit and also move it that way, as opposed to moving it to 64-bit. If the expectation is that you want to ultimately move to 64-bit, it should be a day-two activity. The first project would be porting the application to AIX 32-bit. Moving to 64-bit would be a separate project. Understand that moving from a 32-bit to 64-bit model is a development activity not a port. AIX systems can support either a 32-bit or 64-bit kernel. PCs support 32-bit kernels, while Itanium based systems only support 64-bit. The decision to further port to 64-bit depends upon the following:
Understand that with 64-bit applications, you will require more stack space to hold larger registers. More importantly, 64-bit applications will not run on 32-bit hardware platforms. Many folks prefer to keep their application 32-bit for this purpose alone, as it can usually run on 64-bit systems without any code changes.
Two big issues when converting 32-bit to 64-bit include data-type consistency, data models, and interoperation between applications using the different models. In a best case scenario, it is possible that the source may require only to be recompiled (while also relinking to 64-bit libraries). In a worse case scenario, code changes may be required.
There are typically six steps towards doing this kind of port:
Regarding enhancements, I prefer to make these day-two activities. Another day-two activity (for software distribution companies) is considering how to roll-out the application in a form of a package, for installation purposes. This would be done for companies that must distribute software to multiple clients. For instance, do you want them to do an install with standard AIX commands, such as installp, or with more traditional
Unix commands?
Up to now, we've discussed the reasons to do a port, the larger issues to look for, and the overall methodology. What about tools? What does IBM offer to Linux developers to help port their application over?
AIX Toolbox for Linux applications
To assist with your porting needs, IBM provides the AIX Toolbox for Linux Applications. This system delivers installable open source tools to help you facilitate the recompilation of open source software - -oftentimes without modifications -- on AIX systems. The AIX Toolbox helps with building and packaging Linux applications on AIX; developing new applications for AIX using GNU and Linux development tools;
running open source software found on Linux; and managing software using RPMs. It also includes the following:
It's important to note that Linux applications being recompiled to run on AIX 5L must be written using standard Linux APIs and use the GNU gcc and g++ compilers. Two final points to consider:
We stress that porting is never something to be considered lightly. Make sure you fully understand why you are making this effort and do not cut corners when planning your port. The more time you spend up-front doing your homework, the better chance you will have at success.
About the author: Ken Milberg is a systems consultant with two decades of experience working with Unix and Linux systems. He is a SearchEnterpriseLinux.com Ask the Experts advisor and columnist.