From owner-freebsd-emulation@FreeBSD.ORG Sun May 23 23:04:36 2004 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1640316A4CE for ; Sun, 23 May 2004 23:04:36 -0700 (PDT) Received: from web15105.mail.bjs.yahoo.com (web15105.mail.cnb.yahoo.com [202.3.77.17]) by mx1.FreeBSD.org (Postfix) with SMTP id 2568443D3F for ; Sun, 23 May 2004 23:04:35 -0700 (PDT) (envelope-from imgaolong@yahoo.com.cn) Message-ID: <20040524060403.7239.qmail@web15105.mail.bjs.yahoo.com> Received: from [61.187.16.2] by web15105.mail.bjs.yahoo.com via HTTP; Mon, 24 May 2004 14:04:03 CST Date: Mon, 24 May 2004 14:04:03 +0800 (CST) From: =?gb2312?q?Sharp=20Gao?= To: freebsd-emulation@freebsd.org MIME-Version: 1.0 X-Mailman-Approved-At: Mon, 24 May 2004 04:53:38 -0700 Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: Device name convert for linux use X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2004 06:04:36 -0000 I was developig a name and major/minor device number converting mechanism for linux applications to use on a linux.ko module , as if the application itself run on a linux. They can use just a linux style device name and major/minor number , through my modified linux_file.c to retrieve the correct name and number on FreeBSD(by a build-in-kernel table).But that need the two devices to have exactly the same behavior in their own operating system. While there will be no extra devices in the /dev directory, all the linux style devices are virtual and available to linux applications. Is this helpful to linux emulator ? --------------------------------- Do You Yahoo!? ÏÓÓÊÏä̫С£¿ÑÅ»¢µçÓÊ×ÔÖúÀ©ÈÝ£¡ From owner-freebsd-emulation@FreeBSD.ORG Mon May 24 11:01:49 2004 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9FBAA16A4EE for ; Mon, 24 May 2004 11:01:49 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 989C343D49 for ; Mon, 24 May 2004 11:01:49 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i4OI1gRf076450 for ; Mon, 24 May 2004 11:01:42 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i4OI1g3c076444 for emulation@freebsd.org; Mon, 24 May 2004 11:01:42 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 24 May 2004 11:01:42 -0700 (PDT) Message-Id: <200405241801.i4OI1g3c076444@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: emulation@FreeBSD.org Subject: Current problem reports assigned to you X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 May 2004 18:01:49 -0000 Current FreeBSD problem reports Critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2003/06/28] kern/53874 emulation /usr/ports/emulators/linux_base isn't wor 1 problem total. Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/09/21] kern/21463 emulation Linux compatability mode should not allow o [2000/11/13] kern/22826 emulation Memory limits have no effect in linux com o [2000/12/14] misc/23561 emulation Linux compatibility mode does not support o [2001/03/28] kern/26171 emulation not work Linux-emulator, but hi is work i 4 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/06/19] misc/19391 emulation Evilness with Linux Terminus, causes X to o [2002/08/11] kern/41543 emulation Easier wine/w23 support p [2002/09/04] kern/42404 emulation TIOCSCTTY not implemented in linuxulator o [2002/11/26] kern/45785 emulation Linux WineX seems to require a few new li 4 problems total. From owner-freebsd-emulation@FreeBSD.ORG Wed May 26 04:53:11 2004 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3BD8516A4CE for ; Wed, 26 May 2004 04:53:11 -0700 (PDT) Received: from dynamo.sohgoh.net (dynamo.sohgoh.net [211.10.16.102]) by mx1.FreeBSD.org (Postfix) with ESMTP id DBD9F43D2F for ; Wed, 26 May 2004 04:53:10 -0700 (PDT) (envelope-from sagawa@sohgoh.net) Received: from 127.0.0.1 (localhost.localdomain [127.0.0.1]) by antivirus.sohgoh.net (Postfix) with SMTP id 1FDEC80E93; Wed, 26 May 2004 20:52:35 +0900 (JST) Received: from [127.0.0.1] (dynamo.sohgoh.net [211.10.16.102]) by dynamo.sohgoh.net (Postfix) with ESMTP id 04D4E80E90; Wed, 26 May 2004 20:52:35 +0900 (JST) Date: Wed, 26 May 2004 20:52:24 +0900 From: Akihiro Sagawa To: freebsd-emulation@freebsd.org In-Reply-To: <20040524060403.7239.qmail@web15105.mail.bjs.yahoo.com> References: <20040524060403.7239.qmail@web15105.mail.bjs.yahoo.com> Message-Id: <20040526204931.0F7E.SAGAWA@sohgoh.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.09.01 [ja] cc: Sharp Gao Subject: Re: Device name convert for linux use X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2004 11:53:11 -0000 Hi, In "Device name convert for linux use", wrote: > I was developig a name and major/minor device number converting > mechanism for linux applications to use on a linux.ko module , as if > the application itself run on a linux. (snip) > Is this helpful to linux emulator ? This mail was a bit old, but that sounds great. AFAIK, glibc's wordexp(3) checks /dev/null's device number before opening /dev/null as stderr for a shell. If they are not match (ie. under FreeBSD Linux emulation mode), wordexp always returns error. And (maybe?) ld-linux.so also checks /dev/null's device number before launching programs when one of stdin, stdout, stderr is closed and program has set SetUID bit. (In glibc-2.3.2/sysdeps/generic/dl-sysdep.c???) Therefore I made a quick hack patch for sys/compat/linux/linux_stats.c to tell a lie about /dev/null's device number. But Sharp Gao's way seems to be better. :) Where is the patch? -- Akihiro SAGAWA To reproduce this problem, compile below source with linux gcc. ---- for wordexp, cut here #include #include int main(int argc, char* argv[]) { int i, err; wordexp_t we; err = wordexp("`date`", &we, 0); printf("err=%d\n", err); if (!err) for(i=0; i < we.we_wordc; i++) printf("[%d] %s\n", i, we.we_wordv[i]); wordfree(&we); } ---- to here ---- for ld-linux, cut here #include #include #include int main(int argc, char* argv[]) { char* exec_args[] = {"id", NULL}; printf("bye stdin\n"); close(STDIN_FILENO); printf("stdin has closed\n"); fflush(stdout); execvp(exec_args[0], exec_args); printf("failed to exec prog.\n"); exit(1); } ---- to here From owner-freebsd-emulation@FreeBSD.ORG Wed May 26 06:52:13 2004 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 17FF516A50F for ; Wed, 26 May 2004 06:52:13 -0700 (PDT) Received: from web90110.mail.scd.yahoo.com (web90110.mail.scd.yahoo.com [66.218.94.81]) by mx1.FreeBSD.org (Postfix) with SMTP id E5C2343D53 for ; Wed, 26 May 2004 06:52:12 -0700 (PDT) (envelope-from urgaolong@yahoo.com) Message-ID: <20040526135121.25679.qmail@web90110.mail.scd.yahoo.com> Received: from [61.187.54.13] by web90110.mail.scd.yahoo.com via HTTP; Wed, 26 May 2004 14:51:21 BST Date: Wed, 26 May 2004 14:51:21 +0100 (BST) From: =?iso-8859-1?q?Gao=20Long?= To: Akihiro Sagawa , freebsd-emulation@freebsd.org In-Reply-To: <20040526204931.0F7E.SAGAWA@sohgoh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.1 cc: Sharp Gao Subject: Re: Device name convert for linux use X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 May 2004 13:52:13 -0000 Akihiro Sagawa wrote:Hi, In "Device name convert for linux use", wrote: > I was developig a name and major/minor device number converting > mechanism for linux applications to use on a linux.ko module , as if > the application itself run on a linux. (snip) > Is this helpful to linux emulator ? This mail was a bit old, but that sounds great. AFAIK, glibc's wordexp(3) checks /dev/null's device number before opening /dev/null as stderr for a shell. If they are not match (ie. under FreeBSD Linux emulation mode), wordexp always returns error. And (maybe?) ld-linux.so also checks /dev/null's device number before launching programs when one of stdin, stdout, stderr is closed and program has set SetUID bit. (In glibc-2.3.2/sysdeps/generic/dl-sysdep.c???) Therefore I made a quick hack patch for sys/compat/linux/linux_stats.c to tell a lie about /dev/null's device number. But Sharp Gao's way seems to be better. :) Where is the patch? -- Akihiro SAGAWA To reproduce this problem, compile below source with linux gcc. ---- for wordexp, cut here #include #include int main(int argc, char* argv[]) { int i, err; wordexp_t we; err = wordexp("`date`", &we, 0); printf("err=%d\n", err); if (!err) for(i=0; i < we.we_wordc; i++) printf("[%d] %s\n", i, we.we_wordv[i]); wordfree(&we); } ---- to here ---- for ld-linux, cut here #include #include #include int main(int argc, char* argv[]) { char* exec_args[] = {"id", NULL}; printf("bye stdin\n"); close(STDIN_FILENO); printf("stdin has closed\n"); fflush(stdout); execvp(exec_args[0], exec_args); printf("failed to exec prog.\n"); exit(1); } ---- to here _______________________________________________ freebsd-emulation@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-emulation To unsubscribe, send any mail to "freebsd-emulation-unsubscribe@freebsd.org" Hi , I moved from imgaolong@yahoo.com.cn to urgaolong@yahoo.com for the trouble of gb2312 coding. The intial pulse to build up a convert table is that we find some one in linux always uses the tty? instead of ttyv? , and the gnu libc is always fond of checking the major/minor numbers of the devices:-> I have patched the linux_file.c to use a virual name system just correspond to the linux systems , when linux.ko passes device names into the FreeBSD kernel , we just consult the table and convert them into proper FreeBSD styles. So every linux application running on a FreeBSD seemed to have a correct device name space , including the major/minor device numbers. After all , the real behavior of the devices are the critical thing. If the behavior of the device in two operating systems is absolutely the same , so every thing is OK , as we have already impletmented the tty? to ttyv? convertion , nothing bad has ever happened . But not to any device name else, if the device's behavior is just alike. Other things continued to make the table still very short. I may take up time to implement a my-best solution , well , it's just a try , before I could understand every details of the device name properties of both the Linux and FreeBSD devices.I was still wandering whether it could be taken into the next version of linux emulation , for it really can improve the compatiblities. --------------------------------- Yahoo! Messenger - Communicate instantly..."Ping" your friends today! Download Messenger Now