|
With
64-bit hardware blossoming, 64-bit computing is not
just for scientific applications and deep databases.
Let's take a look at the porting issues. by Seamus
Phan
When
we talk or hear about 64-bit computing, high performance
computing (HPC) comes to mind. It is common to apply
64-bit computing to applications such as defense, e-government,
global financial management, or even genomics and other
bio-simulations.
However, 64-bit computing can now be successfully applied
in the management of Web caching and search engines
for large service providers and upstream data centers,
as well as e-commerce, data warehousing, rules and constraints-based
programming, and decision support systems.
The primary reason is simple 64-bit computing allows
the real-time loading of data into the vastly expanded
memory space, thereby allowing immediate access and
computation by users of such systems.
Porting
to 64-bit Linux
AMD,
through the x86-64 project (x86-64.org), has made
available an x86 system simulator under GNU/Linux.
The simulated system contains an x86-64 technology-enabled
chip, RAM, disks, and VGA. Developers can use the
simulated system to single-step the CPU, peek at
registers and memory, run 64-bit and 32-bit GNU/Linux,
and debug kernel bugs without having to hard-boot
hardware all the time. While Intel has focused on
64-bit Windows through its Itanium line, AMD has
focused on creating some degree of compatibility
with its x86 architecture, and contributed to the
growth of 64-bit Linux as well. |
Should
you port?
So should we extend 32-bit applications to allow our
applications to harness the tremendous leap in memory
addressing?
For example, computer-aided design (CAD), business modeling,
3D simulation, and semiconductor design are all applications
that often have been designed to work in both 32-bit
and 64-bit memory spaces. Under 32-bit application space
for the likes of Solaris, such applications can utilize
up to the 4 GB limit, or 2 GB for Windows.
For many low-end applications, 4 GB limits are not easily
breached and most of these applications will serve the
needs of users for years to come. However, in more advanced
applications, especially those in defense and other
high-end decision support systems, embracing the 16
GB space can result in a quantum leap in performance.
For example, in the area of defense, it could be the
difference between eradicating threats or being bombed.
From the technical standpoint, you have to ascertain
if your application is managing its own memory management,
and whether it is wearing out the 32-bit address space.
In addition, your application will benefit from a memory
address space of more than 4 GB, and will require the
full 64-bit registers to handle 64-bit integer math
faster.
Windows XP has a 64-bit version that will allow the
simultaneous execution of 32-bit and 64-bit applications.
Sun has Solaris which is 64-bit capable. And if you
prefer the portability and cost-effectiveness of open
source, NetBSD (www.netbsd.org), a cousin of Unix used
in the likes of FreeBSD (a purely 32-bit OS for x86
CPUs) and Mac OS X (64-bit possible), has been ported
to embrace the AMD x84-64 platform and the MIPS64 platform,
to cater to 64-bit applications. This is on top of more
than 40 different hardware architecture by Wasabi Systems
(www.wasabisystems.com).
Having determined these needs for your specific application,
you can then decide how to migrate to the 64-bit application
space.
Porting considerations
For Windows environment, you can choose to port your
application in three ways a full port; retaining a 32-bit
address space with 64-bit pointers; or retaining a 32-bit
address space with 32-bit pointers.
Choosing the 32-bit address space with 32-bit pointers
is perhaps the easiest. If your application is not likely
to traverse the 2 GB memory address limit for Windows,
or 4 GB limit for the likes of Solaris, then you may
consider retaining the use of the 32-bit address space
with 32-bit pointers.
However, using this rather limiting approach has some
concerns you will periodically face pointer truncation
warnings, because most of the higher bit pointers will
be truncated downward to fit within the 32-bit space.
If you are using a 64-bit operating system, then this
method may not work well because 64-bit pointers are
required to interact with a 64-bit OS.
The next step up is to retain the smaller 32-bit address
space but equip your application to cater to 64-bit
pointers. This method of partial porting will at least
make it more compatible with 64-bit operating systems.
In this scenario, your application does not have the
need for a larger memory address space, and pointer
truncation warnings can be more safely ignored, as the
upper 32-bit pointers will be set at zero.
With 32-bit pointers, data size expansion is a key concern,
while it is less of a concern with 64-bit pointers.
Obviously, the right way to port is to port fully to
64-bit memory address space, with 64-bit pointers as
well. A full port is understandably the most tedious
and complex, but your application will be immediately
scalable to take advantage of the massive address space
beyond 2 or 4 GB (for Windows and Solaris respectively).
All pointer truncation warnings must be ironed out in
a full port, including dynamic link libraries (DLLs)
and other third party plug-ins. In a full port, both
data and code expansion will not be an issue since both
address space and pointers are fully 64-bit capable.
In addition, 32-bit modules and 64-bit modules cannot
co-exist in the same process in a full port.
For complex high-end applications, your workstation
or server should be equipped with full 64-bit ported
applications, rather than allowing a mix of 32-bit and
64-bit applications since they may destabilize each
other.
Porting tools
While hardcore coders may consider using a bare-bone
compiler like the GCC Compiler for porting, there are
commercial tools that aid the process of code porting.
A company that provides 64-bit porting tools is Migratec
(www.migratec.com), which has the 64express product
to port 32-bit applications to both the Itanium and
PowerPC/AIX5L hardware architecture.
64express automates the process of porting 32-bit C
or C++ source code to 64-bit systems for Windows, Linux
and AIX 5L. According to Migratec, programmers can identify
source codes to target problems that common compilers
such as GCC might miss, and eliminate manual transcription
errors. 64express can also help to reduce tests and
debugging.
It identifies the API (application programming interface)
differences between 32-bit and 64-bit target platforms,
so that there will be less compiling errors. An important
area is data truncation and extension, where 64express
helps to identify. Through the automated process, it
helps to automate API substitution, and solve truncation
issues with programmer-defined rules and constraints.
The decent part about 64express is its preservation
of the original source code, so that programmers can
always return to the original state without problems.
This is an important step in helping programmers learn
about the possibilities of porting, while having the
latitude to make some mistakes with full control. And
of course, 64express also provides fully documented
code changes so that more changes can easily be made
by other programmers, hence complying with standard
programming practices.
There is definitely a blossoming in 64-bit hardware.
While 64-bit software appears not to have caught up
yet, many server-based applications have been ported,
including Apache.
With a dramatically increased memory address space,
it is conceivable that low-level server hardware running
consumer-grade 64-bit hardware such as Itanium, will
be able to leverage on the increased stability and real-time
processing of 64-bit server applications.
For MIS, it may be time to start toying with open source
and commercially available porting tools, and determine
if custom enterprise applications or even middleware
and front-ends, can be converted to provide greater
scalability and performance.
Seamus Phan is research director at KnowledgeLabs
News Center (www.knowledgelabs.net),
an independent technology news bureau and writes for
Network Computing-The Asian Edition. He can be reached
at seamus@knowledgelabs.net
|