From owner-freebsd-current@FreeBSD.ORG Wed Apr 5 11:05:59 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9B87416A400 for ; Wed, 5 Apr 2006 11:05:59 +0000 (UTC) (envelope-from ganbold@micom.mng.net) Received: from publicd.ub.mng.net (publicd.ub.mng.net [202.179.0.88]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D26E43D45 for ; Wed, 5 Apr 2006 11:05:58 +0000 (GMT) (envelope-from ganbold@micom.mng.net) Received: from [202.179.0.164] (helo=[192.168.0.18]) by publicd.ub.mng.net with esmtpa (Exim 4.60 (FreeBSD)) (envelope-from ) id 1FR5vL-000Nnm-1R; Wed, 05 Apr 2006 20:11:43 +0900 Message-ID: <4433A4A0.5060300@micom.mng.net> Date: Wed, 05 Apr 2006 20:06:08 +0900 From: Ganbold User-Agent: Thunderbird 1.5 (X11/20060202) MIME-Version: 1.0 To: Peter Jeremy References: <4431D4E5.3080507@micom.mng.net> <20060404090837.GC683@turion.vk2pj.dyndns.org> <44323B37.4040605@micom.mng.net> <20060404101223.GH683@turion.vk2pj.dyndns.org> <44336331.40909@micom.mng.net> <20060405075841.GB699@turion.vk2pj.dyndns.org> <443381F9.3010504@micom.mng.net> <20060405090326.GD699@turion.vk2pj.dyndns.org> <44338D08.3070000@micom.mng.net> <20060405102528.GE699@turion.vk2pj.dyndns.org> In-Reply-To: <20060405102528.GE699@turion.vk2pj.dyndns.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-current@freebsd.org Subject: Re: CPU class not configured problem in CURRENT-solved, boot problem remains X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Apr 2006 11:05:59 -0000 Peter Jeremy wrote: > On Wed, 2006-Apr-05 18:25:28 +0900, Ganbold wrote: > >> db> x/lu cpu >> cpu: 16 >> > > That's correct for CPU_P4 but my reading of the code suggests that it > should be initialised by identify_cpu to CPU_686 (7). > > >> db> x/lu cpu_class >> cpu_class: 4 >> > > And that's correct for CPUCLASS_686. > > It's beginning to look like the "switch (cpu_class)" statement doesn't > have the I686_CPU code compiled in. Do you want to double check that > your kernel config really does have "cpu I686_CPU" and that you are > running a kernel compiled from that config. > Sorry for the noise, it was my big fault, I was using I486_CPU instead of I686_CPU in the config and never thought this problem might happen because of incorrect CPU definition in the config. Thanks a lot Peter, for pointing me this out. Only one problem still remains, it still can not boot without pressing "Enter" key at the boot prompt (- sign waits forever). I created /boot.config with -Dh, now it shows boot.config: -Dh and waits for user to press "Enter". FYI, it boots fine with Ubuntu Linux. Please advise me, where should I look in the code for solution? Is it under /usr/src/sys/boot/ or somewhere else? thanks a lot, Ganbold > If your i386 assembler is up to it, you might like to disassemble > printcpuinfo() using gdb and confirm that the above switch statement > looks correct. Unfortunately, it's a massive function so finding the > relevant code is not trivial - though the extensive use of global > variables makes it a lot easier than it could be. > > The relevant code in a -current kernel that I built last night looks > like the following. This covers the switch statement and the printf() > statements that immediately preceded and follow it. This was built > using CPUTYPE=athlon-xp COPTFLAGS="-O -pipe" - the relative offsets > may be different if you use different flags. If you find the address > of cpu_class (0xc0799440 in the following), there are only a couple of > references to it and only one is followed by those cmp statements. > > The critical code is the 'cmp $0x4,%eax' - this is the > 'case CPUCLASS_686:' test. > > 0xc0673400 : movl $0xc0799460,0x4(%esp) > 0xc0673408 : movl $0xc06e3416,(%esp) > 0xc067340f : call 0xc05243e0 > 0xc0673414 : mov 0xc0799440,%eax > 0xc0673419 : cmp $0x1,%eax > 0xc067341c : je 0xc067344b > 0xc067341e : cmp $0x1,%eax > 0xc0673421 : jg 0xc0673430 > 0xc0673423 : test %eax,%eax > 0xc0673425 : je 0xc067343a > 0xc0673427 : jmp 0xc0673526 > 0xc067342c : lea 0x0(%esi),%esi > 0xc0673430 : cmp $0x4,%eax > 0xc0673433 : je 0xc067345c > 0xc0673435 : jmp 0xc0673526 > 0xc067343a : movl $0xc06cdbea,(%esp) > 0xc0673441 : call 0xc05243e0 > 0xc0673446 : jmp 0xc0673532 > 0xc067344b : movl $0xc06e2d76,(%esp) > 0xc0673452 : call 0xc05243e0 > 0xc0673457 : jmp 0xc0673532 > 0xc067345c : mov 0xc079b960,%ebx > 0xc0673462 : mov 0xc079b964,%esi > 0xc0673468 : mov %ebx,%eax > 0xc067346a : mov %esi,%edx > 0xc067346c : add $0x1388,%eax > 0xc0673471 : adc $0x0,%edx > 0xc0673474 : movl $0xf4240,0x8(%esp) > 0xc067347c : movl $0x0,0xc(%esp) > 0xc0673484 : mov %eax,(%esp) > 0xc0673487 : mov %edx,0x4(%esp) > 0xc067348b : call 0xc068bca0 <__udivdi3> > 0xc0673490 : mov %eax,0xc07994e0 > 0xc0673495 : add $0x1387,%ebx > 0xc067349b : adc $0x0,%esi > 0xc067349e : movl $0x2710,0x8(%esp) > 0xc06734a6 : movl $0x0,0xc(%esp) > 0xc06734ae : mov %ebx,(%esp) > 0xc06734b1 : mov %esi,0x4(%esp) > 0xc06734b5 : call 0xc068bca0 <__udivdi3> > 0xc06734ba : mov %eax,%ecx > 0xc06734bc : mov $0x51eb851f,%edx > 0xc06734c1 : mov %ecx,%eax > 0xc06734c3 : mul %edx > 0xc06734c5 : shr $0x5,%edx > 0xc06734c8 : imul $0x64,%edx,%edx > 0xc06734cb : mov %ecx,%eax > 0xc06734cd : sub %edx,%eax > 0xc06734cf : mov %eax,0xc(%esp) > 0xc06734d3 : mov 0x8(%esp),%edx > 0xc06734d7 : mov 0xc(%esp),%ecx > 0xc06734db : mov %edx,0xffffffdc(%ebp) > 0xc06734de : mov %ecx,0xffffffe0(%ebp) > 0xc06734e1 : movl $0xf4240,0x8(%esp) > 0xc06734e9 : movl $0x0,0xc(%esp) > 0xc06734f1 : mov %ebx,(%esp) > 0xc06734f4 : mov %esi,0x4(%esp) > 0xc06734f8 : call 0xc068b610 <__divdi3> > 0xc06734fd : mov 0xffffffe0(%ebp),%ebx > 0xc0673500 : mov %ebx,0xc(%esp) > 0xc0673504 : mov %eax,0x4(%esp) > 0xc0673508 : mov %edx,0x8(%esp) > 0xc067350c : movl $0xc06e341b,(%esp) > 0xc0673513 : call 0xc05243e0 > 0xc0673518 : movl $0xc06e3171,(%esp) > 0xc067351f : call 0xc05243e0 > 0xc0673524 : jmp 0xc0673532 > 0xc0673526 : movl $0xc06e33dc,(%esp) > 0xc067352d : call 0xc05243e0 > 0xc0673532 : movl $0xc06e3429,(%esp) > 0xc0673539 : call 0xc05243e0 > > > >> db> >> >> Ganbold >> >> >> _______________________________________________ >> freebsd-current@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-current >> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >> > >