From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,a3e7a54875d85e53 X-Google-Attributes: gidfee84,public X-Google-Thread: fcda7,a3e7a54875d85e53 X-Google-Attributes: gidfcda7,public From: "Shane Seymour" Subject: Re: Porting from Compaq Alpha to HP-UX Date: 2000/02/09 Message-ID: <3Yco4.9958$VJ1.17898@newsfeeds.bigpond.com>#1/1 X-Deja-AN: 583630994 References: <873qtt$fds@romeo.logica.co.uk> <3896497B.DC4D1AF3@ctxuk.citrix.com> <875d3b$7nv$1@web1.cup.hp.com> <38997D4B.C828B764@orga.com> <5ICm4.6825$VJ1.10995@newsfeeds.bigpond.com> <38A13D78.F8D7570@orga.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Trace: newsfeeds.bigpond.com 950098815 139.134.83.20 (Wed, 09 Feb 2000 23:20:15 EST) Organization: Telstra BigPond Internet Services (http://www.bigpond.com) X-MSMail-Priority: Normal NNTP-Posting-Date: Wed, 09 Feb 2000 23:20:15 EST Newsgroups: comp.sys.hp.hpux,comp.unix.osf.osf1 > 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