3.1. User process models on AIX

Starting with AIX Version 4.3, AIX supports two user process models, 32- and 64-bit, which we explain in the following sections:

  • Section 3.2, “The 32-bit user process model” on page 109

  • Section 3.3, “The 64-bit user process model” on page 130

Before explaining these models in detail, we provide a short introduction in this section. As shown in Figure 3-1, there are four combinations of kernel and hardware support of 32- and 64-bit support.

Figure 3-1. Hardware, kernel, and user process relationships


If the hardware bit mode is 32-bit, then 64-bit user processes cannot run on the 32-bit kernel (represented as A in Figure 3-1), also the 64-bit kernel cannot run on the 32-bit hardware (B).

If the hardware bit mode is 64-bit, then both 32- and 64-bit user processes can run regardless of the kernel type, though 64-bit user processes performance can be slightly degraded on the 32-bit kernel (C).

Note

AIX has been supporting the 64-bit user process model starting with Version 4.3. 64-bit application programs developed on AIX Version 4.3 are source-compatible with AIX 5L Version 5.1 and later; however, they are not binary-compatible. Therefore, those programs must be recompiled on AIX 5L Version 5.1 and later before execution.


3.1.1. How to determine hardware bit mode

To determine the hardware bit mode on your system, run either of the following commands, depending on the operating system versions:

  • AIX 5L Version 5.2:

    getconf HARDWARE_BITMODE
    
  • AIX 5L Version 5.1 and AIX Version 4.3[1]:

    [1] Prior to Version 4.3, AIX did not support 64-bit hardware models.

    bootinfo -y
    

    The command requires the root user authority.

These commands return either 32 (32-bit hardware) or 64 (64-bit hardware). The following example shows the command output executed on an AIX 5L Version 5.2 partition on the pSeries 690:

# oslevel; getconf HARDWARE_BITMODE
5.2.0.0
64
					

If you need to know the hardware bit mode where your application is running, you can use the sysconf() routine with the _SC_AIX_HARDWARE_BITMODE parameter, as shown in the following code fragment:

#include <unistd.h>
long bit_mode;
bit_mode = sysconf(_SC_AIX_HARDWARE_BITMODE);

If the application is running on the 32-bit hardware, it returns 32. If running on the 64-bit hardware, it returns 64.

Note

In general, you do not have to know the hardware bit mode within your application source code, since the difference of hardware bit-modes does not affect user processes.


3.1.2. How to determine kernel bit mode

To determine the kernel bit mode on your system, run either of the following commands, depending on the operating system versions:

  • AIX 5L Version 5.2:

    getconf KERNEL_BITMODE
    
  • AIX 5L Version 5.1[2]:

    [2] Prior to Version 5.1, AIX supported 32-bit kernels (UP or MP) only.

    bootinfo -K
    

    The command requires the root user authority.

These commands return either 32 (32-bit kernel) or 64 (64-bit kernel). The following example shows the command output executed on an AIX 5L Version 5.2 partition with the 64-bit kernel on the pSeries 690:

# oslevel; getconf KERNEL_BITMODE
5.2.0.0
64
					

If you need to know the kernel bit mode, where your application is running, you can use the sysconf() routine with the _SC_AIX_KERNEL_BITMODE parameter as shown in the following code fragment:

# include <unistd.h>
long bit_mode;
bit_mode = sysconf(_SC_AIX_KERNEL_BITMODE);

If the application is running on the 32-bit kernel, it returns 32. If running on the 64-bit kernel, it returns 64.

Note

In general, except for developing kernel extensions, you do not have to know the kernel bit mode within your application source code, since the difference of kernel bit-modes does not affect user processes.


3.1.3. How to determine user process bit mode

To determine the user process bit mode, run the file command with the executable file of the corresponding user process.

If the executable file is 64-bit, then the command prints 64-bit XCOFF executable, as shown in the following example:

$ cc -o helloworld32 helloworld.c
$ cc -q64 -o helloworld64 helloworld.c
$ file helloworld*
helloworld.c:   C program text
helloworld32:   executable (RISC System/6000) or object module not stripped
helloworld64:   64-bit XCOFF executable or object module not stripped

Note

The -q64 option instructs the compiler to generate a 64-bit executable file (see 2.1.2, “Compiler support” on page 40). Although you can generate 64-bit executable files on 32-bit hardware systems, you cannot run them on 32-bit hardware systems.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset