Subject: ksyms challenge!
To: None <current-users@netbsd.org>
From: walt <wa1ter@myrealbox.com>
List: current-users
Date: 08/04/2003 14:33:26
Well, I got a laugh out of this:  I compiled a kernel with
'pseudo-device ksyms' deliberately commented out, just to
see what differences I would find.

Well, all the problems I had with systat and xosview just
disappeared!

Systat stopped complaining about missing kernel symbols
and xosview works as expected with no extra flags.

And why is this???

Because both programs discover that /dev/ksyms is not
a valid device and they do NOT attempt to read from it.
They both go to /netbsd for the needed symbols and, now
that I've unzipped the kernel image, they can get the
symbols they need.

So -- my challenge to all you longtime NetBSD users out
there who think you are using /dev/ksyms -- are you
REALLY usings ksyms?  Or not.

Try 'ktruss systat' and see if the program reada from
/dev/ksyms, or does it fail and then  go to /netbsd for
the symbols it needs?

#ktruss systat |grep open     <see the last two lines>
    637 systat   open("/etc/ld.so.conf", 0, 0x48066000) = 3
    637 systat   open("/usr/lib/libutil.so.7", 0, 0) = 3
    637 systat   open("/usr/lib/libcurses.so.5", 0, 0xbfbff47c) = 3
    637 systat   open("/usr/lib/libm387.so.0", 0, 0xbfbff47c) = 3
    637 systat   open("/usr/lib/libm.so.0", 0, 0xbfbff47c) = 3
    637 systat   open("/usr/lib/libkvm.so.5", 0, 0xbfbff47c) = 3
    637 systat   open("/usr/lib/libc.so.12", 0, 0xbfbff47c) = 3
    637 systat   open("/dev/mem", 0, 0)             = 3
    637 systat   open("/dev/kmem", 0, 0)            = 4
    637 systat   open("/dev/drum", 0, 0)            = 5
    637 systat   open("/dev/ksyms", 0, 0)           Err#6 ENXIO
    637 systat   open("/netbsd", 0, 0)              = 6

My original problem was that the 'open' command on /dev/ksyms actually
succeeded, but the subsequest 'pread' on /dev/ksyms failed.  At that
point the program terminates instead of proceeding to open /netbsd to
look for the kernel symbols.

What do you see when you try this?