User: Password:
|
|
Subscribe / Log in / New account

no 16-bit in long mode

no 16-bit in long mode

Posted Feb 16, 2010 22:15 UTC (Tue) by yuhong (guest, #57183)
In reply to: no 16-bit in long mode by bluefoxicy
Parent article: Common Wine Myths

Nope, it never worked that way. The way it really works on 386 and later processors is that every code segment is marked with a default operand/address size, either 16-bit for old 16-bit protected mode apps, or 32-bit for newer 32-bit apps. In fact, 64-bit/compatibility mode switching in long mode is similar too, with another bit being used to differ from compatibility mode vs 64-bit code segments, with most of the rest of the segment attributes being ignored for 64-bit code segments. And yes, 16-bit default operand size in compatibility mode is supported in long mode.


(Log in to post comments)

no 16-bit in long mode

Posted Feb 17, 2010 4:26 UTC (Wed) by viro (subscriber, #7872) [Link]

There's no V86 submode in long mode. IOW, with 64bit kernels you can run protected-mode userland just fine, including 16bit pieces, but with real-mode 16bit code you have serious trouble, Segments will work as for protected mode 16bit, which is not going to make real mode code happy at all. In particular, the lower bits of value loaded to segment selectors are treated as privelege level, etc.

You can get around that by playing with amd64 virtualization (i.e. run a guest in legacy mode and use _that_ to run 16bit real-mode code). If you don't have that, you are SOL - you pretty much have to emulate 8086. Instruction set is there, but address translation is incompatible.


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds