From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 10 13:35:02 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3F9DE37B401 for ; Thu, 10 Apr 2003 13:35:02 -0700 (PDT) Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by mx1.FreeBSD.org (Postfix) with ESMTP id 86B9143F3F for ; Thu, 10 Apr 2003 13:35:01 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 27626 invoked from network); 10 Apr 2003 20:35:08 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender )encrypted SMTP for ; 10 Apr 2003 20:35:08 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.8/8.12.8) with ESMTP id h3AKYwOv053537; Thu, 10 Apr 2003 16:34:58 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.4 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20030410193810.GA52024@falcon.midgard.homeip.net> Date: Thu, 10 Apr 2003 16:34:58 -0400 (EDT) From: John Baldwin To: Erik Trulsson cc: Michael Elbel cc: Julian Stacey cc: freebsd-hackers@freebsd.org Subject: Re: Anyone seen 4.8-RELEASE running on a real 386 (not 486 586 etc) ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Apr 2003 20:35:02 -0000 On 10-Apr-2003 Erik Trulsson wrote: > On Thu, Apr 10, 2003 at 08:43:04PM +0200, Julian Stacey wrote: >> freebsd-hackers@, >> Anyone seen 4.8-RELEASE running on a real 386 processor (not a 486, 586 etc) ? >> >> I have a 386 that runs 4.7, dmesg below, both GENERIC & my own kernel; >> But it wont boot 4.8 { either generic or my own config } compiled on my >> other 4.8 box. I tried making with & without /etc/make.conf >> CFLAGS = -m386 -march=i386 -msoft-float -mcpu=i386 -O -pipe >> COPTFLAGS= -m386 -march=i386 -msoft-float -mcpu=i386 -O -pipe >> I tried the /kernel copied from a 4.8 cdrom to hard disk (no cdrom >> drive on the box). I tried 4.8 boot floppies (to prove its not >> something wrong in hard disc /boot) Every 4.8 kernel crashes during boot -s. >> >> This 386 box is no bigger than a book, so worth persevering :-) >> "SX 33" is written on chip, though dmesg reports "DX". >> >> I recall 386 support was dropped in 5.0, but presume not dropped in 4.8, >> ( I don't see any signs in /usr/share/mk comparing 4.7 & 4.8 ) >> The 4.8 cdrom /[A-Z]* files say i386 is still supported. >> >> I removed the only card in the box (a 3com ISA ethernet jumperless) - >> it still wouldnt boot, so put ethernet card back in, as not the problem. >> >> I compiled a kernel with ddb, Results copied by hand as no serial for >> remote gdb.t present >> >> Ideas or solutions anyone ? >> >> 4.8 ddb: >> Fatal trap 1: priveleged instruction fault while in kernel mode >> instruction pointer = 0x8:0xc02695a0 >> stack pointewr = 0x10:0xc0379fcc >> frame pointer = 0x10:0xc0379fcc >> code segment = base 0x0, limit 0xfffff, type 0x1b >> = DPL 0, pres 1, def 32 1, gran 1 >> processor eflags = interrupt enabled, resume, IOPL = 0 >> current process = Idle >> interrupt mask = net tty bio cam >> kernel: type 1 trap, code=0 >> stopped at 0xc02695a0: invlpg 0(%ecx) > > Try the following patch. > Makes my 386sx/33 work fine at least. > (Without it I get the same panic as you do.) Oh my, I hope that isn't it. If so it's my fault. :( Hmm, can you try this patch instead? http://www.FreeBSD.org/~jhb/patches/4x_386.patch Index: identcpu.c =================================================================== RCS file: /usr/cvs/src/sys/i386/i386/identcpu.c,v retrieving revision 1.80.2.14 diff -u -r1.80.2.14 identcpu.c --- identcpu.c 22 Jan 2003 20:14:52 -0000 1.80.2.14 +++ identcpu.c 10 Apr 2003 20:30:56 -0000 @@ -64,6 +64,7 @@ /* XXX - should be in header file: */ void printcpuinfo(void); void finishidentcpu(void); +void earlysetcpuclass(void); #if defined(I586_CPU) && defined(CPU_WT_ALLOC) void enable_K5_wt_alloc(void); void enable_K6_wt_alloc(void); @@ -942,6 +943,21 @@ return; } } +} + +/* + * This routine is called specifically to set up cpu_class before + * startrtclock() uses it. Probably this should be rearranged so that + * startrtclock() doesn't need to run until after identifycpu() has been + * called. Another alternative formulation would be for this routine + * to do all the identification work, and make identifycpu() into a + * printing-only routine. + */ +void +earlysetcpuclass(void) +{ + + cpu_class = i386_cpus[cpu].cpu_class; } static void Index: machdep.c =================================================================== RCS file: /usr/cvs/src/sys/i386/i386/machdep.c,v retrieving revision 1.385.2.29 diff -u -r1.385.2.29 machdep.c --- machdep.c 4 Apr 2003 22:21:29 -0000 1.385.2.29 +++ machdep.c 10 Apr 2003 20:30:53 -0000 @@ -122,6 +122,7 @@ extern void dblfault_handler __P((void)); extern void printcpuinfo(void); /* XXX header file */ +extern void earlysetcpuclass(void); /* same header file */ extern void finishidentcpu(void); extern void panicifcpuunsupported(void); extern void initializecpu(void); @@ -265,6 +266,7 @@ * Good {morning,afternoon,evening,night}. */ printf("%s", version); + earlysetcpuclass(); startrtclock(); printcpuinfo(); panicifcpuunsupported(); -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/