Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Apr 1997 18:25:47 +0200
From:      Ollivier Robert <roberto@keltia.freenix.fr>
To:        "FreeBSD Current Users' list" <freebsd-current@freebsd.org>, se@freebsd.org
Subject:   Size mismatch between kernel and ncrcontrol
Message-ID:  <19970426182547.39184@keltia.freenix.fr>

next in thread | raw e-mail | index | archive | help
I get struct size mismatch between ncrcontrol and a freshly compiled kernel
(obviously this leads to ncrcontrol being unusable). I don't understand
why... After several kernel/ncrcontrol recompiles, the problem persists.

ncrcontrol think ncr_version (generated in /sys/pci/ncr.c with various
sizes) is 26402 and the kernel has 27186 !

Within /sys/pci/ncr.c:

#define NCR_VERSION     (2)

static const u_long     ncr_version = NCR_VERSION       * 11
        + (u_long) sizeof (struct ncb)  *  7
        + (u_long) sizeof (struct ccb)  *  5
        + (u_long) sizeof (struct lcb)  *  3
        + (u_long) sizeof (struct tcb)  *  2;

A test with ncrcontrol leads to:

sizeof ncb=3356 sizeof ccb=500 sizeof lcb=36 sizeof tcb=140

2*11 + 7*3356 + 5*500 + 3*36 + 2*140 = 26402.

Why the kernel is thinking ncr_version is 27186 ?!? I've checked with DDB.
Which structure(s) gets a different size ?

Here are the relevant part of /etc/make.conf:

COPTFLAGS= -O -pipe
CFLAGS= -O -pipe

Here is my kernel config. file

#
# NKELTIA -- the new Keltia with P133, 64 MB & 2x NCR 
#

machine		"i386"
cpu			"I486_CPU"
cpu			"I586_CPU"
ident		"NKELTIA"
maxusers	20

options		INET					#InterNETworking
options		FFS						#Berkeley Fast Filesystem
options		MFS						#Berkeley Fast Filesystem
options		PROCFS					#Berkeley proc Filesystem
options		"COMPAT_43"				#Compatible with BSD 4.3
options		UCONSOLE				#for xconsole
#
options		"SCSI_NCR_DFLT_TAGS=8"

options		SYSVSHM
options		SYSVSEM
options		SYSVMSG
options		"SHMMAXPGS=1024"        # 4096 KB of sharable memory
#
options		"SCSI_2_DEF"
#
options     "CLK_USE_I586_CALIBRATION"
#
# Enable the kernel debugger.
#
options		DDB
options		KTRACE

config		kernel	root on sd0 swap on sd0 and sd1 and sd2 dumps on sd0

controller	isa0

controller	fdc0	at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr
disk		fd0	at fdc0 drive 0

controller  pci0
controller	ncr0
controller  ncr1

controller	scbus0 at ncr0
controller	scbus1 at ncr1

# NCR0: ibm + tandberg + hp
disk		sd0 at scbus0 target 0 unit 0
disk		sd1 at scbus0 target 1
disk		sd2 at scbus0 target 2
disk		sd3 at scbus0 target 3
tape		st1 at scbus0 target 4
tape		st0 at scbus0 target 5
device		cd0 at scbus0 target 6
# NCR1: conner + micropolis + cd
disk		sd10 at scbus1 target 0
disk		sd11 at scbus1 target 1
disk		sd12 at scbus1 target 2
disk		sd13 at scbus1 target 3
device      cd1 at scbus1 target 6

# new sound config.
controller	snd0
device sb0	at isa? port 0x220 irq 5 drq 3 vector sbintr
device opl0	at isa? port 0x388

device		sc0	at isa? port "IO_KBD" tty irq 1 vector scintr
device		npx0	at isa? port "IO_NPX" irq 13 vector npxintr

device		sio0	at isa? port "IO_COM1" tty irq 4 vector siointr
device		sio1	at isa? port "IO_COM2" tty irq 3 vector siointr

device		lpt0	at isa? port? tty irq 7 vector lptintr

device fxp0
device ed0 at isa? port 0x300 net irq 10 iomem 0xd0000 vector edintr

pseudo-device	loop
pseudo-device	ether
pseudo-device	log
pseudo-device	ppp	1
pseudo-device   bpfilter 4  #Berkeley packet filter
pseudo-device	pty	64
pseudo-device	speaker
pseudo-device   vn          #Vnode driver (turns a file into a device)
pseudo-device	tun	1		#Enable user-level PPP see ppp(8)
pseudo-device   snp 3       #Snoop device - to look at pty/vty/etc..

