Octocontrabass wrote:
xeyes wrote:
The kernel can, and indeed sometimes do, run on 32bit CPUs.
You can have your bootloader select the appropriate kernel binary according to the CPU capabilities instead of trying to stuff everything into a single binary.
Just need to find the time to work on a custom smart boot loader and another kernel together with everything else?
I do plan to split it if the kernel actually becomes "stuffed" one day, but this thin long mode shim is like 0.01% of the codebase and can't stand alone by itself anyways.
Octocontrabass wrote:
Perhaps you should try the x32 ABI. You get all the 64-bit instructions you want while staying in the 32-bit address space you've been using.
This is quite interesting, maybe x32 is better than 64bit for user space apps as the kernel doesn't support address space beyond 4GB. I wonder does it suffer from the issue of "since nobody uses it, nobody maintains this version" though?
Octocontrabass wrote:
Opcodes 0x9A and 0xEA - far CALL and far JMP with the destination encoded as an immediate value - don't have a MOD field, so that can't be it. AMD could have used REX.W to extend them in 64-bit mode, since they already use the 0x66 prefix to select between 16:16 and 16:32 in other modes. Instead, AMD decided those two opcodes would be invalid in 64-bit mode.
You are right, MOD has nothing to do with immediate value. I guess if this was implemented we'd also have things like 64b immediate value for ADD?
Octocontrabass wrote:
But the Intel manual also doesn't define any opcodes that use those encodings. That's probably some kind of editing mistake.
Might point to something that they worked on/planned for and abandoned.
Similar to this story:
Quote:
Before the Pentium went into production, PAE was removed. Even so, documented references to this feature still appear in the various Pentium manuals, and from other sources.
(from
http://www.rcollins.org/ddj/Jul96/)
Octocontrabass wrote:
Intel has to test every feature they add to the CPU. Why add a feature that will increase the amount of testing if hardly anyone is going to use it?
Also known as, "cut some corners in places where we can't easily see."