niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Not Unix » VMS
VMS hosted on HP-UX (HPVM) : endianness question
Post new topic   Reply to topic Page 1 of 1 [14 Posts] View previous topic :: View next topic
Author Message
John Reagan
*nix forums Guru Wannabe


Joined: 27 Jul 2005
Posts: 159

PostPosted: Fri Jul 21, 2006 2:15 pm    Post subject: Re: VMS hosted on HP-UX (HPVM) : endianness question Reply with quote

Jeff Cameron wrote:
Quote:
I was once told by an HP Telephone Support person that the Itanium not only
supports both memory addressing methods, but that it was also capable of
supporting a Big Endian/Little Endian context switch at the process level. I
don't know if OpenVMS or HPUX supports this tough.


Depends on what you mean by "support" :-)

The big-endian bit in the User Mask is settable by anybody at any time.
It isn't protected. We can't stop you.

However, all of the address constants allocated by the linker, etc. are
little-endian. Once in big-endian mode, you are unlikely to make an
outbound call unless you un-swap the bytes. Also, OpenVMS will keep
setting the bit back to little-endian for itself. I don't know if we
save/preserve the big-endian state across an interrupt for example (my
distant memory would say we probably do preserve it for no other reason
that it would take extra code not to do so). I doubt if ASTs or
exception-handlers would start in big-endian mode if your mainline was
in big-endian mode. Needless to say, we didn't test any of these cases
other than making sure you can't take out the system by trying to be
malicious.

So you can set the bit, put the whole CPU into big-endian mode, try to
execute a few fetch or store instructions and see how far you get.

When I describe the User Mask feature, I say: "You can set the
big-endian flag at any time, however, when you set the bit, I don't know
what operation system you are running, but it isn't OpenVMS."

--
John Reagan
HP Pascal/{A|I}MACRO/COBOL for OpenVMS Project Leader
Hewlett-Packard Company
Back to top
Bob Koehler
*nix forums Guru


Joined: 25 Jul 2005
Posts: 1078

PostPosted: Thu Jul 20, 2006 9:18 pm    Post subject: Re: VMS hosted on HP-UX (HPVM) : endianness question Reply with quote

In article <op.tcz0bqolzgicya@hyrrokkin>, "Tom Linden" <tom@kednos.com> writes:
Quote:

The perception is more one of how we visualize as well as custom. We
write numbers from left (most significant) to right (least significant)
Interestingly a clerk in my bank, who is originally from Lebanon, writes=

the numbers from right to left.

I write my numbers left to right unless I'm labeling the addresses
in a little-endian machine. Never write the data right to left.

1 in hex in 32 bits is 00000001, no matter what address the 01 is
stored at.
Back to top
Jeff Cameron
*nix forums Guru Wannabe


Joined: 18 May 2005
Posts: 152

PostPosted: Thu Jul 20, 2006 9:17 pm    Post subject: Re: VMS hosted on HP-UX (HPVM) : endianness question Reply with quote

I was once told by an HP Telephone Support person that the Itanium not only
supports both memory addressing methods, but that it was also capable of
supporting a Big Endian/Little Endian context switch at the process level. I
don't know if OpenVMS or HPUX supports this tough.

Jeff

On 7/19/06 11:25 PM, in article 44BF21D3.12C117B4@teksavvy.com, "JF Mezei"
<jfmezei.spamnot@teksavvy.com> wrote:

Quote:
VMS is little endian.
HP-UX is big endian.

So, in the HPVM scenario where VMS runs as a hosted application on
HP-UX, how do they deal with endianness ?

Does IA64 have dupluicate opcodes, one for little and one for big endian
? In which case, since VMS would be compile to use little endian
instructions, I could see how easy it would be to swicth the context
betwene HP-UX and VMS inside the same instance (since VMS runs as a
application of HP-UX).

But if there is some bit deep down in the CPU that tells it that all
instructions are little or big endian, does this bit get set whenever
there is a context switch between VMS, the host HP-UX or any other
hosted instances (be it HP-UX, VMS, Linux etc) ???


