i486 emu in mainline?
Quoted 11 lines · Alan Cox
Quoted 4 lines · Willy Tarreau
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.
Quoted 5 lines · Albert Cahalan
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.
The LDT stuff isnt that hard to deal with, you can probably ignore the 16bit code segment funky stuff, but you'd need to parse things like size prefixes.