Date: Sat, 12 Jul 2003 07:37:25 +1000 (EST) From: Bruce Evans <bde@zeta.org.au> To: Don Lewis <truckman@freebsd.org> Cc: l.ertl@univie.ac.at Subject: Re: Kernel built with new GCC panics immediately Message-ID: <20030712065656.C31200@gamplex.bde.org> In-Reply-To: <200307111844.h6BIicM7018465@gw.catspoiler.org> References: <200307111844.h6BIicM7018465@gw.catspoiler.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 11 Jul 2003, Don Lewis wrote:
> On 11 Jul, Shizuka Kudo wrote:
> >
> > --- Lukas Ertl <l.ertl@univie.ac.at> wrote:
> >> Hi there,
> >>
> >> just wanted to report that a kernel built with the new gcc panics
> >> immediately when booting. I've seen this on two machines. Panic and reboot
> >> happens fast that I couldn't get the panic message.
> >
> > Same here for an AMD Athlon & a Pentium III. The panic message for AMD is:
> >
[Trailing whitespace removed]
> > Copyright (c) 1992-2003 The FreeBSD Project.
> > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
> > The Regents of the University of California. All rights reserved.
> > FreeBSD 5.1-CURRENT #20030712: Sat Jul 12 01:35:44 HKT 2003
> > root@shizuka.gundumv.com:/usr/obj/usr/src/sys/SHIZUKA
> > Preloaded elf kernel "/boot/kernel/kernel" at 0xc058a000.
> > Preloaded elf module "/boot/kernel/acpi.ko" at 0xc058a1f4.
> > Timecounter "i8254" frequency 1193182 Hz
> > CPU: AMD Unknown (286-class CPU)
> ^^^
> That's quite a downgrade ;-)
>
> This smells like a problem in either printcpuinfo(), lowcore.s, or the
> interface between them.
>
> > Origin = "AuthenticAMD" Stepping = 0
> > panic: CPU class not configured
> > Debugger("panic")
Try compiling with cc -no-zero-initialized-in-bss.
gcc now puts zero-initialized variables in the bss by default, so an old
bug in locore.s probably just became fatal. From locore.s:
% call identify_cpu
This sets some variables (in particular, `cpu') which are now mostly in
the bss.
%
% /* clear bss */
% /*
% * XXX this should be done a little earlier.
% *
% * XXX we don't check that there is memory for our bss and page tables
% * before using it.
% *
% * XXX the boot program somewhat bogusly clears the bss. We still have
% * to do it in case we were unzipped by kzipboot. Then the boot program
% * only clears kzipboot's bss.
% *
% * XXX the gdt and idt are still somewhere in the boot program. We
% * depend on the convention that the boot program is below 1MB and we
% * are above 1MB to keep the gdt and idt away from the bss and page
% * tables.
% */
% movl $R(end),%ecx
% movl $R(edata),%edi
% subl %edi,%ecx
% xorl %eax,%eax
% cld
% rep
% stosb
This clobbers any bss variables set by identify_cpu.
Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030712065656.C31200>