Or does HP-UX have software like Apple's Rosetta that dynamically
translates VMS's little endianness into big endianness so the CPU can
execute them ? (eg: HP-UX emulates a little endian IA64).

Also, does HP-UX emulate EFI environment to give VMS the impression it
is booting from a real IA64 ? If so, is EFI bi-endian, or do the specs
say that EFI is little endian up to the point where the OS takes control ?
Back to top
Hoff Hoffman
*nix forums Guru


Joined: 22 Jul 2005
Posts: 572

PostPosted: Thu Jul 20, 2006 7:03 pm    Post subject: Re: VMS hosted on HP-UX (HPVM) : endianness question Reply with quote

JF Mezei wrote:
Quote:
VMS is little endian.
HP-UX is big endian.

So, in the HPVM scenario where VMS runs as a hosted application on
HP-UX, how do they deal with endianness ?

Very well, thank you very much.

Alpha and Itanium are bi-endian platforms.

HP-UX is big-endian, while OpenVMS and Windows are little-endian.

Instructions are interpreted in little-endian order on both of these
architectures and in both operating systems, while data accesses and
registers utilize the byte order selected by the processor run-time
environment. The operating system (and potentially even a programmer
establishing a process run-time context) gets to select the endian-ness.

Within the VM environment, OpenVMS is little endian. Outside the VM,
well, who cares? (As long as it's not too slow, that is.) Outside
could be HP-UX, a software emulation on some twenty-year old fossilized
16-bit 8086 processor, or an emulation on a more reasonable emulation
running on IA-32e/AMD64 64-bit environment, or (gasp) on real "drop it
on your toes and it will hurt" physical hardware.
Back to top
Tom Linden
*nix forums Guru


Joined: 06 May 2002
Posts: 841

PostPosted: Thu Jul 20, 2006 5:32 pm    Post subject: Re: VMS hosted on HP-UX (HPVM) : endianness question Reply with quote

On Thu, 20 Jul 2006 10:08:28 -0700, Bob Koehler
<koehler@eisner.nospam.encompasserve.org> wrote:

Quote:
In article <op.tczm81t8zgicya@hyrrokkin>, "Tom Linden" <tom@kednos.com
writes:

After all, once the datum is in a register
it is all big endian:-)

I see your smiley, but I caution others not to assume that
it's easy to define the endian-ness of a register.

The perception is more one of how we visualize as well as custom. We
write numbers from left (most significant) to right (least significant)
Interestingly a clerk in my bank, who is originally from Lebanon, writes
the numbers from right to left.
Quote:

I worked with a Harvard Architecture chip once that was
"little-endian". The only thing that seemed to make the system
behave that way was the implementation of the DMA engines that
transfered data to the outside world. And the DMA engines were
not part of the CPU chip.
Back to top
Bob Koehler
*nix forums Guru


Joined: 25 Jul 2005
Posts: 1078

PostPosted: Thu Jul 20, 2006 5:08 pm    Post subject: Re: VMS hosted on HP-UX (HPVM) : endianness question Reply with quote

In article <op.tczm81t8zgicya@hyrrokkin>, "Tom Linden" <tom@kednos.com> writes:

Quote:
After all, once the datum is in a register
it is all big endian:-)

I see your smiley, but I caution others not to assume that
it's easy to define the endian-ness of a register.

I worked with a Harvard Architecture chip once that was
"little-endian". The only thing that seemed to make the system
behave that way was the implementation of the DMA engines that
transfered data to the outside world. And the DMA engines were
not part of the CPU chip.
Back to top
Bob Koehler
*nix forums Guru


Joined: 25 Jul 2005
Posts: 1078

PostPosted: Thu Jul 20, 2006 5:04 pm    Post subject: Re: VMS hosted on HP-UX (HPVM) : endianness question Reply with quote

In article <1153394888.046770.312740@i42g2000cwa.googlegroups.com>, etmsreec@yahoo.co.uk writes:
Quote:
How does Charon do it?

Charon emulates the hardware. But IIRC Charon only operates on Alpha
under VMS and on x86 under Windows or Linux.

All of those are little-endian platforms.

