From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S265062AbUEYT1P (ORCPT ); Tue, 25 May 2004 15:27:15 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S265065AbUEYT1O (ORCPT ); Tue, 25 May 2004 15:27:14 -0400 Received: from sccrmhc12.comcast.net ([204.127.202.56]:49088 "EHLO sccrmhc12.comcast.net") by vger.kernel.org with ESMTP id S265062AbUEYTZv (ORCPT ); Tue, 25 May 2004 15:25:51 -0400 Subject: Re: i486 emu in mainline? From: Albert Cahalan To: linux-kernel mailing list Cc: alan@redhat.com, willy@w.ods.org, hch@lst.de, macro@ds2.pg.gda.pl Content-Type: text/plain Organization: Message-Id: <1085504583.955.1015.camel@cube> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 25 May 2004 13:03:04 -0400 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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.