4 ms·
Not to mention that v86 is still available on x86. You just have to temporarily drop out of 64 bit mode. This is not the 286 anymore...
by AshamedCaptain 3y ago
Not to mention that v86 is still available on x86. You just have to temporarily drop out of 64 bit mode. This is not the 286 anymore...
- mananaysiempre 3y ago... I’m trying to imagine how one’d handle interrupts in this setup, and it sounds kind of terrifying. Reprogram the LAPIC each time? Carefully code the interrupt entry to work as both 32- and 64-bit code to determine if it needs to switch back? Ouch.
- AshamedCaptain 3y agoYou don't need to use the same IDT as in long mode. Just have a 32-bit one that decides whether to handle an interrupt (e.g. vm86 traps/emulation) or re-enable long mode and forward it to the 64-bit handler. But you don't have to imagine -- early amd64 Linux could do it, and there was a patch floating around that kept that feature all the way to 2.6.2x series. These days vm86 is borked even in 32-bit kernels.