From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 23 18:38:00 2009 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2041E106566B for ; Wed, 23 Sep 2009 18:38:00 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id E36798FC17 for ; Wed, 23 Sep 2009 18:37:59 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 758A446B09; Wed, 23 Sep 2009 14:37:59 -0400 (EDT) Received: from jhbbsd.hudson-trading.com (unknown [209.249.190.8]) by bigwig.baldwin.cx (Postfix) with ESMTPA id BA0C48A01B; Wed, 23 Sep 2009 14:37:58 -0400 (EDT) From: John Baldwin To: Julian Elischer Date: Wed, 23 Sep 2009 14:36:28 -0400 User-Agent: KMail/1.9.7 References: <200909231554.n8NFsYwT078965@fire.js.berklix.net> <200909231209.08346.jhb@freebsd.org> <4ABA5937.9000406@elischer.org> In-Reply-To: <4ABA5937.9000406@elischer.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909231436.29466.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Wed, 23 Sep 2009 14:37:58 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=4.2 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Rui Paulo , Alexey Shuvaev , "Julian H. Stacey" , hackers@freebsd.org, Nate Eldredge Subject: Re: genuine cpu I386_CPU kernel support X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2009 18:38:00 -0000 On Wednesday 23 September 2009 1:21:59 pm Julian Elischer wrote: > John Baldwin wrote: > > On Wednesday 23 September 2009 11:54:34 am Julian H. Stacey wrote: > >> Rui Paulo wrote: > >>> On 22 Sep 2009, at 19:03, Nate Eldredge wrote: > >>> > >>>> On Tue, 22 Sep 2009, John Baldwin wrote: > >>>> > >>>>> My comment is to just use 4.x (seriously). A true 386 is going to > >>>>> be quite > >>>>> slow and the overhead of many things added that work well on newer > >>>>> processors > >>>>> is going to be very painful on a 386 (probably on a 486 as well). > >>>>> 4.x runs > >>>>> fine on a 386 and should support all the hardware you can stick > >>>>> into a > >>>>> machine with an 80386 CPU. > >>>> Unless, of course, you plan to put it on a network. I doubt that > >>>> 4.x is up to date with respect to security patches. > >>> I don't know if they were all applied on 4.x, but I think at least the > >>> older ones are. > >> 4.11 fell out of security support some while back, but > >> http://www.freebsd.org/security/index.html > >> only lists what's still in, not what fell out when. > >> > >> Free/ Net/ Open/ Dragon etc all derive from Bill Jollitz port of > >> BSD to 386. Would be nice if we could still keep that first platform > >> walking, even if speed can't be called running ;-) > >> > >> Maybe I'll get time to chase down all that came before > >> http://svn.freebsd.org/viewvc/base?view=revision&revision=137784 > > > > Other things added since then assume at least a 486. Not having cmpxchg is a > > bit of a killer. > > I think a 386 can assume non-SMP in which case that can be simulated > just fine :-) > it also simplifies a lot of the other breakages.. > > #if (CPU == 80386) && defined(SMP) > #error "can't have smp on a 386" > #endif No, it actually does not. The in-kernel version of cmpset for 386 was to disable interrupts while doing a cmp and jmp around a mov (even 386's have preemption, so you do have to disable interrupts). You can't do that in userland (cli is a privileged instruction), which probably mandates doing a cmpxchg emulator in the kernel for userland code. That and disabling interrupts is actually far less efficient than spl() for a UP 80386 machine. I suspect newer kernels will run slower on an 80386 than 4.x. -- John Baldwin