From owner-freebsd-emulation Mon Sep 11 6:14:10 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from mail.utcorp.net (x-montana.utcorp.com [146.145.135.26]) by hub.freebsd.org (Postfix) with ESMTP id C3AB437B424 for ; Mon, 11 Sep 2000 06:14:08 -0700 (PDT) Received: from [146.145.135.17] (helo=utcorp.com) by mail.utcorp.net with esmtp (Exim 3.03 #1) id 13YTPQ-0005AI-00; Mon, 11 Sep 2000 09:14:04 -0400 Message-ID: <39BCDD1B.40A82563@utcorp.com> Date: Mon, 11 Sep 2000 09:24:43 -0400 From: Kurt Seel Organization: dis X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 2.2.8-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: Martin Blapp Cc: freebsd-emulation@FreeBSD.ORG Subject: Re: Staroffice 5.2 and network - broken ? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I don't see 5.2 in the ports tree, is it there? http://www.freebsd.org/cgi/ports.cgi?query=staroffice&stype=all Martin Blapp wrote: > Hi all, > > As the maintainer of staroffice5.2 for FreeBSD I've seen that everything > network-related like staroffice-web, mail, news is not working under > the linux ABI. It is working with the . In version 5.1 everything worked > as is should. > > Anyone does know something about this ? Maybe Marcel ? > > Martin > > Martin Blapp, mb@imp.ch > ------------------------------------------------ > Improware AG, UNIX solution and service provider > Zurlindenstrasse 29, 4133 Pratteln, Switzerland > Phone: +41 79 370 26 05, Fax: +41 61 826 93 01 > ------------------------------------------------ > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-emulation" in the body of the message -- In theory, there is no difference between theory and practice. In practice, however, there is. - Unknown To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Mon Sep 11 6:18:26 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from mail.imp.ch (mail.imp.ch [157.161.1.2]) by hub.freebsd.org (Postfix) with ESMTP id 53BF137B424 for ; Mon, 11 Sep 2000 06:18:23 -0700 (PDT) Received: from levais.imp.ch (levais.imp.ch [157.161.4.66]) by mail.imp.ch (8.9.3/8.9.3b) with SMTP id PAA75802; Mon, 11 Sep 2000 15:18:19 +0200 (CEST) Date: Mon, 11 Sep 2000 15:22:24 +0200 (CEST) From: Martin Blapp To: Kurt Seel Cc: freebsd-emulation@FreeBSD.ORG Subject: Re: Staroffice 5.2 and network - broken ? In-Reply-To: <39BCDD1B.40A82563@utcorp.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, /usr/ports/editors/staroffice52 Good luck Martin Martin Blapp, mb@imp.ch ------------------------------------------------ Improware AG, UNIX solution and service provider Zurlindenstrasse 29, 4133 Pratteln, Switzerland Phone: +41 79 370 26 05, Fax: +41 61 826 93 01 ------------------------------------------------ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Mon Sep 11 14: 3:46 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from palrel1.hp.com (palrel1.hp.com [156.153.255.242]) by hub.freebsd.org (Postfix) with ESMTP id 1896437B423; Mon, 11 Sep 2000 14:03:11 -0700 (PDT) Received: from adlmail.cup.hp.com (adlmail.cup.hp.com [15.0.100.30]) by palrel1.hp.com (Postfix) with ESMTP id 3291D330; Mon, 11 Sep 2000 14:03:07 -0700 (PDT) Received: from cup.hp.com (gauss.cup.hp.com [15.28.97.152]) by adlmail.cup.hp.com (8.9.3 (PHNE_18546)/8.9.3 SMKit7.02) with ESMTP id OAA23062; Mon, 11 Sep 2000 14:03:06 -0700 (PDT) Message-ID: <39BD488A.F3FB9388@cup.hp.com> Date: Mon, 11 Sep 2000 17:03:06 -0400 From: Marcel Moolenaar Organization: Hewlett-Packard X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: Martin Blapp Cc: ports@FreeBSD.ORG, freebsd-emulation@FreeBSD.ORG Subject: Re: Staroffice 5.2 and network - broken ? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Martin Blapp wrote: > > As the maintainer of staroffice5.2 for FreeBSD I've seen that everything > network-related like staroffice-web, mail, news is not working under > the linux ABI. It is working with the . In version 5.1 everything worked > as is should. > > Anyone does know something about this ? Maybe Marcel ? I don't know if this has been resolved already, but does SO5.1 still work? -- Marcel Moolenaar mail: marcel@cup.hp.com / marcel@FreeBSD.org tel: (408) 447-4222 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Mon Sep 11 14:10:45 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from mail.mypoints.com (dyn-52-52.corp.mypoints.com [209.141.52.52]) by hub.freebsd.org (Postfix) with ESMTP id 77FA837B422 for ; Mon, 11 Sep 2000 14:10:42 -0700 (PDT) Received: (from cgaffney@localhost) by mail.mypoints.com (8.9.3/8.9.3) id QAA00368 for freebsd-emulation@FreeBSD.ORG; Mon, 11 Sep 2000 16:10:30 -0500 (CDT) (envelope-from cgaffney) Date: Mon, 11 Sep 2000 16:10:30 -0500 From: "Corey G." To: freebsd-emulation@FreeBSD.ORG Subject: Cannot Get Virtual Interface Up Message-ID: <20000911161030.A290@mypoints.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I am trying to get host-only networking working on FreeBSD 4.1 and have stumbled upon getting the interface to actually come up. Here is some information. blood# ./vmware.sh stop ifconfig: interface vmnet1 does not exist ifconfig: interface vmnet1 does not exist blood# ./vmware.sh start kldload: can't load if_tap.ko: No such file or directory ./vmware.sh: cannot create /compat/linux/dev/vmnet1: no such device or address blood# ls -la /compat/linux/dev/vm* crw-r--r-- 1 root wheel 200, 0 Sep 11 16:01 /compat/linux/dev/vmmon crw-r--r-- 1 root wheel 149, 0x00010001 Sep 11 16:01 /compat/linux/dev/vmnet1 blood# cat config vmware.fullpath = "/usr/local/lib/vmware/bin/vmware" wizard.fullpath = "/usr/local/lib/vmware/bin/vmware-wizard" dhcpd.fullpath = "/usr/local/lib/vmware/bin/vmnet-dhcpd" loop.fullpath = ""/usr/local/lib/vmware/bin/vmware-loop" libdir = "/usr/local/lib/vmware/lib" vmnet1.HostOnlyAddress = "192.168.74.1" vmnet1.HostOnlyNetMask = "255.255.255.0 Thanks All, Corey -- +----------------------------------------------+ | Corey Gaffney | corey.gaffney@mypoints.com | | Systems Manager | (847) 969-8150 x4500 | +----------------------------------------------+ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Mon Sep 11 14:29:12 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (Postfix) with ESMTP id CB4E737B423; Mon, 11 Sep 2000 14:29:07 -0700 (PDT) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id RAA09656; Mon, 11 Sep 2000 17:29:06 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.0/8.9.1) id e8BLT6g45456; Mon, 11 Sep 2000 17:29:06 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Mon, 11 Sep 2000 17:29:06 -0400 (EDT) To: freebsd-emulation@freebsd.org, marcel@scc.nl Cc: freebsd-java@freebsd.org Subject: patches to (sorta) run IBM Java 1.3 X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <14781.19093.242122.261119@grasshopper.cs.duke.edu> Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I've got the IBM jdk 1.3 partially working. So far, it seems that anything which tries to bring up an X window dies a horrid death. All else seems to work fine. I've left a new patchset at http://www.cs.duke.edu/~gallatin/linux_sa_siginfo/diff This patchset is against a pre-SMPng -current and: - changes MINSIGSTKSZ from 8192 to 2048 - implements linux_rt_sendsig() & linux_rt_sigreturn() - implements userland sigtramp code for linux_rt_sigreturn() - implements linux_to_bsd_sigaltstack & bsd_to_linux_sigaltstack() to fix a bug in linux_sigaltstack & to avoid lots of cut-n-paste in linux_rt_sigreturn(). This also fixes the "Java HotSpot(TM) Client VM warning: cannot uninstall alt signal stack" one sees with Sun's 1.3 JDK. - peppers a lot of the linux code with loud uprintfs to assist in debugging the X problem I currently suspect the X problem has something to do with we grow our stacks when they're mapped as MAP_STACK. The apps which die are always killed because of a not totally unreasonable looking stack address. I'm really, really hoping to find somebody to help me debug the X window problem. Somebody, please? ------------------------------------------------------------------------------ Andrew Gallatin, Sr Systems Programmer http://www.cs.duke.edu/~gallatin Duke University Email: gallatin@cs.duke.edu Department of Computer Science Phone: (919) 660-6590 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Tue Sep 12 21: 1:25 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (Postfix) with ESMTP id 7928D37B423; Tue, 12 Sep 2000 21:01:22 -0700 (PDT) Received: (from smap@localhost) by whistle.com (8.10.0/8.10.0) id e8D400R28308; Tue, 12 Sep 2000 21:00:00 -0700 (PDT) Received: from bubba.whistle.com( 207.76.205.7) by whistle.com via smap (V2.0) id xma028303; Tue, 12 Sep 2000 20:59:30 -0700 Received: (from archie@localhost) by bubba.whistle.com (8.9.3/8.9.3) id UAA94749; Tue, 12 Sep 2000 20:59:30 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200009130359.UAA94749@bubba.whistle.com> Subject: Re: vmware2 networking question In-Reply-To: <200009081622.JAA63625@whistle.com> "from Doug Ambrisko at Sep 8, 2000 09:22:59 am" To: Doug Ambrisko Date: Tue, 12 Sep 2000 20:59:30 -0700 (PDT) Cc: Michael Harnois , Vladimir Silyaev , Mattias Pantzare , emulation@FreeBSD.ORG, net@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL82 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Doug Ambrisko writes: > Also I haven't had to deal with reboots etc. This may not met everyones > needs but it works great for me. There is work under way for a real > netgraph bridging node so it could also plug into the hosts TCP/IP stack > etc. It's been checked in to -current as ng_bridge(4).. feedback welcome. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Wed Sep 13 12:43:17 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (Postfix) with ESMTP id 3EC5F37B424; Wed, 13 Sep 2000 12:43:11 -0700 (PDT) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id PAA24950; Wed, 13 Sep 2000 15:43:09 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.0/8.9.1) id e8DJh8749427; Wed, 13 Sep 2000 15:43:08 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 13 Sep 2000 15:43:08 -0400 (EDT) To: freebsd-emulation@freebsd.org, freebsd-java@freebsd.org Subject: IBM JDK 1.3 now working (pointer to patches) X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <14783.55339.269170.481033@grasshopper.cs.duke.edu> Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I've finally gotten the IBM jdk 1.3 working. I haven't tested it very heavily AWT stuff seems to finally work though. Here's an an updated patchset to a pre-SMPng -current. The patchset does the following: - changes MINSIGSTKSZ from 8192 to 2048 - implements linux_rt_sendsig() & linux_rt_sigreturn() - implements userland sigtramp code for linux_rt_sigreturn() - implements linux_to_bsd_sigaltstack & bsd_to_linux_sigaltstack() to fix a bug in linux_sigaltstack & to avoid lots of cut-n-paste in linux_rt_sigreturn(). This also fixes the "Java HotSpot(TM) Client VM warning: cannot uninstall alt signal stack" one sees with Sun's 1.3 JDK. - changes the MAP_STACK flag to MAP_ANON for LINUX_MAP_GROWSDOWN mmaps. This was the final step in getting it working. Any VM gurus out there want to talk about this one? There's aparently something wrong with autogrowing linux thread stacks[*] Patches at: http://www.cs.duke.edu/~gallatin/linux_sa_siginfo/diff [*]The "problem" is the heuristic used by vm_map_growstack() to determine whether the stack part of the main process stack. We currently use: is_procstack = addr >= (vm_offset_t)vm->vm_maxsaddr; where vm->vm_maxsaddr comes from exec_new_vmspace(): vmspace->vm_maxsaddr = (char *)USRSTACK - MAXSSIZ; The IBM JDK's main thread reduces it's stack size to rlim_cur=2040*1024. It then creates stacks for its threads at addresses which are greater than vm_maxsaddr but less than the current bottom of the main process stack as defined by p->p_rlimit[RLIMIT_STACK].rlim_cur. The first time a thread accesses something requiring this region to grow, it goes down in flames. Drew ------------------------------------------------------------------------------ Andrew Gallatin, Sr Systems Programmer http://www.cs.duke.edu/~gallatin Duke University Email: gallatin@cs.duke.edu Department of Computer Science Phone: (919) 660-6590 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Wed Sep 13 12:51:45 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from ns.yogotech.com (ns.yogotech.com [206.127.123.66]) by hub.freebsd.org (Postfix) with ESMTP id 9F0EE37B423; Wed, 13 Sep 2000 12:51:37 -0700 (PDT) Received: from nomad.yogotech.com (nomad.yogotech.com [206.127.123.131]) by ns.yogotech.com (8.9.3/8.9.3) with ESMTP id NAA14066; Wed, 13 Sep 2000 13:51:36 -0600 (MDT) (envelope-from nate@nomad.yogotech.com) Received: (from nate@localhost) by nomad.yogotech.com (8.8.8/8.8.8) id NAA13215; Wed, 13 Sep 2000 13:51:35 -0600 (MDT) (envelope-from nate) Date: Wed, 13 Sep 2000 13:51:35 -0600 (MDT) Message-Id: <200009131951.NAA13215@nomad.yogotech.com> From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Andrew Gallatin Cc: freebsd-emulation@FreeBSD.ORG, freebsd-java@FreeBSD.ORG Subject: Re: IBM JDK 1.3 now working (pointer to patches) In-Reply-To: <14783.55339.269170.481033@grasshopper.cs.duke.edu> References: <14783.55339.269170.481033@grasshopper.cs.duke.edu> X-Mailer: VM 6.34 under 19.16 "Lille" XEmacs Lucid Reply-To: nate@yogotech.com (Nate Williams) Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > I've finally gotten the IBM jdk 1.3 working. I haven't tested it very > heavily AWT stuff seems to finally work though. Congratulations Drew! Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Wed Sep 13 14: 0:19 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from news.IAEhv.nl (news.IAE.nl [194.151.64.4]) by hub.freebsd.org (Postfix) with ESMTP id 8647A37B42C for ; Wed, 13 Sep 2000 14:00:14 -0700 (PDT) Received: (from uucp@localhost) by news.IAEhv.nl (8.9.1/8.9.1) with IAEhv.nl id XAA11085 for emulation@freebsd.org; Wed, 13 Sep 2000 23:00:13 +0200 (MET DST) Received: from localhost (localhost [127.0.0.1]) by bowtie.nl (8.8.8/8.8.8) with ESMTP id WAA16252 for ; Wed, 13 Sep 2000 22:58:54 +0200 (CEST) (envelope-from marc@bowtie.nl) Message-Id: <200009132058.WAA16252@bowtie.nl> X-Mailer: exmh version 2.1.1 10/15/1999 To: emulation@freebsd.org Subject: Re: IBM JDK 1.3 now working (pointer to patches) In-reply-to: gallatin's message of Wed, 13 Sep 2000 15:43:08 -0400. <14783.55339.269170.481033@grasshopper.cs.duke.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 13 Sep 2000 22:58:54 +0200 From: Marc van Kempen Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org > > I've finally gotten the IBM jdk 1.3 working. I haven't tested it very > heavily AWT stuff seems to finally work though. > > Here's an an updated patchset to a pre-SMPng -current. The patchset > does the following: > > - changes MINSIGSTKSZ from 8192 to 2048 > - implements linux_rt_sendsig() & linux_rt_sigreturn() > - implements userland sigtramp code for linux_rt_sigreturn() > - implements linux_to_bsd_sigaltstack & bsd_to_linux_sigaltstack() to > fix a bug in linux_sigaltstack & to avoid lots of cut-n-paste in > linux_rt_sigreturn(). This also fixes the "Java HotSpot(TM) > Client VM warning: cannot uninstall alt signal stack" one sees with > Sun's 1.3 JDK. > - changes the MAP_STACK flag to MAP_ANON for LINUX_MAP_GROWSDOWN > mmaps. This was the final step in getting it working. Any VM gurus > out there want to talk about this one? There's aparently > something wrong with autogrowing linux thread stacks[*] > > Patches at: http://www.cs.duke.edu/~gallatin/linux_sa_siginfo/diff > > [*]The "problem" is the heuristic used by vm_map_growstack() to > determine whether the stack part of the main process stack. We > currently use: > > is_procstack = addr >= (vm_offset_t)vm->vm_maxsaddr; > > where vm->vm_maxsaddr comes from exec_new_vmspace(): > vmspace->vm_maxsaddr = (char *)USRSTACK - MAXSSIZ; > > The IBM JDK's main thread reduces it's stack size to rlim_cur=2040*1024. > It then creates stacks for its threads at addresses which are greater > than vm_maxsaddr but less than the current bottom of the main process > stack as defined by p->p_rlimit[RLIMIT_STACK].rlim_cur. The first time > a thread accesses something requiring this region to grow, it goes > down in flames. > Great work Andrew, I wish I could have helped, I tried, but this is beyond my capabilities I'm afraid. Marc. -- ---------------------------------------------------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!! Wij zijn verhuisd! Onze telefoonnr's en !!!!! !!!! ons adres zijn gewijzigd. !!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Marc van Kempen BowTie Technology Raiffeisenstraat 7 5611 CH Eindhoven tel. +31 40 2 64 98 60 mailto:marc@bowtie.nl fax. +31 40 2 64 98 61 http://www.bowtie.nl ---------------------------------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Wed Sep 13 14:18:18 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from vexpert.dbai.tuwien.ac.at (vexpert.dbai.tuwien.ac.at [128.130.111.12]) by hub.freebsd.org (Postfix) with ESMTP id BA1AF37B424; Wed, 13 Sep 2000 14:18:13 -0700 (PDT) Received: from [128.130.111.2] (deneb [128.130.111.2]) by vexpert.dbai.tuwien.ac.at (8.9.3/8.9.3) with ESMTP id XAA13746; Wed, 13 Sep 2000 23:18:06 +0200 (MET DST) Date: Wed, 13 Sep 2000 23:18:06 +0200 (CEST) From: Gerald Pfeifer To: Andrew Gallatin Cc: freebsd-emulation@freebsd.org, freebsd-java@freebsd.org Subject: Re: IBM JDK 1.3 now working (pointer to patches) In-Reply-To: <14783.55339.269170.481033@grasshopper.cs.duke.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Wed, 13 Sep 2000, Andrew Gallatin wrote: > Here's an an updated patchset to a pre-SMPng -current. > Patches at: http://www.cs.duke.edu/~gallatin/linux_sa_siginfo/diff Great! Now, what is the perspective for seeing this in a FreeBSD release or at least on the -STABLE branch? Not so good, I'm afraid? Even if this integrated into -CURRENT (with SMPng), it probably won't be possible to easily backport it to -STABLE, and adding it to -STABLE without previous tests on -CURRENT won't be acceptable, I guess. So, will -STABLE users have to wait another year, for 5.0-RELEASE? (We'll see whether we'll be able to prevent a switch of our entire network to Linux during that year, if this is really true. :-( ) Gerald -- Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Thu Sep 14 5:53:43 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by hub.freebsd.org (Postfix) with ESMTP id C8BFF37B424; Thu, 14 Sep 2000 05:53:39 -0700 (PDT) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id IAA11577; Thu, 14 Sep 2000 08:53:39 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.0/8.9.1) id e8ECrcT50620; Thu, 14 Sep 2000 08:53:38 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 14 Sep 2000 08:53:38 -0400 (EDT) To: Gerald Pfeifer Cc: freebsd-emulation@freebsd.org, freebsd-java@freebsd.org Subject: Re: IBM JDK 1.3 now working (pointer to patches) In-Reply-To: References: <14783.55339.269170.481033@grasshopper.cs.duke.edu> X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <14784.51474.93722.921299@grasshopper.cs.duke.edu> Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Gerald Pfeifer writes: > So, will -STABLE users have to wait another year, for 5.0-RELEASE? > > (We'll see whether we'll be able to prevent a switch of our entire > network to Linux during that year, if this is really true. :-( ) Before you get yourself too worked up (;-), bear in mind that I need this working on 4.0-RELEASE (what we're frozen at locally). I'll try to make patches to -STABLE and 4.0-RELEASE available before the weekend. FWIW, it the backport should be trivial. The main changes between -current linux emulation and -stable linux emulation is a shuffling of the files to make it possible to integrate linux/alpha support for the alpha port. Linux/alpha support, btw, is a Good Thing for the alpha port, as it gets us access to the world-class compilers from Compaq. Drew ------------------------------------------------------------------------------ Andrew Gallatin, Sr Systems Programmer http://www.cs.duke.edu/~gallatin Duke University Email: gallatin@cs.duke.edu Department of Computer Science Phone: (919) 660-6590 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Thu Sep 14 6:14:35 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from gorilla.mchh.siemens.de (gorilla.mchh.siemens.de [194.138.158.18]) by hub.freebsd.org (Postfix) with ESMTP id 69E0937B424; Thu, 14 Sep 2000 06:14:27 -0700 (PDT) Received: from moody.mchh.siemens.de (mail2.mchh.siemens.de [194.138.158.226]) by gorilla.mchh.siemens.de (8.9.3/8.9.3) with ESMTP id PAA05042; Thu, 14 Sep 2000 15:14:12 +0200 (MET DST) Received: from mchh247e.demchh201e.icn.siemens.de ([139.21.200.57]) by moody.mchh.siemens.de (8.9.1/8.9.1) with ESMTP id PAA03294; Thu, 14 Sep 2000 15:13:48 +0200 (MET DST) Received: by MCHH247E with Internet Mail Service (5.5.2650.21) id ; Thu, 14 Sep 2000 15:14:22 +0200 Message-ID: <67E0BE167008D31185F60008C7289DA0E12F02@MCHH218E> From: Reifenberger Michael To: "'Andrew Gallatin'" Cc: freebsd-emulation@FreeBSD.ORG, freebsd-java@FreeBSD.ORG Subject: AW: IBM JDK 1.3 now working (pointer to patches) Date: Thu, 14 Sep 2000 15:14:19 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Hi, sigh!=20 After waiting so long for such a change I decided to upgrade to = -current (SMPng) yesterday. Do you have a patch for -current available? I can test various IBM-JDK applications (Oracle 8.1.6, SAP-gui, ...) as = well as lotus-notes. Bravo! anyway for hunting this problem down! Bye/2 ------ Michael Reifenberger - IT, UNIX, R/3-Basis Work: Michael.Reifenberger@plaut.de Proj: = Michael.Reifenberger.gp@icn.siemens.de Pers: Michael@Reifenberger.com Webspace: http://www.reifenberger.com > -----Urspr> =FCngliche Nachricht----- > Von: Andrew Gallatin [SMTP:gallatin@cs.duke.edu] > Gesendet am: Donnerstag, 14. September 2000 14:54 > An: Gerald Pfeifer > Cc: freebsd-emulation@FreeBSD.ORG; freebsd-java@FreeBSD.ORG > Betreff: Re: IBM JDK 1.3 now working (pointer to patches) >=20 >=20 > Gerald Pfeifer writes: > > So, will -STABLE users have to wait another year, for 5.0-RELEASE? > >=20 > > (We'll see whether we'll be able to prevent a switch of our entire > > network to Linux during that year, if this is really true. :-( ) >=20 > Before you get yourself too worked up (;-), bear in mind that I need > this working on 4.0-RELEASE (what we're frozen at locally). I'll try > to make patches to -STABLE and 4.0-RELEASE available before the > weekend. =20 >=20 > FWIW, it the backport should be trivial. The main changes between > -current linux emulation and -stable linux emulation is a shuffling = of > the files to make it possible to integrate linux/alpha support for = the > alpha port. Linux/alpha support, btw, is a Good Thing for the alpha > port, as it gets us access to the world-class compilers from Compaq. >=20 > Drew >=20 > = ------------------------------------------------------------------------= ------ > Andrew Gallatin, Sr Systems Programmer = http://www.cs.duke.edu/~gallatin > Duke University Email: gallatin@cs.duke.edu > Department of Computer Science Phone: (919) 660-6590 >=20 >=20 > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-emulation" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Thu Sep 14 12:32: 7 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from isds.duke.edu (davinci.isds.duke.edu [152.3.22.1]) by hub.freebsd.org (Postfix) with ESMTP id 3C9AD37B424 for ; Thu, 14 Sep 2000 12:31:48 -0700 (PDT) Received: from feta.isds.duke.edu (feta.isds.duke.edu [152.3.22.76]) by isds.duke.edu (8.8.8/8.8.8) with ESMTP id PAA07114 for ; Thu, 14 Sep 2000 15:31:46 -0400 (EDT) Received: (from sto@localhost) by feta.isds.duke.edu (8.11.0/8.9.3) id e8EJVjW06091 for freebsd-emulation@FreeBSD.ORG; Thu, 14 Sep 2000 15:31:45 -0400 (EDT) (envelope-from sto) Date: Thu, 14 Sep 2000 15:31:45 -0400 From: "Sean O'Connell" To: FreeBSD emulation Subject: Quick and Dirty MFC of Andrew Gallatin's Java patches Message-ID: <20000914153145.V4542@stat.Duke.EDU> Reply-To: "Sean O'Connell" Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="o0ZfoUVt4BxPQnbU" Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Organization: Institute of Statistics and Decision Sciences Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --o0ZfoUVt4BxPQnbU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi All- I did a Quick&Dirty MFC of Andrew Gallatin's work on getting the IBM Java SDK to work. I was able to run the appletviewer on one of the demos and it worked. I cannot say much more than that. The patches are all relative to /usr/src (or / since they are all in sys ) The majority of the patches are for files in /sys/i386/linux. You should be able to apply the patch; cd to /sys/modules/linux; type make; kldunload linux; type make install; and kldload linux There is an additonal change which sets the MINSIGSTKSZ to 2048 in sys/sys/signal.h .. this will require a kernel rebuild to take effect. I am sending the patch as an attachment to prevent it from getting munged. If there is an overwhelming demand, I could make it available via http. HTH, Sean --o0ZfoUVt4BxPQnbU Content-Type: text/plain; charset=us-ascii Content-Description: MFC attempt of Drew's JDK patches Content-Disposition: attachment; filename="linux.patch2" --- sys/i386/linux/linux.h.orig Tue Sep 12 10:14:29 2000 +++ sys/i386/linux/linux.h Thu Sep 14 12:28:12 2000 @@ -33,6 +33,8 @@ #include +#include /* for sigval union */ + #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_LINUX); #endif @@ -157,6 +159,15 @@ #define LINUX_SIGISMEMBER(set, sig) SIGISMEMBER(set, sig) #define LINUX_SIGADDSET(set, sig) SIGADDSET(set, sig) +/* sigaltstack */ +#define LINUX_MINSIGSTKSZ 2048 +#define LINUX_SS_ONSTACK 1 +#define LINUX_SS_DISABLE 2 +#define LINUX_SS_DISABLE_BC 0 /* backwards compat SS_DISABLE */ + +void linux_to_bsd_sigaltstack(int *lsa, int *bsa); +void bsd_to_linux_sigaltstack(int *bsa, int *lsa); + typedef void (*linux_handler_t)(int); typedef u_long linux_osigset_t; @@ -210,6 +221,72 @@ int sc_cr2; }; + +struct linux_ucontext { + unsigned long uc_flags; + void *uc_link; + linux_stack_t uc_stack; + struct linux_sigcontext uc_mcontext; + linux_sigset_t uc_sigmask; +}; + +#define LINUX_SI_MAX_SIZE 128 +#define LINUX_SI_PAD_SIZE ((LINUX_SI_MAX_SIZE/sizeof(int)) - 3) + +typedef struct siginfo { + int lsi_signo; + int lsi_errno; + int lsi_code; + + union { + int _pad[LINUX_SI_PAD_SIZE]; + struct { + linux_pid_t _pid; + linux_uid_t _uid; + } _kill; + + struct { + unsigned int _timer1; + unsigned int _timer2; + } _timer; + + struct { + linux_pid_t _pid; /* sender's pid */ + linux_uid_t _uid; /* sender's uid */ + union sigval _sigval; + } _rt; + + struct { + linux_pid_t _pid; /* which child */ + linux_uid_t _uid; /* sender's uid */ + int _status; /* exit code */ + linux_clock_t _utime; + linux_clock_t _stime; + } _sigchld; + + struct { + void *_addr; /* faulting insn/memory ref. */ + } _sigfault; + + struct { + int _band; /* POLL_IN, POLL_OUT, POLL_MSG */ + int _fd; + } _sigpoll; + } _sifields; +} linux_siginfo_t; + +#define lsi_pid _sifields._kill._pid +#define lsi_uid _sifields._kill._uid +#define lsi_status _sifields._sigchld._status +#define lsi_utime _sifields._sigchld._utime +#define lsi_stime _sifields._sigchld._stime +#define lsi_value _sifields._rt._sigval +#define lsi_int _sifields._rt._sigval.sival_int +#define lsi_ptr _sifields._rt._sigval.sival_ptr +#define lsi_addr _sifields._sigfault._addr +#define lsi_band _sifields._sigpoll._band +#define lsi_fd _sifields._sigpoll._fd + /* * We make the stack look like Linux expects it when calling a signal * handler, but use the BSD way of calling the handler and sigreturn(). @@ -219,13 +296,28 @@ struct linux_sigframe { int sf_sig; struct linux_sigcontext sf_sc; + int pad[41]; /* pad it out so we can use the same + * trampoline code for both types of + * sigframes + */ + linux_handler_t sf_handler; }; +struct linux_rt_sigframe { + int sf_sig; + linux_siginfo_t *sf_siginfo; + struct linux_ucontext *sf_ucontext; /* points to sf_uc */ + linux_siginfo_t sf_si; + struct linux_ucontext sf_sc; /* = *sf_ucontext */ + linux_handler_t sf_handler; +}; + extern int bsd_to_linux_signal[]; extern int linux_to_bsd_signal[]; extern struct sysentvec linux_sysvec; extern struct sysentvec elf_linux_sysvec; +void bsd_to_linux_sigset(sigset_t *bss, linux_sigset_t *lss); /* * Pluggable ioctl handlers --- sys/i386/linux/linux_dummy.c.orig Thu Sep 14 10:37:48 2000 +++ sys/i386/linux/linux_dummy.c Thu Sep 14 10:38:06 2000 @@ -94,7 +94,6 @@ DUMMY(nfsservctl); DUMMY(getresgid); DUMMY(prctl); -DUMMY(rt_sigreturn); DUMMY(rt_sigpending); DUMMY(rt_sigtimedwait); DUMMY(rt_sigqueueinfo); --- sys/i386/linux/linux_file.c.orig Fri Nov 26 05:20:09 1999 +++ sys/i386/linux/linux_file.c Thu Jul 20 15:29:37 2000 @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/i386/linux/linux_file.c,v 1.38 1999/11/26 10:20:09 marcel Exp $ + * $FreeBSD: src/sys/i386/linux/linux_file.c,v 1.38.2.2 2000/07/19 21:12:39 marcel Exp $ */ #include "opt_compat.h" @@ -199,14 +199,7 @@ } */ fcntl_args; struct linux_flock linux_flock; struct flock *bsd_flock; - struct filedesc *fdp; - struct file *fp; - struct vnode *vp; - long pgid; - struct pgrp *pgrp; - struct tty *tp; caddr_t sg; - dev_t dev; sg = stackgap_init(); bsd_flock = (struct flock *)stackgap_alloc(&sg, sizeof(struct flock)); @@ -287,49 +280,14 @@ fcntl_args.arg = (int)bsd_flock; return fcntl(p, &fcntl_args); - case LINUX_F_SETOWN: case LINUX_F_GETOWN: - /* - * We need to route around the normal fcntl() for these calls, - * since it uses TIOC{G,S}PGRP, which is too restrictive for - * Linux F_{G,S}ETOWN semantics. For sockets, this problem - * does not exist. - */ - fdp = p->p_fd; - if ((u_int)args->fd >= fdp->fd_nfiles || - (fp = fdp->fd_ofiles[args->fd]) == NULL) - return EBADF; - if (fp->f_type == DTYPE_SOCKET) { - fcntl_args.cmd = args->cmd == LINUX_F_SETOWN ? F_SETOWN : F_GETOWN; - fcntl_args.arg = args->arg; - return fcntl(p, &fcntl_args); - } - vp = (struct vnode *)fp->f_data; - dev = vn_todev(vp); - if (dev == NODEV) - return EINVAL; - if (!(devsw(dev)->d_flags & D_TTY)) - return EINVAL; - tp = dev->si_tty; - if (!tp) - return EINVAL; - if (args->cmd == LINUX_F_GETOWN) { - p->p_retval[0] = tp->t_pgrp ? tp->t_pgrp->pg_id : NO_PID; - return 0; - } - if ((long)args->arg <= 0) { - pgid = -(long)args->arg; - } else { - struct proc *p1 = pfind((long)args->arg); - if (p1 == 0) - return (ESRCH); - pgid = (long)p1->p_pgrp->pg_id; - } - pgrp = pgfind(pgid); - if (pgrp == NULL || pgrp->pg_session != p->p_session) - return EPERM; - tp->t_pgrp = pgrp; - return 0; + fcntl_args.cmd = F_GETOWN; + return fcntl(p, &fcntl_args); + + case LINUX_F_SETOWN: + fcntl_args.cmd = F_SETOWN; + fcntl_args.arg = args->arg; + return fcntl(p, &fcntl_args); } return EINVAL; } @@ -890,4 +848,32 @@ bsd.fd = uap->fd; return fsync(p, &bsd); +} + +int +linux_pread(p, uap) + struct proc *p; + struct linux_pread_args *uap; +{ + struct pread_args bsd; + + bsd.fd = uap->fd; + bsd.buf = uap->buf; + bsd.nbyte = uap->nbyte; + bsd.offset = uap->offset; + return pread(p, &bsd); +} + +int +linux_pwrite(p, uap) + struct proc *p; + struct linux_pwrite_args *uap; +{ + struct pwrite_args bsd; + + bsd.fd = uap->fd; + bsd.buf = uap->buf; + bsd.nbyte = uap->nbyte; + bsd.offset = uap->offset; + return pwrite(p, &bsd); } --- sys/i386/linux/linux_genassym.c.orig Thu Sep 14 10:38:18 2000 +++ sys/i386/linux/linux_genassym.c Thu Sep 14 10:38:39 2000 @@ -11,3 +11,5 @@ ASSYM(LINUX_SIGF_SC, offsetof(struct linux_sigframe, sf_sc)); ASSYM(LINUX_SC_GS, offsetof(struct linux_sigcontext, sc_gs)); ASSYM(LINUX_SC_EFLAGS, offsetof(struct linux_sigcontext, sc_eflags)); +ASSYM(LINUX_RT_SIGF_HANDLER, offsetof(struct linux_rt_sigframe, sf_handler)); +ASSYM(LINUX_RT_SIGF_UC, offsetof(struct linux_rt_sigframe, sf_sc)); --- sys/i386/linux/linux_locore.s.orig Thu Sep 14 10:39:04 2000 +++ sys/i386/linux/linux_locore.s Thu Sep 14 10:43:01 2000 @@ -14,11 +14,24 @@ int $0x80 /* enter kernel with args */ 0: jmp 0b ALIGN_TEXT +/* XXXXX */ + +_linux_rt_sigcode: + call *LINUX_RT_SIGF_HANDLER(%esp) + leal LINUX_RT_SIGF_UC(%esp),%ebx /* linux ucp */ + movl LINUX_SC_GS(%ebx),%gs + push %eax /* fake ret addr */ + movl $LINUX_SYS_linux_rt_sigreturn,%eax /* linux_rt_sigreturn() */ + int $0x80 /* enter kernel with args */ +0: jmp 0b + ALIGN_TEXT +/* XXXXX */ _linux_esigcode: .data - .globl _linux_szsigcode + .globl _linux_szsigcode, _linux_sznonrtsigcode _linux_szsigcode: .long _linux_esigcode-_linux_sigcode - +_linux_sznonrtsigcode: + .long _linux_rt_sigcode-_linux_sigcode .text --- sys/i386/linux/linux_misc.c.orig Thu Sep 14 10:48:54 2000 +++ sys/i386/linux/linux_misc.c Thu Sep 14 10:53:16 2000 @@ -619,9 +619,9 @@ if (args->flags & CLONE_PID) printf("linux_clone(%ld): CLONE_PID not yet supported\n", (long)p->p_pid); - printf("linux_clone(%ld): invoked with flags %x and stack %x\n", + printf("linux_clone(%ld): invoked with flags 0x%x and stack 0x%lx\n", (long)p->p_pid, (unsigned int)args->flags, - (unsigned int)args->stack); + (unsigned long int)args->stack); #endif if (!args->stack) @@ -696,7 +696,7 @@ sizeof(linux_args)))) return error; #ifdef DEBUG - printf("Linux-emul(%ld): mmap(%p, %d, %d, 0x%08x, %d, %d)", + printf("Linux-emul(%ld): mmap(%p, %d, %d, 0x%08x, %d, %d)\n", (long)p->p_pid, (void *)linux_args.addr, linux_args.len, linux_args.prot, linux_args.flags, linux_args.fd, linux_args.pos); #endif @@ -710,7 +710,7 @@ if (linux_args.flags & LINUX_MAP_ANON) bsd_args.flags |= MAP_ANON; if (linux_args.flags & LINUX_MAP_GROWSDOWN) { - bsd_args.flags |= MAP_STACK; + bsd_args.flags |= /* MAP_STACK; */ MAP_ANON; /*XXXXXXX gallatin*/ /* The linux MAP_GROWSDOWN option does not limit auto * growth of the region. Linux mmap with this option --- sys/i386/linux/linux_proto.h.orig Thu Sep 14 11:32:26 2000 +++ sys/i386/linux/linux_proto.h Thu Sep 14 11:33:35 2000 @@ -452,7 +452,7 @@ register_t dummy; }; struct linux_rt_sigreturn_args { - register_t dummy; + struct linux_ucontext * ucp; char ucp_[PAD_(struct linux_ucontext *)]; }; struct linux_rt_sigaction_args { int sig; char sig_[PAD_(int)]; --- sys/i386/linux/linux_signal.c.orig Tue Sep 12 10:15:54 2000 +++ sys/i386/linux/linux_signal.c Thu Sep 14 11:31:39 2000 @@ -55,7 +55,7 @@ } } -static void +void bsd_to_linux_sigset(sigset_t *bss, linux_sigset_t *lss) { int b, l; @@ -527,15 +527,25 @@ (long)p->p_pid, uap->uss, uap->uoss); #endif - error = copyin(uap->uss, &lss, sizeof(linux_stack_t)); - if (error) - return (error); + if (uap->uss == 0) { + ss = NULL; + } else { + error = copyin(uap->uss, &lss, sizeof(linux_stack_t)); + if (error) + return (error); - ss = stackgap_alloc(&sg, sizeof(stack_t)); - ss->ss_sp = lss.ss_sp; - ss->ss_size = lss.ss_size; - ss->ss_flags = lss.ss_flags; + ss = stackgap_alloc(&sg, sizeof(stack_t)); + ss->ss_sp = lss.ss_sp; + ss->ss_size = (lss.ss_size >= LINUX_MINSIGSTKSZ && + lss.ss_size < MINSIGSTKSZ) ? MINSIGSTKSZ : lss.ss_size; + ss->ss_flags = lss.ss_flags; +#ifdef DEBUG + uprintf("Linux-emul(%ld): sigaltstack flags = 0x%x, sp = %p, oldsp = %p\n", + (long)p->p_pid, ss->ss_flags, lss.ss_sp, p->p_sigstk.ss_sp); +#endif + linux_to_bsd_sigaltstack(&lss.ss_flags, &ss->ss_flags); + } oss = (uap->uoss != NULL) ? stackgap_alloc(&sg, sizeof(stack_t)) : NULL; @@ -547,9 +557,31 @@ if (!error && oss != NULL) { lss.ss_sp = oss->ss_sp; lss.ss_size = oss->ss_size; - lss.ss_flags = oss->ss_flags; + linux_to_bsd_sigaltstack(&oss->ss_flags, &lss.ss_flags); error = copyout(&lss, uap->uoss, sizeof(linux_stack_t)); } return (error); +} + +void +linux_to_bsd_sigaltstack(int *lsa, int *bsa) +{ + *bsa = 0; + if (*lsa & LINUX_SS_DISABLE) + *bsa |= SS_DISABLE; + if (*lsa & LINUX_SS_DISABLE_BC) + *bsa |= SS_DISABLE; + if (*lsa & LINUX_SS_ONSTACK) + *bsa |= SS_ONSTACK; +} + +void +bsd_to_linux_sigaltstack(int *bsa, int *lsa) +{ + *lsa = 0; + if (*bsa & SS_DISABLE) + *lsa |= LINUX_SS_DISABLE; + if (*bsa & SS_ONSTACK) + *lsa |= LINUX_SS_ONSTACK; } --- sys/i386/linux/linux_sysent.c.orig Thu Sep 14 11:34:00 2000 +++ sys/i386/linux/linux_sysent.c Thu Sep 14 11:35:11 2000 @@ -190,7 +190,7 @@ { AS(setresgid_args), (sy_call_t *)setresgid }, /* 170 = setresgid */ { AS(linux_getresgid_args), (sy_call_t *)linux_getresgid }, /* 171 = linux_getresgid */ { 0, (sy_call_t *)linux_prctl }, /* 172 = linux_prctl */ - { 0, (sy_call_t *)linux_rt_sigreturn }, /* 173 = linux_rt_sigreturn */ + { AS(linux_rt_sigreturn_args), (sy_call_t *)linux_rt_sigreturn }, /* 173 = linux_rt_sigreturn */ { AS(linux_rt_sigaction_args), (sy_call_t *)linux_rt_sigaction }, /* 174 = linux_rt_sigaction */ { AS(linux_rt_sigprocmask_args), (sy_call_t *)linux_rt_sigprocmask }, /* 175 = linux_rt_sigprocmask */ { 0, (sy_call_t *)linux_rt_sigpending }, /* 176 = linux_rt_sigpending */ --- sys/i386/linux/linux_sysvec.c.orig Thu Sep 14 11:43:28 2000 +++ sys/i386/linux/linux_sysvec.c Thu Sep 14 12:19:38 2000 @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -190,6 +191,137 @@ } extern int _ucodesel, _udatasel; +extern unsigned long _linux_sznonrtsigcode; + + +static void +linux_rt_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) +{ + register struct proc *p = curproc; + register struct trapframe *regs; + struct linux_rt_sigframe *fp, frame; + struct sigacts *psp = p->p_sigacts; + int oonstack; + + regs = p->p_md.md_regs; + oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; + +#ifdef DEBUG + printf("Linux-emul(%ld): linux_rt_sendsig(%p, %d, %p, %lu)\n", + (long)p->p_pid, catcher, sig, (void*)mask, code); +#endif + /* + * Allocate space for the signal handler context. + */ + if ((p->p_flag & P_ALTSTACK) && !oonstack && + SIGISMEMBER(psp->ps_sigonstack, sig)) { + fp = (struct linux_rt_sigframe *)(p->p_sigstk.ss_sp + + p->p_sigstk.ss_size - sizeof(struct linux_rt_sigframe)); + p->p_sigstk.ss_flags |= SS_ONSTACK; + } else { + fp = (struct linux_rt_sigframe *)regs->tf_esp - 1; + } + + /* + * grow() will return FALSE if the fp will not fit inside the stack + * and the stack can not be grown. useracc will return FALSE + * if access is denied. + */ + if ((grow_stack (p, (int)fp) == FALSE) || + !useracc((caddr_t)fp, sizeof (struct linux_rt_sigframe), + VM_PROT_WRITE)) { + /* + * Process has trashed its stack; give it an illegal + * instruction to halt it in its tracks. + */ + SIGACTION(p, SIGILL) = SIG_DFL; + SIGDELSET(p->p_sigignore, SIGILL); + SIGDELSET(p->p_sigcatch, SIGILL); + SIGDELSET(p->p_sigmask, SIGILL); +#ifdef DEBUG + printf("Linux-emul(%ld): linux_rt_sendsig -- bad stack %p, SS_ONSTACK: 0x%x ", + (long)p->p_pid, fp, p->p_sigstk.ss_flags & SS_ONSTACK); +#endif + psignal(p, SIGILL); + return; + } + + /* + * Build the argument list for the signal handler. + */ + if (p->p_sysent->sv_sigtbl) + if (sig <= p->p_sysent->sv_sigsize) + sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; + + frame.sf_handler = catcher; + frame.sf_sig = sig; + + frame.sf_siginfo = &fp->sf_si; + frame.sf_ucontext = &fp->sf_sc; + /* Fill siginfo structure. */ + frame.sf_si.lsi_signo = sig; + frame.sf_si.lsi_code = code; + frame.sf_si.lsi_addr = (void *)regs->tf_err; + /* + * Build the signal context to be used by sigreturn. + */ + frame.sf_sc.uc_mcontext.sc_mask = mask->__bits[0]; + frame.sf_sc.uc_mcontext.sc_gs = rgs(); + frame.sf_sc.uc_mcontext.sc_fs = regs->tf_fs; + frame.sf_sc.uc_mcontext.sc_es = regs->tf_es; + frame.sf_sc.uc_mcontext.sc_ds = regs->tf_ds; + frame.sf_sc.uc_mcontext.sc_edi = regs->tf_edi; + frame.sf_sc.uc_mcontext.sc_esi = regs->tf_esi; + frame.sf_sc.uc_mcontext.sc_ebp = regs->tf_ebp; + frame.sf_sc.uc_mcontext.sc_ebx = regs->tf_ebx; + frame.sf_sc.uc_mcontext.sc_edx = regs->tf_edx; + frame.sf_sc.uc_mcontext.sc_ecx = regs->tf_ecx; + frame.sf_sc.uc_mcontext.sc_eax = regs->tf_eax; + frame.sf_sc.uc_mcontext.sc_eip = regs->tf_eip; + frame.sf_sc.uc_mcontext.sc_cs = regs->tf_cs; + frame.sf_sc.uc_mcontext.sc_eflags = regs->tf_eflags; + frame.sf_sc.uc_mcontext.sc_esp_at_signal = regs->tf_esp; + frame.sf_sc.uc_mcontext.sc_ss = regs->tf_ss; + frame.sf_sc.uc_mcontext.sc_err = regs->tf_err; + frame.sf_sc.uc_mcontext.sc_trapno = code; /* XXX ???? */ + + /* + * Build the remainder of the ucontext struct to be used by sigreturn. + */ + frame.sf_sc.uc_flags = 0; /* XXX ??? */ + frame.sf_sc.uc_link = NULL; /* XXX ??? */ + frame.sf_sc.uc_stack.ss_sp = p->p_sigstk.ss_sp; + bsd_to_linux_sigaltstack(&p->p_sigstk.ss_flags, &frame.sf_sc.uc_stack.ss_flags); + frame.sf_sc.uc_stack.ss_size = p->p_sigstk.ss_size; +#ifdef DEBUG + printf("Linux-emul(%ld): rt_sendsig flags: 0x%x, sp: %p, ss: 0x%x, mask: 0x%x\n", + (long)p->p_pid, frame.sf_sc.uc_stack.ss_flags, p->p_sigstk.ss_sp, + p->p_sigstk.ss_size, frame.sf_sc.uc_mcontext.sc_mask); +#endif + bsd_to_linux_sigset(&p->p_sigmask, &frame.sf_sc.uc_sigmask); + + if (copyout(&frame, fp, sizeof(frame)) != 0) { + /* + * Process has trashed its stack; give it an illegal + * instruction to halt it in its tracks. + */ + sigexit(p, SIGILL); + /* NOTREACHED */ + } + + /* + * Build context to run handler in. + */ + regs->tf_esp = (int)fp; + regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode) + _linux_sznonrtsigcode; + regs->tf_eflags &= ~PSL_VM; + regs->tf_cs = _ucodesel; + regs->tf_ds = _udatasel; + regs->tf_es = _udatasel; + regs->tf_fs = _udatasel; + load_gs(_udatasel); + regs->tf_ss = _udatasel; +} /* * Send an interrupt to process. @@ -215,9 +347,16 @@ oonstack = p->p_sigstk.ss_flags & SS_ONSTACK; #ifdef DEBUG - printf("Linux-emul(%ld): linux_sendsig(%p, %d, %p, %lu)\n", + printf("Linux-emul(%ld): linux_sendsig(%p, %d, %p, %lu)", (long)p->p_pid, catcher, sig, (void*)mask, code); #endif + + if (SIGISMEMBER(p->p_sigacts->ps_siginfo, sig)) { + /* Signal handler installed with SA_SIGINFO. */ + linux_rt_sendsig(catcher, sig, mask, code); + return; + } + /* * Allocate space for the signal handler context. */ @@ -397,6 +536,120 @@ return (EJUSTRETURN); } + +/* + * System call to cleanup state after a signal + * has been taken. Reset signal mask and + * stack state from context left by sendsig (above). + * Return to previous pc and psl as specified by + * context left by sendsig. Check carefully to + * make sure that the user has not modified the + * psl to gain improper privileges or to cause + * a machine fault. + */ +int +linux_rt_sigreturn(p, args) + struct proc *p; + struct linux_rt_sigreturn_args *args; +{ + struct sigaltstack_args sasargs; + struct linux_ucontext uc; + struct linux_sigcontext *context; + linux_stack_t *lss; + stack_t *ss; + register struct trapframe *regs; + int eflags; + caddr_t sg = stackgap_init(); + + regs = p->p_md.md_regs; + +#ifdef DEBUG + printf("Linux-emul(%ld): linux_rt_sigreturn(%p)\n", + (long)p->p_pid, (void *)args->ucp); +#endif + /* + * The trampoline code hands us the u_context. + * It is unsafe to keep track of it ourselves, in the event that a + * program jumps out of a signal handler. + */ + if (copyin((caddr_t)args->ucp, &uc, sizeof(uc)) != 0) + return (EFAULT); + + context = &uc.uc_mcontext; + + /* + * Check for security violations. + */ +#define EFLAGS_SECURE(ef, oef) ((((ef) ^ (oef)) & ~PSL_USERCHANGE) == 0) + eflags = context->sc_eflags; + /* + * XXX do allow users to change the privileged flag PSL_RF. The + * cpu sets PSL_RF in tf_eflags for faults. Debuggers should + * sometimes set it there too. tf_eflags is kept in the signal + * context during signal handling and there is no other place + * to remember it, so the PSL_RF bit may be corrupted by the + * signal handler without us knowing. Corruption of the PSL_RF + * bit at worst causes one more or one less debugger trap, so + * allowing it is fairly harmless. + */ + if (!EFLAGS_SECURE(eflags & ~PSL_RF, regs->tf_eflags & ~PSL_RF)) { + return(EINVAL); + } + + /* + * Don't allow users to load a valid privileged %cs. Let the + * hardware check for invalid selectors, excess privilege in + * other selectors, invalid %eip's and invalid %esp's. + */ +#define CS_SECURE(cs) (ISPL(cs) == SEL_UPL) + if (!CS_SECURE(context->sc_cs)) { + trapsignal(p, SIGBUS, T_PROTFLT); + return(EINVAL); + } + + p->p_sigstk.ss_flags &= ~SS_ONSTACK; + SIGSETOLD(p->p_sigmask, context->sc_mask); + SIG_CANTMASK(p->p_sigmask); + + /* + * Restore signal context-> + */ + /* %gs was restored by the trampoline. */ + regs->tf_fs = context->sc_fs; + regs->tf_es = context->sc_es; + regs->tf_ds = context->sc_ds; + regs->tf_edi = context->sc_edi; + regs->tf_esi = context->sc_esi; + regs->tf_ebp = context->sc_ebp; + regs->tf_ebx = context->sc_ebx; + regs->tf_edx = context->sc_edx; + regs->tf_ecx = context->sc_ecx; + regs->tf_eax = context->sc_eax; + regs->tf_eip = context->sc_eip; + regs->tf_cs = context->sc_cs; + regs->tf_eflags = eflags; + regs->tf_esp = context->sc_esp_at_signal; + regs->tf_ss = context->sc_ss; + + /* + * call sigaltstack & ignore results.. + */ + ss = stackgap_alloc(&sg, sizeof(stack_t)); + lss = &uc.uc_stack; + ss->ss_sp = lss->ss_sp; + ss->ss_size = (lss->ss_size >= LINUX_MINSIGSTKSZ && + lss->ss_size < MINSIGSTKSZ) ? MINSIGSTKSZ : lss->ss_size; + linux_to_bsd_sigaltstack(&lss->ss_flags, &ss->ss_flags); +#ifdef DEBUG + printf("Linux-emul(%ld): rt_sigret flags: 0x%x, sp: %p, ss: 0x%x, mask: 0x%x\n", + (long)p->p_pid, ss->ss_flags, ss->ss_sp, ss->ss_size, context->sc_mask); +#endif + sasargs.ss = ss; + sasargs.oss = NULL; + (void) sigaltstack(p, &sasargs); + + return (EJUSTRETURN); +} static void linux_prepsyscall(struct trapframe *tf, int *args, u_int *code, caddr_t *params) { --- sys/i386/linux/syscalls.master.orig Thu Sep 14 12:20:10 2000 +++ sys/i386/linux/syscalls.master Thu Sep 14 12:20:30 2000 @@ -253,7 +253,7 @@ 171 STD LINUX { int linux_getresgid(linux_gid_t *rgid, \ linux_gid_t *egid, linux_gid_t *sgid); } 172 STD LINUX { int linux_prctl(void); } -173 STD LINUX { int linux_rt_sigreturn(void); } +173 STD LINUX { int linux_rt_sigreturn(struct linux_ucontext *ucp); } 174 STD LINUX { int linux_rt_sigaction(int sig, \ linux_sigaction_t *act, \ linux_sigaction_t *oact, \ --- sys/sys/signal.h.orig Tue Sep 12 10:29:38 2000 +++ sys/sys/signal.h Thu Sep 14 15:22:56 2000 @@ -238,7 +238,7 @@ #define SS_ONSTACK 0x0001 /* take signal on alternate stack */ #define SS_DISABLE 0x0004 /* disable taking signals on alternate stack */ -#define MINSIGSTKSZ 8192 /* minimum allowable stack */ +#define MINSIGSTKSZ 2048 /* minimum allowable stack */ #define SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended stack size */ /* Have enough typedefs for this now. XXX */ --o0ZfoUVt4BxPQnbU-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Thu Sep 14 20:45:15 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from guru.mired.org (zoom1-061.telepath.com [216.14.1.61]) by hub.freebsd.org (Postfix) with SMTP id D6D0937B422 for ; Thu, 14 Sep 2000 20:44:55 -0700 (PDT) Received: (qmail 83344 invoked by uid 100); 15 Sep 2000 03:44:26 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14785.39705.978444.886404@guru.mired.org> Date: Thu, 14 Sep 2000 22:44:25 -0500 (CDT) To: freebsd-emulation@freebsd.org Subject: shared libraries and -current? X-Mailer: VM 6.72 under 21.1 (patch 10) "Capitol Reef" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org I've just run into a second Linux application failing for similar reasons on -current (PRE_SMPNG). Both of them exit, leaving a core file. Invoking gdb on that program/core for both of them leads to an exit message of some kind, along with a message about not being able to find a shared library. Is the latter an artifact of gdb not being a linux binary, or is it an indication that something is wrong in the executable? Thanx, MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Fri, 15 Sep 2000 14:34:29 -0400 (EDT) To: Gerald Pfeifer Cc: freebsd-emulation@freebsd.org, freebsd-java@freebsd.org Subject: Re: IBM JDK 1.3 now working (pointer to patches) In-Reply-To: References: <14783.55339.269170.481033@grasshopper.cs.duke.edu> X-Mailer: VM 6.43 under 20.4 "Emerald" XEmacs Lucid Message-ID: <14786.27119.307209.768848@grasshopper.cs.duke.edu> Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org As promised, here's a new diff for 4.0-release: http://www.cs.duke.edu/~gallatin/linux_sa_siginfo/4.0-release.diff And a new diff to the pre-smpng -current: http://www.cs.duke.edu/~gallatin/linux_sa_siginfo/diff As for -stable -- Sean O'Connell took care of that yesterday. The 4.0-release diff should (almost) apply to -stable. I don't have an up-to-date -stable tree laying around & I don't have time to make -stable diff right now. I obtained this diff by applying the patches that Sean O'Connell posted yesterday (thanks Sean) and cleaning up 2 rejects. Both have a change in that rather than hitting the thread stack problem over the head by changing the map flag to MAP_ANON from MAP_STACK, I'm now detecting the allocation of a thread stack in the region typically reserved for the main process stack and adjusting vm_maxsaddr to reflect the current stacksize resource limit. Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Fri Sep 15 15:16: 0 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from guardian.sftw.com (guardian.sftw.com [209.157.37.25]) by hub.freebsd.org (Postfix) with ESMTP id BCA2237B424; Fri, 15 Sep 2000 15:15:58 -0700 (PDT) Received: from yoda.sftw.com (yoda.sftw.com [209.157.37.211]) by guardian.sftw.com (8.9.3/8.9.3) with ESMTP id PAA69611; Fri, 15 Sep 2000 15:15:58 -0700 (PDT) (envelope-from nsayer@sftw.com) Received: from sftw.com (localhost [127.0.0.1]) by yoda.sftw.com (8.11.0/8.11.0) with ESMTP id e8FMFvJ06560; Fri, 15 Sep 2000 15:15:58 -0700 (PDT) (envelope-from nsayer@sftw.com) Message-ID: <39C29F98.F3A0FF53@sftw.com> Date: Fri, 15 Sep 2000 15:15:52 -0700 From: Nick Sayer Reply-To: nsayer@kfu.com X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-emulation@freebsd.org Cc: archie@freebsd.org Subject: vmnet, bridging and netgraph Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Holy crap! It works! For those of you who have an up-to-date install, you can hose out all of the bridge stuff in your vmware.sh file and just change the exec line at the bottom of /usr/local/bin/vmware into this: ETHER= your ethernet interface (e.g. xl0) ngctl mkpeer vmnet1: bridge lower link0 ngctl name vmnet1:lower vmnet_bridge ngctl connect vmnet_bridge: ${ETHER}: link1 lower ngctl connect vmnet_bridge: ${ETHER}: link1 upper /usr/local/lib/vmware/bin/vmware "$@" ngctl shutdown vmnet_bridge: No more having to change the kernel, no more worries about having the bridge turned on when vmware isn't running. It's all gravy. Note that this will probably NOT work if your primary Ethernet interface is a wi0 card. That's because those cards can't transmit Ethernet frames with source addresses different than their own. Sorry. Blame Lucent. They don't want you to avoid buying an access point to do wireless-to-LAN bridges. THREE CHEERS FOR ARCHIE!!!! HUZZAH! HUZZAH! HUZZAH! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Fri Sep 15 16:47:17 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from guardian.sftw.com (guardian.sftw.com [209.157.37.25]) by hub.freebsd.org (Postfix) with ESMTP id 6F13537B423; Fri, 15 Sep 2000 16:47:14 -0700 (PDT) Received: from yoda.sftw.com (yoda.sftw.com [209.157.37.211]) by guardian.sftw.com (8.9.3/8.9.3) with ESMTP id QAA71050; Fri, 15 Sep 2000 16:47:14 -0700 (PDT) (envelope-from nsayer@sftw.com) Received: from sftw.com (localhost [127.0.0.1]) by yoda.sftw.com (8.11.0/8.11.0) with ESMTP id e8FNlDp06874; Fri, 15 Sep 2000 16:47:13 -0700 (PDT) (envelope-from nsayer@sftw.com) Message-ID: <39C2B501.58EC338E@sftw.com> Date: Fri, 15 Sep 2000 16:47:13 -0700 From: Nick Sayer Reply-To: nsayer@kfu.com X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-emulation@freebsd.org Cc: archie@freebsd.org Subject: Re: vmnet, bridging and netgraph References: <39C29F98.F3A0FF53@sftw.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Nick Sayer wrote: > > Holy crap! It works! Not quite. I was a bit overenthusiastic. There are a couple issues: 1. You pretty much have to do the ngctl steps in the vmware.sh file at startup, because they have to run as root. Adding an suid binary to do this stuff at run time would be a little overkill, IMHO. 2. The kernel spits out lots of these: arp: 209.157.37.4 is on xl0 but got reply from 00:bd:5a:e6:4d:91 on vmnet1 This is because ARP checks the source of the packet and sees the wrong interface. When ng_bridge is sending packets to an upper hook, it should make the packet look like it was received on the interface belonging to the upper hook in question. Either that or the arp code has not yet been sufficiently disconnected from the interfaces to let the upper and lower hooks work the way ng_bridge wants them to. Archie? :-) 3. The promisc flag on vmnet1 does not seem to persist. Given how it works, this may not matter. 4. I forgot the need to sent setpromisc 1 and setautosrc 0 messages when setting this whole thing up. 5. I don't yet have a correct list of modules to load in vmware.sh to make this work. I have tried loading just netgraph.ko, but this fails the _first_ time I do all of the hookups, but not the second. Archie? :-) 6. There is a long standing bug in tap(?) that for some bizarre reason keeps my win2k guest from being able to do DHCP. The DHCP server sends its reply to 255.255.255.255, and somehow tap never gets it. I'm not sure why not. Real win2k machines have no problem DHCPing from this server. 7. Those of you using ed interfaces may notice that there is a couple #ifdef BRIDGE sections in the driver. Not sure what for. > > For those of you who have an up-to-date install, you can hose out all of > the bridge stuff in your vmware.sh file and just change the exec line at > the bottom of /usr/local/bin/vmware into this: > > ETHER= your ethernet interface (e.g. xl0) > > ngctl mkpeer vmnet1: bridge lower link0 > ngctl name vmnet1:lower vmnet_bridge > ngctl connect vmnet_bridge: ${ETHER}: link1 lower > ngctl connect vmnet_bridge: ${ETHER}: link1 upper > > /usr/local/lib/vmware/bin/vmware "$@" > > ngctl shutdown vmnet_bridge: > > No more having to change the kernel, no more worries about having the > bridge turned on when vmware isn't running. It's all gravy. > > Note that this will probably NOT work if your primary Ethernet interface > is a wi0 card. That's because those cards can't transmit Ethernet frames > with source addresses different than their own. Sorry. Blame Lucent. > They don't want you to avoid buying an access point to do > wireless-to-LAN bridges. > > THREE CHEERS FOR ARCHIE!!!! HUZZAH! HUZZAH! HUZZAH! > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-emulation" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message From owner-freebsd-emulation Fri Sep 15 17:19: 2 2000 Delivered-To: freebsd-emulation@freebsd.org Received: from whistle.com (s205m131.whistle.com [207.76.205.131]) by hub.freebsd.org (Postfix) with ESMTP id 97C7E37B422 for ; Fri, 15 Sep 2000 17:18:56 -0700 (PDT) Received: (from smap@localhost) by whistle.com (8.10.0/8.10.0) id e8G0Io507024; Fri, 15 Sep 2000 17:18:50 -0700 (PDT) Received: from bubba.whistle.com( 207.76.205.7) by whistle.com via smap (V2.0) id xma007020; Fri, 15 Sep 2000 17:18:48 -0700 Received: (from archie@localhost) by bubba.whistle.com (8.9.3/8.9.3) id RAA81024; Fri, 15 Sep 2000 17:18:48 -0700 (PDT) (envelope-from archie) From: Archie Cobbs Message-Id: <200009160018.RAA81024@bubba.whistle.com> Subject: Re: vmnet, bridging and netgraph In-Reply-To: <39C2B501.58EC338E@sftw.com> "from Nick Sayer at Sep 15, 2000 04:47:13 pm" To: nsayer@kfu.com Date: Fri, 15 Sep 2000 17:18:48 -0700 (PDT) Cc: freebsd-emulation@freebsd.org X-Mailer: ELM [version 2.4ME+ PL82 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Sender: owner-freebsd-emulation@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Nick Sayer writes: > 2. The kernel spits out lots of these: > > arp: 209.157.37.4 is on xl0 but got reply from 00:bd:5a:e6:4d:91 on > vmnet1 > > This is because ARP checks the source of the packet and sees the wrong > interface. When ng_bridge is sending packets to an upper hook, it should > make the packet look like it was received on the interface belonging to > the upper hook in question. Either that or the arp code has not yet been > sufficiently disconnected from the interfaces to let the upper and lower > hooks work the way ng_bridge wants them to. Archie? :-) The ng_bridge(4) node treats all links as the same, whether they are pointing "up" or "down", so it wouldn't know how to do that. I guess it could contain logic to probe each peer to see if it's an ng_ether node, and if so, remember it. That's probably worth looking in to.. > 4. I forgot the need to sent setpromisc 1 and setautosrc 0 messages when > setting this whole thing up. Yep.. > 5. I don't yet have a correct list of modules to load in vmware.sh to > make this work. I have tried loading just netgraph.ko, but this fails > the _first_ time I do all of the hookups, but not the second. Archie? > :-) You'd need ng_ether.ko and ng_bridge.ko, both of which depend on netgraph.ko... ? > 7. Those of you using ed interfaces may notice that there is a couple > #ifdef BRIDGE sections in the driver. Not sure what for. This is an optimization that I left in because Luigi asked for it. It avoids doing painfully slow PIO reads of packets that are going to be thrown away anyway. FYI, I've written a little script for /usr/share/examples that sets up bridging using netgraph. This is completely untested, so any feedback is appreciated. -Archie ___________________________________________________________________________ Archie Cobbs * Whistle Communications, Inc. * http://www.whistle.com #!/bin/sh # $FreeBSD$ # This script sets up an Ethernet bridging network across multiple # Ethernet interfaces using the ng_bridge(4) and ng_ether(4) netgraph # node types. # # To use this script: # # 0. Make your own copy of this example script # # 1. Give your bridging network a name by editing the definition of # ${BRIDGE_NAME} below. It must be a valid netgraph node name. # # 2. Edit the definitions of ${BRIDGE_IFACES} and ${LOCAL_IFACE} # as described below to define your bridging interfaces. # # 3. Run this script with "start" as the command line argument. # # 4. Examine bridging statistics by running this script with "stats" # as the command line argument. # # 5. Stop bridging by running this script with "stop" as the # command line argument. # # To run multiple independent bridging networks, create multiple # copies of this script with different variable definitions. # # Give each bridging network a unique name here BRIDGE_NAME="bnet0" # List the names of the interfaces that you want to bridge across # here in ${BRIDGE_IFACES}. If you want to include the local host # machine as well then set ${LOCAL_IFACE} as well (it may also be # listed in ${BRIDGE_IFACES}). Of course, any ${LOCAL_IFACE} must # be ifconfig(8)ured separately. If you don't want a ${LOCAL_IFACE} # then leave it defined as the emtpy string. BRIDGE_IFACES="ed0 fxp0 fxp1" LOCAL_IFACE="fxp0" #################################################################### #### Everything below this point should not need to be modified #### #################################################################### # Routine to verify node's existence bridge_verify() { ngctl info ${BRIDGE_NAME}: >/dev/null 2>&1 if [ $? -ne 0 ]; then echo "${BRIDGE_NAME}: bridge network not found" exit 1 fi } # Routine to get and display link stats bridge_linkstats() { STATS=`ngctl msg ${BRIDGE_NAME}: getstats $1` if [ $? -ne 0 ]; then exit 1 fi echo "${STATS}" | fmt 2 | awk '/=/ { fl=index($0, "="); \ printf "%20s = %s\n", substr($0, 0, fl - 1), substr($0, fl + 1); }' } # Start/restart routine bridge_start() { # Load netgraph KLD's as necessary for KLD in ng_ether ng_bridge; do if kldstat -v | grep -qw ${KLD}; then else echo -n "Loading ${KLD}.ko... " kldload ${KLD} || exit 1 echo "done" fi done # Reset all interfaces bridge_stop # Verify all interfaces exist for ETHER in ${BRIDGE_IFACES} ${LOCAL_IFACE}; do if ngctl info ${ETHER}: >/dev/null 2>&1; then else echo "Error: interface ${ETHER} does not exist" exit 1 fi ifconfig ${ETHER} up || exit 1 done # Create new ng_bridge(4) node, attached to the first interface FIRSTIF=`echo ${BRIDGE_IFACES} | awk '{ print $1 }'` ngctl mkpeer ${FIRSTIF}: bridge lower link0 || exit 1 ngctl name ${FIRSTIF}:lower ${BRIDGE_NAME} || exit 1 # Attach other interfaces as well LINKNUM=0 for ETHER in ${BRIDGE_IFACES}; do if [ ${LINKNUM} != 0 ]; then ngctl connect ${ETHER}: ${BRIDGE_NAME}: \ lower link${LINKNUM} || exit 1 fi LINKNUM=`expr ${LINKNUM} + 1` done # Hook up local interface, if any if [ "${LOCAL_IFACE}" != "" ]; then ngctl connect ${LOCAL_IFACE}: ${BRIDGE_NAME}: \ upper link${LINKNUM} || exit 1 fi # Set all interfaces in promiscuous mode and don't overwrite src addr for ETHER in ${BRIDGE_IFACES}; do ngctl msg ${ETHER}: setpromisc 1 || exit 1 ngctl msg ${ETHER}: setautosrc 0 || exit 1 done } # Stop routine bridge_stop() { ngctl kill ${BRIDGE_NAME}: >/dev/null 2>&1 for ETHER in ${BRIDGE_IFACES} ${LOCAL_IFACE}; do ngctl kill ${ETHER}: >/dev/null 2>&1 done } # Stats routine bridge_stats() { # Make sure node exists bridge_verify echo "" echo "Statistics for bridging network ${BRIDGE_NAME}:" echo "" LINKNUM=0 for ETHER in ${BRIDGE_IFACES}; do echo "Network interface ${ETHER}:" bridge_linkstats ${LINKNUM} LINKNUM=`expr ${LINKNUM} + 1` done if [ "${LOCAL_IFACE}" != "" ]; then echo "Local host interface ${ETHER}:" bridge_linkstats ${LINKNUM} fi } # Main entry point case $1 in start) bridge_start ;; stats) bridge_verify bridge_stats ;; stop) bridge_verify bridge_stop ;; *) echo "Usage: ether.bridge [ start | stop | stats ]" exit 1 esac To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-emulation" in the body of the message