But it would be possible to emulate little-endian operations on
a big-endian machine. Compare to Java which always stores data
in big-endian, no matter what hardware it's running on.
Back to top
Bob Koehler
*nix forums Guru


Joined: 25 Jul 2005
Posts: 1078

PostPosted: Thu Jul 20, 2006 5:01 pm    Post subject: Re: VMS hosted on HP-UX (HPVM) : endianness question Reply with quote

In article <44BF21D3.12C117B4@teksavvy.com>, JF Mezei <jfmezei.spamnot@teksavvy.com> writes:
Quote:
VMS is little endian.
HP-UX is big endian.

So, in the HPVM scenario where VMS runs as a hosted application on
HP-UX, how do they deal with endianness ?
Does IA64 have dupluicate opcodes, one for little and one for big endian
? In which case, since VMS would be compile to use little endian
instructions, I could see how easy it would be to swicth the context
betwene HP-UX and VMS inside the same instance (since VMS runs as a
application of HP-UX).

Only the memory circuitry is aware of the access mode, and then
only for data. All IA-64 opcodes are stored little-endian.

Quote:
But if there is some bit deep down in the CPU that tells it that all
instructions are little or big endian, does this bit get set whenever
there is a context switch between VMS, the host HP-UX or any other
hosted instances (be it HP-UX, VMS, Linux etc) ???

The IA-64 processor does data adressing selection via a per-process
flag. VMS always sets this to little-endian and does not support
operating with it set to big-endian. The HP-VM layer just has to
make sure it's set properly when doing a reschedule between
hosted OS instanciations.
Back to top
John Reagan
*nix forums Guru Wannabe


Joined: 27 Jul 2005
Posts: 159

PostPosted: Thu Jul 20, 2006 2:54 pm    Post subject: Re: VMS hosted on HP-UX (HPVM) : endianness question Reply with quote

JF Mezei wrote:
Quote:
VMS is little endian.
HP-UX is big endian.

So, in the HPVM scenario where VMS runs as a hosted application on
HP-UX, how do they deal with endianness ?


There is an Itanium application register named UM (user mask). Bit 1
enables big-endian memory access. When set, that bit changes the
behavior of various instructions to do big-endian rules.

Instructions are always fetched in little-endian (even on HP-UX).

I assume the HPVM software knows when to set the bit back and forth or
perhaps the OS does it. OpenVMS sets it to little-endian in many places
to prevent a rogue user from flipping the bit to big-endian mode and
then returning to the operating system. :-)


--
John Reagan
HP Pascal/{A|I}MACRO/COBOL for OpenVMS Project Leader
Hewlett-Packard Company
Back to top
Tom Linden
*nix forums Guru


Joined: 06 May 2002
Posts: 841

PostPosted: Thu Jul 20, 2006 2:47 pm    Post subject: Re: VMS hosted on HP-UX (HPVM) : endianness question Reply with quote

On Thu, 20 Jul 2006 07:55:37 -0700, John Reagan <john.reagan@hp.com> wrote:

Quote:
Instructions are always fetched in little-endian (even on HP-UX).

What does this mean?
Back to top
Tom Linden
*nix forums Guru


Joined: 06 May 2002
Posts: 841

PostPosted: Thu Jul 20, 2006 12:49 pm    Post subject: Re: VMS hosted on HP-UX (HPVM) : endianness question Reply with quote

On Wed, 19 Jul 2006 23:25:42 -0700, JF Mezei
<jfmezei.spamnot@teksavvy.com> wrote:

Quote:
Does IA64 have dupluicate opcodes, one for little and one for big endian
? In which case, since VMS would be compile to use little endian
instructions, I could see how easy it would be to swicth the context
betwene HP-UX and VMS inside the same instance (since VMS runs as a
application of HP-UX).

It has, in some ways, little to do with the instruction set but more with
how data is fetched from store. After all, once the datum is in a register
it is all big endian:-)
Back to top
Bill Gunshannon
*nix forums Guru


Joined: 21 Jul 2005
Posts: 1019

PostPosted: Thu Jul 20, 2006 11:47 am    Post subject: Re: VMS hosted on HP-UX (HPVM) : endianness question Reply with quote

In article <1153394888.046770.312740@i42g2000cwa.googlegroups.com>,
etmsreec@yahoo.co.uk writes:
Quote:
How does Charon do it?

Charon emulates the hardware.

bill

--
Bill Gunshannon | de-moc-ra-cy (di mok' ra see) n. Three wolves
bill@cs.scranton.edu | and a sheep voting on what's for dinner.
University of Scranton |
Scranton, Pennsylvania | #include <std.disclaimer.h>
Back to top
etmsreec@yahoo.co.uk
*nix forums addict


Joined: 27 Jan 2006
Posts: 95

PostPosted: Thu Jul 20, 2006 11:28 am    Post subject: Re: VMS hosted on HP-UX (HPVM) : endianness question Reply with quote

How does Charon do it?

JF Mezei wrote:
Quote:
VMS is little endian.
HP-UX is big endian.

So, in the HPVM scenario where VMS runs as a hosted application on
HP-UX, how do they deal with endianness ?

Does IA64 have dupluicate opcodes, one for little and one for big endian
? In which case, since VMS would be compile to use little endian
instructions, I could see how easy it would be to swicth the context
betwene HP-UX and VMS inside the same instance (since VMS runs as a
application of HP-UX).

But if there is some bit deep down in the CPU that tells it that all
instructions are little or big endian, does this bit get set whenever
there is a context switch between VMS, the host HP-UX or any other
hosted instances (be it HP-UX, VMS, Linux etc) ???


Or does HP-UX have software like Apple's Rosetta that dynamically
translates VMS's little endianness into big endianness so the CPU can
execute them ? (eg: HP-UX emulates a little endian IA64).

Also, does HP-UX emulate EFI environment to give VMS the impression it
is booting from a real IA64 ? If so, is EFI bi-endian, or do the specs
say that EFI is little endian up to the point where the OS takes control ?
Back to top
JF Mezei
*nix forums Guru


Joined: 21 Jul 2005
Posts: 2556

PostPosted: Thu Jul 20, 2006 6:25 am    Post subject: VMS hosted on HP-UX (HPVM) : endianness question Reply with quote

VMS is little endian.
HP-UX is big endian.

So, in the HPVM scenario where VMS runs as a hosted application on
HP-UX, how do they deal with endianness ?

Does IA64 have dupluicate opcodes, one for little and one for big endian
? In which case, since VMS would be compile to use little endian
instructions, I could see how easy it would be to swicth the context
betwene HP-UX and VMS inside the same instance (since VMS runs as a
application of HP-UX).

But if there is some bit deep down in the CPU that tells it that all
instructions are little or big endian, does this bit get set whenever
there is a context switch between VMS, the host HP-UX or any other
hosted instances (be it HP-UX, VMS, Linux etc) ???


Or does HP-UX have software like Apple's Rosetta that dynamically
translates VMS's little endianness into big endianness so the CPU can
execute them ? (eg: HP-UX emulates a little endian IA64).

Also, does HP-UX emulate EFI environment to give VMS the impression it
is booting from a real IA64 ? If so, is EFI bi-endian, or do the specs
say that EFI is little endian up to the point where the OS takes control ?
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [14 Posts] View previous topic :: View next topic
The time now is Thu Dec 04, 2008 1:47 am | All times are GMT
navigation Forum index » Not Unix » VMS
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Newbie question: How to forward a domain to a mailbox? leei Postfix 0 Fri Aug 24, 2007 4:55 pm
No new posts configuration question for httpd Karl Wang Apache 1 Fri Jul 21, 2006 2:10 pm
No new posts nim problem/question Ron AIX 0 Fri Jul 21, 2006 1:57 pm
No new posts question for JAVA developer who r using postgres sql as b... deepak pal PostgreSQL 1 Fri Jul 21, 2006 9:00 am
No new posts Encryption Question dtuttle1@gmail.com Berkeley DB 2 Thu Jul 20, 2006 10:09 pm

Free Credit Report | Camilo jose cela | Loans | Loans | Mortgage
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.3031s ][ Queries: 20 (0.1812s) ][ GZIP on - Debug on ]