4 ms·
I'm surprised something like this wasn't implemented as a deliberate, marketed feature for cross compatibility. The OS would tag each task or memory page as be
by hakfoo 5y ago
I'm surprised something like this wasn't implemented as a deliberate, marketed feature for cross compatibility.
The OS would tag each task or memory page as being, say, an x86-64 or ARM task, and when a task was dispatched, it would be done as a "JSR + change operating mode" instruction. This feels like it would be more permanent than a Rosetta style software bodge that could be taken away in the next point release.
The old NEC V20/30/40/50 CPUs offered something like this-- they powered up as 8086/186 class, but you could bump them in and out of 8080 mode. You'd think it would be easier today with modern micro-op architectures that look mostly the same behind the decoder.
- colejohnson66 5y agoWell, the jump from real mode (16 bit) at boot to protected mode (32 bit) and protected to long mode (64 bit) are all accomplished by flipping some bits in the control registers and doing a “long jump” (a regular jump is implicitly the same segment address/selector, but a long one has an explicit one). Basically, the processor only detects operating mode changes when a long jump is performed. (This allows the OS to set up a process for execution, flip the mode bits if needed, then long jump to the process)