[Info-vax] OT: news from the trenches (re: Solaris)

Stephen Hoffman seaohveh at hoffmanlabs.invalid
Mon Mar 16 11:26:38 EDT 2015


On 2015-03-16 14:02:57 +0000, John Reagan said:

> On Monday, March 16, 2015 at 9:51:28 AM UTC-4, Bob Koehler wrote:
>> 
>> And I've been running a mixture of 32 bit and 64 bit code on my Alpha
>> under VMS for many a years now.  Ony under DEC UNIX did I run in pure
>> 64 bit on Alpha.
>> 
> 
> Tru64 (like -m64 on Linux boxes) forces 64-bit addresses by default (it 
> doesn't map the 32-bit address space to shake out broken code - 
> eventually).
> 
> You have to think about data addresses vs code addresses separately.  
> The data addresses are 'easy'.  It is the code addresses that get you 
> spinning... on Alpha, you have Procedure Descriptors (allocated in 
> 32-bit space so you can reference them with a 32-bit pointer).  Those 
> PDs contain the real 64-bit target address.  On Itanium, you have the 
> short section (allocated in 32-bit address space) pointing to function 
> descriptors (also allocated in 32-bit address space) which contain the 
> real 64-bit target code address (and the GP value).  For the x86 
> calling standards, representing code addresses that work in a mixed 
> environment will be a little tougher. And bound procedure values always 
> are fun to figure out.

Which is why various other operating system teams decided to dispense 
with the associated effort and complexity, took the hit on application 
compatibility and source code changes, and went 64-bit native.  Beyond 
what John mentions here within the run-time environment, there are 
other compromises that the OpenVMS 64-bit code still has to deal with; 
that ptrdiff_t, time_t and size_t were not all promoted from a 32-bit 
value, and other gnarly details.

Gnarly details that new, native 64-bit code and ported open-source code 
now have to deal with.

Not promoting meant that existing source code won't break, but that new 
code and native-64-bit code from other platforms will.  Noticing a 
pattern here?

FWIW, a discussion and a pointer and data model chart: 
<http://www.codeguru.com/cpp/cpp/cpp_mfc/general/article.php/c16465/About-sizet-and-ptrdifft.htm> 


A minimal source code example of the 64-bit C environment on OpenVMS V8.4:

$ cc x/pointer=long
$ lin x
$ r x
sizeof time_t: 4
sizeof ptrdiff_t: 4
sizeof size_t: 4
BOGUS pointer size 8
$ ty x.c
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
main() {
char *foo = "BOGUS";
printf("sizeof time_t: %d\n", sizeof(time_t));
printf("sizeof ptrdiff_t: %d\n", sizeof(ptrdiff_t ));
printf("sizeof size_t: %d\n", sizeof(size_t ));
printf("%s pointer size %d\n", foo, sizeof(foo));
}
$


-- 
Pure Personal Opinion | HoffmanLabs LLC




More information about the Info-vax mailing list