Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: "Shane Seymour" <seymours@bigpond.com>
Subject: Re: Porting from Compaq Alpha to HP-UX
Date: 2000/02/09	[thread overview]
Message-ID: <3Yco4.9958$VJ1.17898@newsfeeds.bigpond.com> (raw)
In-Reply-To: 38A13D78.F8D7570@orga.com

> Man Shane,
>
> what a shame, YOU just started it! You must be stupid. (I mean that)

(deep breath and)

My most profuse and humble applogies Aurel I bask in the warmth of your
wrath. I must be stupid (I mean that) to have assumed that anyone reading
the post could have interpreted my posting to say that all unix operating
systems are they same. The only thing that quite a lot of unix operating
systems have in common is that at sometime the vendor has owned the name or
has licensed it and they purchased some of their code base from the same
third party. That off my chest ...

About the only advice that I can offer is my experience from doing ports
from HPUX to linux. Most of the code I ported was written by me for HPUX and
then transported to linux where I encountered a libc that was not as
forgiving as the HPUX one. HPUX will allow lots of NULL pointers being
passed into libc where (in this case) the gnu libc would not (in the end I
liked the gnu libc as it forced me to make code changes that improved the
code and make it more transportable).  My job was made a lot easier from the
fact that both HPUX and linux had X/Open compliant versions of curses,
making sure that I only used a standards based interface made the job of
porting all that much easier (one of the things stressing my previous post)
when I had a choice of classic HPUX curses or color curses. Making the code
64 bit capable on HPUX was done within one day of the linux changes because
of the effort that went into the first porting effort. Admittedly my porting
effort is probably not a good indicator (about 2-3 days of effort) as it was
only 10000 lines of C code.

The hard part will be if you have to write code that can compile and be
functionally equivalent between two or more operating systems. You may end
up having to have either lots of #ifdef's protecting OS dependant code to
handle differences. You will probably have to have make files specifically
targeting each OS as you are likely to require different flags to both the
compilers and the linkers on both platforms. On the plus side sockets code
may be easier since network ordering of address etc is big endian (I'm
pretty sure of that).

If you use things like memory mapped files you will have some restrictions
under HPUX since the PA-RISC cpu is has a virtually indexed cache the best
performance is when mmap'ed files are mapped into the same virtual address
space when used in more than one process. There are good reasons why to
never mmap to different virtual addresses on PA-RISC. HPUX with 64 bit 11
and 64 bit processes makes this restriction less of a restriction since the
address space is so much larger. Unlike quite a lot of other operating
systems the HPUX process address is split into 4 quadrants each of roughly
equal size and differing purposes. For example 32bit processes in a normal
a.out executable have 1Gb for Text, ~1Gb for process private data (the stack
subtracts from this), and 1.75 Gb for shared objects (shared memory, shared
mmap'ed files, shared libraries, etc) and .25Gb reserved architecturally.

Since Digital unix is 64 bit that means there must be some 64 bit data
types. Like HPUX pointers will be 64 bits. I don't know what size longs and
ints are on Dec equipment but in a HPUX 64 bit process they are 64 bits and
32 bits respectively (that may cause problems if Digital Unix has ints at 64
bits). You may be better off using supplied types such as uint64_t, int32_t.
etc instead of normal C builtin types to workaround possible typing
differences..

HPUX 11.0 is more sysv with bsd bits than HPUX 10.x which was more bsd with
sysv bits (although both have a sysv filesystem type layout). At 11.0 all of
the networking layer is streams based for the first time. You do have a
choice of bsd sockets, xti, and tli for transport interfaces on HPUX (dlpi
to if you want to use it).

A good place for information about what things are available is
http://devresource.hp.com the featured thing at the moment (just checked to
make sure the URL is correct) is a solaris to HPUX 11.0 porting guide. It
may not help but it may be useful to see it point out some of the
differences between HPUX and other operating system (even if its not the one
you want). The runtime architecture guides are available (from memory) from
this site as well if you want to delve into the underbelly of the evironment
your programs will be running in.

Waiting to be flamed
Shane





  reply	other threads:[~2000-02-09  5:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-31  5:00 Porting from Compaq Alpha to HP-UX Mike Holland
2000-01-31  5:00 ` David Peter
2000-02-01  5:00   ` Rick Jones
2000-02-03  5:00     ` Aurel Balmosan
2000-02-05  5:00       ` Shane Seymour
2000-02-04  5:00         ` Computing Services
2000-02-07  5:00           ` Bob Koehler
2000-02-08  5:00             ` Computing Services
2000-02-08  5:00               ` Daniel S. Riley
2000-02-08  5:00               ` Adam Price
2000-02-09  5:00               ` Bob Koehler
2000-02-09  5:00         ` Aurel Balmosan
2000-02-09  5:00           ` Shane Seymour [this message]
2000-02-06  5:00       ` hbw
2000-01-31  5:00 ` Bob Koehler
2000-01-31  5:00   ` Bob Koehler
2000-02-01  5:00     ` Mike Holland
2000-01-31  5:00   ` Mike Holland
2000-02-01  5:00     ` John Neumann
2000-02-01  5:00     ` Rick Jones
2000-01-31  5:00 ` Rick Jones
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox