Native Endianess
I would like to propose a definition for "Native Endianess"
The data has Native Endianess when a 32-bit read will return the correct value without byte swap.
-----------------------------
Dan Weaver, ZNYX Networks
[email protected]
Quoted 4 lines · Daniel Weaver
I would like to propose a definition for "Native Endianess"
The data has Native Endianess when a 32-bit read will return the correct value without byte swap.
What on earth does that mean? :) "Correct value" according to who?
FYI, some processors (like PowerPC and MIPS) can operate in either little- or big-endian mode.
-Hollis
Dne 15 Březen 2007, 03:55, Hollis Blanchard napsal(a):
Quoted 8 lines · Daniel Weaver
Quoted 6 lines
I would like to propose a definition for "Native Endianess"
The data has Native Endianess when a 32-bit read will return the correct value without byte swap.
Quoted 7 lines
What on earth does that mean? :) "Correct value" according to who?
FYI, some processors (like PowerPC and MIPS) can operate in either little- or big-endian mode.
-Hollis
And on true 64 platforms it will be counterintuitive definition. I think this is what we call in czech: "outcry into the darkness" :-/
Signature · 2 lines
Tomas Ebenlendr
http://drak.ucw.cz/ebikQuoted 9 lines · Tomáš Ebenlendr
Dne 15 Březen 2007, 03:55, Hollis Blanchard napsal(a):
Quoted 8 lines · Daniel Weaver
Quoted 6 lines
I would like to propose a definition for "Native Endianess"
The data has Native Endianess when a 32-bit read will return the correct value without byte swap.
Quoted 6 lines
Quoted 4 lines
What on earth does that mean? :) "Correct value" according to who?
FYI, some processors (like PowerPC and MIPS) can operate in either little- or big-endian mode.
And on true 64 platforms it will be counterintuitive definition.
I don't know what you mean by this. What is a "true 64 platform", and what does that have to do with endianness?
BTW, the context is that Daniel was looking at the multiboot2 draft, which specifies that some data be in "native endianness". I've objected that this is too vague.
-Hollis
Quoted 6 lines
Quoted 3 lines
And on true 64 platforms it will be counterintuitive definition.
I don't know what you mean by this. What is a "true 64 platform", and what does that have to do with endianness?
As there was no context in the message, the Daniel's definiton gives no sense for 64bit data as well as 16bit data.
Quoted 6 lines
BTW, the context is that Daniel was looking at the multiboot2 draft, which specifies that some data be in "native endianness". I've objected that this is too vague.
-Hollis
Looking at the draft - the objection is for CPU's that can use both endians. But I thing they cannot use them concurently, but they have to do some 'switch' between the two modes. If not, there are two instruction sets, and that I found less problematic.
Maybe Daniel mean:
Native endian depends on current CPU mode. If the CPU mode causes endian mismatch (i.e. reads "the other" magic number) it means that the kernel cannot be run in this mode. It is up to user or loader to do the mode switch to run the kernel. I mean, we can have clever loader on such CPU's that does mode-switch or we can have clever kernel with two multiboot headers, each for one endian, one of them pointing to endian-switch code.
But I cannot read this in his message.
Btw. I also remember few CPU's with mixed endian. 32-bit read of 0x01 0x02 0x03 0x04 returns: 0x02010403.
Signature · 2 lines
Tomas Ebenlendr
http://drak.ucw.cz/ebikContext:
The new Multiboot specification uses the term Native Endianess to imply that big endian processors can load big endian objects and little endian processors can load little endian objects.
Ambiguity:
The Power PC is considered a Big Endian machine but can be booted in little endian mode. The term Native is vague.
Objective:
Define a tern or definition that clearly states the ability of the boot loader.
Discussion:
Not all processors do Little Endian the same way. Some processors scramble 32-bit fetches and some scramble the 8-bit fetches. On RISC machines it is common to scramble the 8-bit fetches which would allow a machine to flip endianness without messing up the instruction set. Neat trick.
According to the definition of the GRUB header I was reading all the values are 32-bit. (Magic number, text size, bss size, start etc.) If GRUB is used in a 64-bit machine it will be restricted to the first 4 gig.
If you really need a definition for correct value send me a private email and I will give you one. Mail to: [email protected] moc after doing byte swap.
Alternate Definition:
The Endianess of the object must match the current endianess mode of the processor. Byte swapped objects are not supported.
Quoted 5 lines · Dan Weaver
Context:
The new Multiboot specification uses the term Native Endianess to imply that big endian processors can load big endian objects and little endian processors can load little endian objects.
Quoted 7 lines
Ambiguity:
The Power PC is considered a Big Endian machine but can be booted in little endian mode. The term Native is vague.Objective:
Define a tern or definition that clearly states the ability of the boot loader.
Right. Rather than going to define a one-fit-into-all rule, I prefer to describe this:
The native endianess _must_ be defined in every architecture-specific section explicitly.
Probably this is necessary for natural address size, etc.
Okuji