tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Why kc_bitsize is zero?



Hi,

I have mistaken to calculate kernel, netbsd.bin, size.
The kernel is truncated and I have gotten zero.

With correct size and offset, kernel starts like oarm.


$ ll /usr/world/7.99/evbearmv5-el/obj/sys/arch/evbarm/compile/GUMSTIX_QEMU/netbsd.bin
-rwxr-xr-x  1 ryo_on  wheel  5567168 Aug 27 13:38 /usr/world/7.99/evbearmv5-el/obj/sys/arch/evbarm/compile/GUMSTIX_QEMU/netbsd.bin*

$ dc
5567168
4
/
p
1391792
16o
p
153CB0


$ ~/repos/qemu/arm-softmmu/qemu-system-arm -M connex -drive if=pflash,file=./flash,format=raw -nographic -m 289
main-loop: WARNING: I/O thread spun for 1000 iterations
pxa2xx_clkcfg_write: CPU frequency change attempt


U-Boot 1.2.0 (May 10 2008 - 13:33:03) - 400 MHz - 1604

*** Welcome to Gumstix ***

DRAM:  64 MB
Flash: 16 MB
Using default environment

SMC91C1111-0
Net:   SMC91C1111-0
Hit any key to stop autoboot:  0
GUM> cp.l 9c4000 a0200000 153cb0
GUM> go a0200000
## Starting application at 0xA0200000 ...

NetBSD/evbarm (gumstix) booting ...
system serial: 0x0000000000000000
[ Kernel symbol table missing! ]
Loaded initial symtab at 0xc0684110, strtab at 0xc06c2880, # entries 15971
pmap_postinit: Allocated 35 static L1 descriptor tables
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
    2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 7.99.21 (GUMSTIX_QEMU) #2: Thu Aug 27 13:38:04 JST 2015
        ryo_on%brownie.elements.tetera.org@localhost:/usr/world/7.99/evbearmv5-el/obj/sys/arch/evbarm/compile/GUMSTIX_QEMU
total memory = 65536 KB
avail memory = 57996 KB
sysctl_createv: sysctl_create(machine_arch) returned 17
mainbus0 (root)
cpu0 at mainbus0 core 0: PXA255/26x rev 0 (XScale V5TE core)
cpu0: DC enabled IC enabled WB enabled LABT branch prediction enabled
cpu0: 16KB/32B 64-way L1 VIVT Instruction cache
cpu0: 16KB/32B 64-way write-back-locking-A L1 VIVT Data cache
pxaip0 at mainbus0: Onchip Peripheral Bus
pxaip0: CPU clock = 1000.002 MHz
pxaip0: kernel is configured for PXA250 and PXA270, cpu type is PXA250
pxaintc0 at pxaip0 addr 0x40d00000-0x40d0001f: Interrupt Controller
pxagpio0 at pxaip0 addr 0x40e00000-0x40e0014f: GPIO Controller
com0 at pxaip0 addr 0x40100000-0x4010001f intr 22: ns16550a, working fifo
com0: console
saost0 at pxaip0 addr 0x40a00000-0x40a0001f
saost0: SA-11x0 OS Timer
lcd0 at pxaip0 addr 0x44000000-0x4400021f: PXA2x0 LCD controller
wsdisplay0 at lcd0 kbdmux 1
pxadmac0 at pxaip0 addr 0x40000000-0x400002ff intr 25: DMA Controller
pxaacu0 at pxaip0 addr 0x40500000-0x405005ff intr 14: AC97 Controller
pxaacu0: Primary codec not ready
pxartc0 at pxaip0 addr 0x40900000-0x4090000f: Real-time Clock
gxio0 at pxaip0
gxiic0 at pxaip0 addr 0x40300000-0x403016a3
iic0 at gxiic0: I2C bus
clock: hz=100 stathz=64
WARNING: module error: can't find builtin dependency `compat_sysv'
boot device: <unknown>
root device:

From: Ryo ONODERA <ryo_on%yk.rim.or.jp@localhost>, Date: Fri, 21 Aug 2015 23:07:23 +0900 (JST)

> Hi,
> 
> From: Ryo ONODERA <ryo_on%yk.rim.or.jp@localhost>, Date: Fri, 21 Aug 2015 22:52:49 +0900 (JST)
> 
>> From: matthew green <mrg%eterna.com.au@localhost>, Date: Fri, 21 Aug 2015 15:42:22 +1000
>> 
>>> Ryo ONODERA writes:
>>>> kc_bitsize in kcpuset_early_ptr always: 0
>>>> kc_bitsize in kcpuset_early_ptr: 0
>>>> KC_BITSIZE_EARLY in kcpuset_early_ptr: 4
>>>> panic: kernel diagnostic assertion "kc_bitsize == KC_BITSIZE_EARLY" failed: file "/usr/src/sys/kern/subr_kcpuset.c", line 184
>>> 
>>> can you debug this further?  as in, add more printfs to see why
>>> this code isn't working?  it seems fairly simple and shouldn't
>>> be failing this way...
>> 
>> kcpuset_early_ptr() is second invoked function in this file.
>> And first function is kcpuset_create() and at its start kc_bitsize is
>> already zero.
>> 
>> Anyway I will investigate deeper.
> 
> __read_mostly is bad for me.
> 
> static size_t kc_bitsize __read_mostly = KC_BITSIZE_EARLY;
> static size_t kc_nfields __read_mostly = KC_NFIELDS_EARLY;
> 
> Removing __read_mostly, kernel boots like oarm.
> 
> --
> Ryo ONODERA // ryo_on%yk.rim.or.jp@localhost
> PGP fingerprint = 82A2 DC91 76E0 A10A 8ABB  FD1B F404 27FA C7D1 15F3


Home | Main Index | Thread Index | Old Index