Now not necessary for 4.9 as its in src/ already This below from "Erik Trulsson" Fixes my crash on boot problem on the 386 cpu, 4.8-RELEASE mini.berklix, Fails to apply on 4.9 # > RCS file: /ncvs/src/sys/i386/i386/identcpu.c,v # > retrieving revision 1.80.2.14 # > diff -u -r1.80.2.14 identcpu.c # > --- sys/i386/i386/identcpu.c 22 Jan 2003 20:14:52 -0000 # > 1.80.2.14 # > +++ sys/i386/i386/identcpu.c 13 Mar 2003 14:55:52 -0000 # > @@ -80,7 +80,7 @@ # > static void print_transmeta_info(void); # > static void setup_tmx86_longrun(void); # > -int cpu_class; # > +int cpu_class=CPUCLASS_386; # > u_int cpu_exthigh; /* Highest arg to extended CPUID */ # > u_int cyrix_did; /* Device ID of Cyrix CPU */ # > char machine[] = "i386"; *** 4.8-RELEASE/src/sys/i386/i386/identcpu.c Thu Jul 24 16:08:45 2003 --- new_generic/src/sys/i386/i386/identcpu.c Thu Jul 24 16:15:15 2003 *************** *** 80,86 **** static void print_transmeta_info(void); static void setup_tmx86_longrun(void); ! int cpu_class; u_int cpu_exthigh; /* Highest arg to extended CPUID */ u_int cyrix_did; /* Device ID of Cyrix CPU */ char machine[] = "i386"; --- 80,93 ---- static void print_transmeta_info(void); static void setup_tmx86_longrun(void); ! /* int cpu_class; */ ! int cpu_class=CPUCLASS_386; /* Initialise to =CPUCLASS_386 to fix the ! 4.8-RELEASE crash on boot problem of 386 ! cpu of host=mini owner jhs @ berklix.com ! Fix originates from ! "Erik Trulsson" ! */ ! u_int cpu_exthigh; /* Highest arg to extended CPUID */ u_int cyrix_did; /* Device ID of Cyrix CPU */ char machine[] = "i386"; This below from John Baldwin does not fix my crash on boot problem on the 386, so it is all commented out. # *** 4.8-RELEASE/src/sys/i386/i386/identcpu.c.orig Thu Apr 10 23:20:58 2003 # --- generic/src/sys/i386/i386/identcpu.c Fri Apr 11 00:18:08 2003 # *************** # *** 64,69 **** # --- 64,70 ---- # /* 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,947 **** # --- 943,962 ---- # 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 # *** 4.8-RELEASE/src/sys/i386/i386/machdep.c.orig Wed Jan 22 21:14:52 2003 # --- generic/src/sys/i386/i386/machdep.c Fri Apr 11 00:22:02 2003 # *************** # *** 120,125 **** # --- 120,126 ---- # 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); # *************** # *** 259,264 **** # --- 260,266 ---- # * Good {morning,afternoon,evening,night}. # */ # printf("%s", version); # + earlysetcpuclass(); # startrtclock(); # printcpuinfo(); # panicifcpuunsupported(); # # ========================================= # Patches above are against 4.8-REL after these errors: # # From jhb @ FreeBSD.org Thu Apr 10 22:45:05 2003 # Return-Path: # Received: from jhs.muc.de (park [192.168.91.31]) # by flip (8.11.6/8.11.6) with ESMTP id h3AKj4D66399 # for ; Thu, 10 Apr 2003 22:45:04 +0200 (CEST) # (envelope-from jhb @ FreeBSD.org) # Received: from localhost (localhost [127.0.0.1]) # by jhs.muc.de (8.11.6/8.11.6) with ESMTP id h3AKj4v69188 # for ; Thu, 10 Apr 2003 22:45:04 +0200 (CEST) # (envelope-from jhb @ FreeBSD.org) # Received: from *.berklix.com [194.221.32.28] # by localhost with POP3 (fetchmail-5.9.6) # for jhs @ localhost (single-drop); Thu, 10 Apr 2003 22:45:04 +0200 (CEST) # Received: from mail.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) # # for ; Thu, 10 Apr 2003 22:35:12 +0200 (MET DST) # (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 ) # by mail12.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA 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 # Subject: Re: Anyone seen 4.8-RELEASE running on a real 386 (not 486 586 etc) ? # Cc: Michael Elbel , freebsd-hackers @ FreeBSD.org, # Julian H. Stacey # # # On 10-Apr-2003 Erik Trulsson wrote: # > On Thu, Apr 10, 2003 at 08:43:04PM +0200, Julian H. 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/ # # # |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 # -------------------------- # Patching file identcpu.c using Plan A... # Hunk #1 succeeded at 64 with fuzz 2. # Hunk #2 failed at 943. # 1 out of 2 hunks failed--saving rejects to identcpu.c.rej # Hmm... The next patch looks like a unified diff to me... # The text leading up to this was: # -------------------------- # |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 # -------------------------- # Patching file machdep.c using Plan A... # Hunk #1 failed at 122. # Hunk #2 failed at 266. # 2 out of 2 hunks failed--saving rejects to machdep.c.rej # Hmm... Ignoring the trailing garbage. # done #