Skip to main content

Simplified kernel extensions with AIX Version 6

Brad Cobb (bcobb@us.ibm.com), AIX Collaboration Center, IBM
Brad Cobb works in the AIX Collaboration Center, where he collaborates with independent software vendors on exploiting key AIX features available on pSeries® servers. Brad has over ten years of experience porting applications to AIX, during which he has worked with various application types. You can reach him at bcobb@us.ibm.com. Also visit the AIX Collaboration Center for more information on AIX.
Stephen Peckham (speckham@us.ibm.com), Senior Software Engineer, IBM 
Stephen Peckham, IBM Corporation, 11400 Burnet Road, Austin, TX 78758. Dr. Peckham is a senior software engineer in the IBM Server Group, where he has been a member of the AIX kernel development team for the past 10 years. He has worked on the link editor, system loader, and runtime linker in recent years, and currently is focusing on performance improvements to the AIX virtual memory system. Dr. Peckham has a Ph.D. in Computer Science from Cornell University.

Summary:  Discover why you need to change your applications and build environments that supply 32-bit-only kernel extensions to accommodate IBM AIX® Version 6. With AIX Version 6, the kernel environment is 64-bit kernel only. Previously, the AIX operating system provided both 32-bit and 64-bit kernels, requiring 32-bit and 64-bit kernel extensions. In this article, apply two easy solutions to help you make the transition and start reaping the benefits of the simplified kernel environment.

Date:  28 Aug 2007
Level:  Intermediate
Activity:  1968 views

Background

The IBM AIX® operating system historically provided both 32-bit and 64-bit kernels, requiring kernel extension developers to provide 32-bit and 64-bit kernel extensions. To help developers manage multiple kernel extensions, the AIX operating system provides the dual-mode archive method, which permits both 32-bit and 64-bit kernel extensions in the same archive file. At load time, the system loader then loads the bit-appropriate kernel extension.

Beginning with AIX Version 6, the AIX operating system simplifies its kernel environment by providing only the 64-bit kernel. AIX Version 6 maintains binary compatibility with previous AIX versions, as defined by AIX binary compatibility (see Resources).

A simplified kernel extension environment

With the removal of the 32-bit kernel from AIX Version 6, the development effort for kernel extensions is significantly reduced. Kernel extension developers will not be able to build, or even test, 32-bit kernel extensions on AIX Version 6. The reduction of kernel environments means an improved return on investment, requiring less resources to develop, build, test, package, and manage kernel extensions.

To support 64-bit kernel extensions on AIX Version 6, support for building 32-bit kernel extensions is removed from kernel libraries and kernel import files. The <sys/types.h> header file is modified so that if _KERNEL is defined but __64BIT__ is not, a compilation error ensues. With the ability to build only 64-bit kernel extensions, some kernel extension build environments might require changes to avoid build errors.

Effects of 64-bit kernel only

This simplified kernel environment has the following concerns:

  • Applications that supply 32-bit-only kernel extensions will be affected.
  • Application build environments that provide 32-bit and 64-bit kernel extensions will be affected when building their kernel extensions on AIX Version 6.

Applications requiring a 32-bit-only kernel extension, whether directly or indirectly through third-party code, will fail to load the kernel extension. Depending on the application logic, the inability to load the kernel extension might result in the application being unusable or severely hindered on AIX Version 6. This is not a breakage of the AIX binary compatibility statement, but a fact that 32-bit kernel extensions are not supported.

Applications that provide both a 32-bit and a 64-bit kernel extension require minor changes in their AIX Version 6 build environment. With the removal of the 32-bit kernel and the 32-bit kernel extension build environment in AIX Version 6, automated build environments that build both 32-bit and 64-bit kernel extensions need modifications to accommodate the single, 64-bit, kernel extension environment.

Support of dual-mode kernel extensions is not being removed from AIX Version 6, and the removal of the 32-bit kernel does not affect binary compatibility. Dual-mode kernel extensions built on AIX Version 5 continue to run on AIX Version 6, but only in 64-bit mode.

The next sections offer two solutions for making the transition to AIX Version 6.

Solution I

Automated build environments that build both 32-bit and 64-bit kernel extensions must now check the operating system version prior to building a 32-bit kernel extension. A simple check is sufficient, such as:

#!/bin/ksh
Version='uname –v'
if [ $Version –gt  "5" ]
then
	# Build 64-bit kernel extension only
else
	# Build both 32-bit and 64-bit kernel extensions
fi	

The above logic would build both 32-bit and 64-bit kernel extensions on AIX Version 5, and build only a 64-bit kernel extension for AIX Version 6.

Solution II

Makefiles that support the building of both 32- and 64-bit kernel extensions can be modified. A typical Makefile file for building a dual-mode kernel extension has lines similar to:

kext: kext32 kext64:
        ar –X32_64 –crf kext kext32 kext64

kext32: …
        ld –b32 –o $@ …

kext64: …
        ld –b64 –o $@ …

other-makefile-lines


This can be converted to a Makefile file building only a 64-bit kernel extension by modifying these lines to:

kext: …
ld –b64 –o $@ …

other-makefile-lines

With this solution, the name of the kernel extension is unchanged, so an existing configuration method continues to work without being modified.

Summary

Reducing the number of AIX Version 6 supported kernels reduces the development costs for IBM and kernel extension providers. The reduction in cost and improved return on investment comes from reduced resources for developing, building, testing, packaging, and maintaining multiple kernels and kernel extensions.


Resources

Learn

Get products and technologies

  • IBM trial software: Build your next development project with software for download directly from developerWorks.

  • Quick links for AIX fixes: Get your AIX updates here.

  • IBM Fix Central: This site provides fixes and updates for your system's software, hardware, and operating system.

Discuss

About the authors

Brad Cobb works in the AIX Collaboration Center, where he collaborates with independent software vendors on exploiting key AIX features available on pSeries® servers. Brad has over ten years of experience porting applications to AIX, during which he has worked with various application types. You can reach him at bcobb@us.ibm.com. Also visit the AIX Collaboration Center for more information on AIX.

Stephen Peckham, IBM Corporation, 11400 Burnet Road, Austin, TX 78758. Dr. Peckham is a senior software engineer in the IBM Server Group, where he has been a member of the AIX kernel development team for the past 10 years. He has worked on the link editor, system loader, and runtime linker in recent years, and currently is focusing on performance improvements to the AIX virtual memory system. Dr. Peckham has a Ph.D. in Computer Science from Cornell University.

Comments (Undergoing maintenance)



Trademarks  |  My developerWorks terms and conditions

Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=AIX and UNIX
ArticleID=251468
ArticleTitle=Simplified kernel extensions with AIX Version 6
publish-date=08282007
author1-email=bcobb@us.ibm.com
author1-email-cc=
author2-email=speckham@us.ibm.com
author2-email-cc=

My developerWorks community

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Special offers