User: Password:
Subscribe / Log in / New account

no 16-bit in long mode

no 16-bit in long mode

Posted Jan 25, 2009 3:13 UTC (Sun) by tialaramex (subscriber, #21167)
In reply to: Indeed not only 32-bit by mjr
Parent article: Common Wine Myths

I would imagine that Wine is also unable to run 16-bit Windows software (Win16) on 64-bit machines. The CPU simply doesn't have the capability to execute 16-bit 8086 era instructions once in 64-bit mode. Presumably your process takes an invalid instruction fault SIGILL, maybe Wine would catch that and just kill the Win16 application, or maybe it doesn't catch that signal and the whole Wine session would exit.

(Log in to post comments)

no 16-bit in long mode

Posted Jan 28, 2009 0:13 UTC (Wed) by bluefoxicy (guest, #25366) [Link]

in 32-bit mode, areas of memory can be marked with a page flag that says they contain 16-bit code. In 64-bit mode, no such luck. You need a full context switch to 32-bit mode to run 16-bit code. 26-bit code can run under a 64-bit OS, but only running a process native in 32-bit mode, since 32-bit protected mode supports 16-bit instructions.

Entering full-blown virtual 8086 mode is impossible, however.

no 16-bit in long mode

Posted Feb 16, 2010 22:15 UTC (Tue) by yuhong (guest, #57183) [Link]

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.

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