Here are the kernel boot messages:

Copyright (c) 1992-1997 FreeBSD Inc.
Copyright (c) 1982, 1986, 1989, 1991, 1993
	The Regents of the University of California. All rights reserved.
FreeBSD 3.0-CURRENT #7: Sat Apr 26 17:13:26 CEST 1997
    roberto@keltia.freenix.fr:/src/src/sys/compile/NKELTIA
CPU: Pentium (167.06-MHz 586-class CPU)
  Origin = "GenuineIntel"  Id = 0x52c  Stepping=12
  Features=0x1bf<FPU,VME,DE,PSE,TSC,MSR,MCE,CX8>
real memory  = 67108864 (65536K bytes)
avail memory = 63782912 (62288K bytes)
bdevsw_add_generic: adding D_DISK flag for device 15
Probing for devices on PCI bus 0:
chip0 <Intel 82439> rev 3 on pci0:0:0
chip1 <Intel 82371SB PCI-ISA bridge> rev 1 on pci0:7:0
chip2 <Intel 82371SB IDE interface> rev 0 on pci0:7:1
fxp0 <Intel EtherExpress Pro 10/100B Ethernet> rev 1 int a irq 15 on pci0:9:0
fxp0: Ethernet address 08:00:09:dc:23:7e
vga0 <VGA-compatible display device> rev 1 int a irq 9 on pci0:10:0
ncr0 <ncr 53c810a scsi> rev 18 int a irq 12 on pci0:11:0
scbus0 at ncr0 bus 0
sd0 at scbus0 target 0 lun 0
sd0: <IBM DORS-32160 WA6A> type 0 fixed SCSI 2
sd0: Direct-Access 
sd0: 10.0 MB/s (100 ns, offset 8)
2063MB (4226725 512 byte sectors)
st1 at scbus0 target 4 lun 0
st1: <TANDBERG  TDC 3600 =08:> type 1 removable SCSI 2
st1: Sequential-Access density code 0x0,  drive empty
st0 at scbus0 target 5 lun 0
st0: <HP HP35480A 1009> type 1 removable SCSI 2
st0: Sequential-Access 
st0: 5.0 MB/s (200 ns, offset 8)
density code 0x13,  drive empty
ncr1 <ncr 53c810a scsi> rev 18 int a irq 11 on pci0:12:0
scbus1 at ncr1 bus 0
sd11 at scbus1 target 1 lun 0
sd11: <MICROP 1624-07MZ1077801 HZ2P> type 0 fixed SCSI 2
sd11: Direct-Access 
sd11: 10.0 MB/s (100 ns, offset 8)
642MB (1316751 512 byte sectors)
scbus1 target 2 lun 0: phase change 2-3 10@00337b58 resid=4.
sd12 at scbus1 target 2 lun 0
sd12: <CONNER CFP1080S 3939> type 0 fixed SCSI 2
sd12: Direct-Access 
sd12: 10.0 MB/s (100 ns, offset 8)
1030MB (2110812 512 byte sectors)
cd1 at scbus1 target 6 lun 0
cd1: <MATSHITA CD-ROM CR-8004 1.1f> type 5 removable SCSI 2
cd1: CD-ROM 
cd1: asynchronous.
cd1: M_REJECT sent for 1-3-1-76-8.
can't get the size
Probing for devices on the ISA bus:
sc0 at 0x60-0x6f irq 1 on motherboard
sc0: VGA color <16 virtual consoles, flags=0x0>
ed0 at 0x300-0x31f irq 10 maddr 0xd0000 msize 16384 on isa
ed0: address 00:00:c0:7c:66:48, type WD8013EPC (16 bit) 
sio0 at 0x3f8-0x3ff irq 4 on isa
sio0: type 16550A
sio1 at 0x2f8-0x2ff irq 3 on isa
sio1: type 16550A
lpt0 at 0x378-0x37f irq 7 on isa
lpt0: Interrupt-driven port
lp0: TCP/IP capable interface
fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa
fdc0: NEC 72065B
fd0: 1.44MB 3.5in
sb0 at 0x220-0x22f irq 5 drq 3 on isa
sb0: <SoundBlaster Pro 3.1>
opl0 at 0x388-0x38b on isa
opl0: <Yamaha OPL-3 FM>
npx0 on motherboard
npx0: INT 16 interface
-- 
Ollivier ROBERT -=- FreeBSD: There are no limits -=- roberto@keltia.freenix.fr
FreeBSD keltia.freenix.fr 3.0-CURRENT #7: Sat Apr 26 17:13:26 CEST 1997



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970426182547.39184>