Re: i486 emu in mainline?

Albert Cahalan
2004-05-25T19:27:15Z

Alan Cox writes:
> On Sun, May 23, 2004 at 10:29:12AM +0200, Willy Tarreau wrote:

>> being emulated. I think it's already the case. He also
>> said that I didn't take care of the segment selectors
>> (such as SS) which some programs use perfectly legally
>> (eg Wine). I don't know how to do that.
>
> You have to parse all the valid header bytes (the opcode
> prefixes) that change segment, cause repeats and change
> sizes. DOSemu has a worked example of this particular
> set of horrors.

You don't need that in a fully general way. You might want
to detect unhandled cases and generate SIGILL.

The important thing is to correctly handle whatever is
generated by gcc, icc, glibc, uclibc, dietlibc, klibc,
and newlib. Thus you can assume that you're dealing with
a 32-bit app that doesn't play LDT games. Segment selectors
are limited to the pthreads assembly code.

Wine and DOSEMU can take care of themselves.