Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Feb 2012 10:05:42 -0500
From:      Alex Goncharov <alex-goncharov@comcast.net>
To:        freebsd-hackers@FreeBSD.org
Subject:   8 to 9: Kernel modularization -- did it change?
Message-ID:  <E1RyPNW-000If4-5Y@hans3>

next in thread | raw e-mail | index | archive | help
Sticking with the same list as in my first message re the "8 to 9" surprises:

| From: Alex Goncharov <alex-goncharov@comcast.net>
| To: freebsd-hackers@FreeBSD.org
| Date: Thu, 16 Feb 2012 12:34:36 -0500
| Subject: 8 to 9: A longer wait early in the boot...
|
| About a week ago, I made a jump and upgraded the system's FreeBSD from
| version 8 to 9.

Trying to figure our audio things, I was shocked to discover that on 9
I couldn't 'kldload snd_hda.ko'; it looks like the HDA support is in
the kernel itself now.

Compare the two runs, on my 8 and 9 machines, with this script:

-- >> ----------------------------------------------------------
#!/bin/sh

set -x
: ========================================
uname -sr
: ========================================
grep hda /boot/loader.conf
: ========================================
dmesg | grep -E 'hda|pcm'
: ========================================
cat /dev/sndstat
: ========================================
for f in /boot/kernel/kernel /boot/kernel/snd_hda.ko; do echo ==== $f; nm $f | grep -c hda; done
: ========================================
id
: ========================================
kldstat | grep -E 'sound|snd'
: ========================================
kldunload snd_hda.ko
: ========================================
kldstat | grep hda
: ========================================
kldload snd_hda.ko
: ========================================
kldstat | grep hda
: ========================================
-- << ----------------------------------------------------------

On 8:

-- >> ----------------------------------------------------------
* : ========================================
* uname -sr
FreeBSD 8.2-STABLE
* : ========================================
* grep hda /boot/loader.conf
snd_hda_load="YES"
* : ========================================
* dmesg
* grep -E 'hda|pcm'
hdac0: <Intel 82801G High Definition Audio Controller> mem 0xfea78000-0xfea7bfff irq 16 at device 27.0 on pci0
hdac0: HDA Driver Revision: 20100226_0142
hdac0: [ITHREAD]
hdac0: HDA Codec #0: Realtek ALC662
pcm0: <HDA Realtek ALC662 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA Realtek ALC662 PCM #1 Analog> at cad 0 nid 1 on hdac0
pcm2: <HDA Realtek ALC662 PCM #2 Digital> at cad 0 nid 1 on hdac0
hdac0: <Intel 82801G High Definition Audio Controller> mem 0xfea78000-0xfea7bfff irq 16 at device 27.0 on pci0
hdac0: HDA Driver Revision: 20100226_0142
hdac0: [ITHREAD]
hdac0: HDA Codec #0: Realtek ALC662
pcm0: <HDA Realtek ALC662 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA Realtek ALC662 PCM #1 Analog> at cad 0 nid 1 on hdac0
pcm2: <HDA Realtek ALC662 PCM #2 Digital> at cad 0 nid 1 on hdac0
pcm0: detached
pcm1: detached
pcm2: detached
hdac0: detached
hdac0: <Intel 82801G High Definition Audio Controller> mem 0xfea78000-0xfea7bfff irq 16 at device 27.0 on pci0
hdac0: HDA Driver Revision: 20100226_0142
hdac0: [ITHREAD]
hdac0: HDA Codec #0: Realtek ALC662
pcm0: <HDA Realtek ALC662 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA Realtek ALC662 PCM #1 Analog> at cad 0 nid 1 on hdac0
pcm2: <HDA Realtek ALC662 PCM #2 Digital> at cad 0 nid 1 on hdac0
pcm0: detached
pcm1: detached
pcm2: detached
hdac0: detached
hdac0: <Intel 82801G High Definition Audio Controller> mem 0xfea78000-0xfea7bfff irq 16 at device 27.0 on pci0
hdac0: HDA Driver Revision: 20100226_0142
hdac0: [ITHREAD]
hdac0: HDA Codec #0: Realtek ALC662
pcm0: <HDA Realtek ALC662 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA Realtek ALC662 PCM #1 Analog> at cad 0 nid 1 on hdac0
pcm2: <HDA Realtek ALC662 PCM #2 Digital> at cad 0 nid 1 on hdac0
pcm0: detached
pcm1: detached
pcm2: detached
hdac0: detached
hdac0: <Intel 82801G High Definition Audio Controller> mem 0xfea78000-0xfea7bfff irq 16 at device 27.0 on pci0
hdac0: HDA Driver Revision: 20100226_0142
hdac0: [ITHREAD]
hdac0: HDA Codec #0: Realtek ALC662
pcm0: <HDA Realtek ALC662 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA Realtek ALC662 PCM #1 Analog> at cad 0 nid 1 on hdac0
pcm2: <HDA Realtek ALC662 PCM #2 Digital> at cad 0 nid 1 on hdac0
pcm0: detached
pcm1: detached
pcm2: detached
hdac0: detached
hdac0: <Intel 82801G High Definition Audio Controller> mem 0xfea78000-0xfea7bfff irq 16 at device 27.0 on pci0
hdac0: HDA Driver Revision: 20100226_0142
hdac0: [ITHREAD]
hdac0: HDA Codec #0: Realtek ALC662
pcm0: <HDA Realtek ALC662 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA Realtek ALC662 PCM #1 Analog> at cad 0 nid 1 on hdac0
pcm2: <HDA Realtek ALC662 PCM #2 Digital> at cad 0 nid 1 on hdac0
pcm0: detached
pcm1: detached
pcm2: detached
hdac0: detached
hdac0: <Intel 82801G High Definition Audio Controller> mem 0xfea78000-0xfea7bfff irq 16 at device 27.0 on pci0
hdac0: HDA Driver Revision: 20100226_0142
hdac0: [ITHREAD]
hdac0: HDA Codec #0: Realtek ALC662
pcm0: <HDA Realtek ALC662 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA Realtek ALC662 PCM #1 Analog> at cad 0 nid 1 on hdac0
pcm2: <HDA Realtek ALC662 PCM #2 Digital> at cad 0 nid 1 on hdac0
pcm0: detached
pcm1: detached
pcm2: detached
hdac0: detached
hdac0: <Intel 82801G High Definition Audio Controller> mem 0xfea78000-0xfea7bfff irq 16 at device 27.0 on pci0
hdac0: HDA Driver Revision: 20100226_0142
hdac0: [ITHREAD]
hdac0: HDA Codec #0: Realtek ALC662
pcm0: <HDA Realtek ALC662 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA Realtek ALC662 PCM #1 Analog> at cad 0 nid 1 on hdac0
pcm2: <HDA Realtek ALC662 PCM #2 Digital> at cad 0 nid 1 on hdac0
pcm0: detached
pcm1: detached
pcm2: detached
hdac0: detached
hdac0: <Intel 82801G High Definition Audio Controller> mem 0xfea78000-0xfea7bfff irq 16 at device 27.0 on pci0
hdac0: HDA Driver Revision: 20100226_0142
hdac0: [ITHREAD]
hdac0: HDA Codec #0: Realtek ALC662
pcm0: <HDA Realtek ALC662 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA Realtek ALC662 PCM #1 Analog> at cad 0 nid 1 on hdac0
pcm2: <HDA Realtek ALC662 PCM #2 Digital> at cad 0 nid 1 on hdac0
pcm0: detached
pcm1: detached
pcm2: detached
hdac0: detached
hdac0: <Intel 82801G High Definition Audio Controller> mem 0xfea78000-0xfea7bfff irq 16 at device 27.0 on pci0
hdac0: HDA Driver Revision: 20100226_0142
hdac0: [ITHREAD]
hdac0: HDA Codec #0: Realtek ALC662
pcm0: <HDA Realtek ALC662 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA Realtek ALC662 PCM #1 Analog> at cad 0 nid 1 on hdac0
pcm2: <HDA Realtek ALC662 PCM #2 Digital> at cad 0 nid 1 on hdac0
pcm0: detached
pcm1: detached
pcm2: detached
hdac0: detached
hdac0: <Intel 82801G High Definition Audio Controller> mem 0xfea78000-0xfea7bfff irq 16 at device 27.0 on pci0
hdac0: HDA Driver Revision: 20100226_0142
hdac0: [ITHREAD]
hdac0: HDA Codec #0: Realtek ALC662
pcm0: <HDA Realtek ALC662 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA Realtek ALC662 PCM #1 Analog> at cad 0 nid 1 on hdac0
pcm2: <HDA Realtek ALC662 PCM #2 Digital> at cad 0 nid 1 on hdac0
pcm0: detached
pcm1: detached
pcm2: detached
hdac0: detached
hdac0: <Intel 82801G High Definition Audio Controller> mem 0xfea78000-0xfea7bfff irq 16 at device 27.0 on pci0
hdac0: HDA Driver Revision: 20100226_0142
hdac0: [ITHREAD]
hdac0: HDA Codec #0: Realtek ALC662
pcm0: <HDA Realtek ALC662 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA Realtek ALC662 PCM #1 Analog> at cad 0 nid 1 on hdac0
pcm2: <HDA Realtek ALC662 PCM #2 Digital> at cad 0 nid 1 on hdac0
pcm0: detached
pcm1: detached
pcm2: detached
hdac0: detached
hdac0: <Intel 82801G High Definition Audio Controller> mem 0xfea78000-0xfea7bfff irq 16 at device 27.0 on pci0
hdac0: HDA Driver Revision: 20100226_0142
hdac0: [ITHREAD]
hdac0: HDA Codec #0: Realtek ALC662
pcm0: <HDA Realtek ALC662 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA Realtek ALC662 PCM #1 Analog> at cad 0 nid 1 on hdac0
pcm2: <HDA Realtek ALC662 PCM #2 Digital> at cad 0 nid 1 on hdac0
* : ========================================
* cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <HDA Realtek ALC662 PCM #0 Analog> (play/rec) default
pcm1: <HDA Realtek ALC662 PCM #1 Analog> (play/rec)
pcm2: <HDA Realtek ALC662 PCM #2 Digital> (play)
* : ========================================
* echo ==== /boot/kernel/kernel
==== /boot/kernel/kernel
* nm /boot/kernel/kernel
* grep -c hda
0
* echo ==== /boot/kernel/snd_hda.ko
==== /boot/kernel/snd_hda.ko
* nm /boot/kernel/snd_hda.ko
* grep -c hda
114
* : ========================================
* id
uid=0(root) gid=0(wheel) groups=0(wheel),5(operator)
* : ========================================
* kldstat
* grep -E 'sound|snd'
 3    2 0xffffffff80f09000 75878    sound.ko
11    1 0xffffffff81039000 14580    snd_hda.ko
* : ========================================
* kldunload snd_hda.ko
* : ========================================
* grep hda
* kldstat
* : ========================================
* kldload snd_hda.ko
* : ========================================
* grep hda
* kldstat
11    1 0xffffffff81039000 14580    snd_hda.ko
* : ========================================

-- << ----------------------------------------------------------

<== All is the way I am used to: for my audio card, the support is in
snd_hda.ko, which I load and unload as I will. The kernel does not
contain snd_hda symbols.


On 9:

-- >> ----------------------------------------------------------
* : ========================================
* uname -sr
FreeBSD 9.0-STABLE
* : ========================================
* grep hda /boot/loader.conf
snd_hda_load="YES"
* : ========================================
* dmesg
* grep -E 'hda|pcm'
hdac0: <NVidia MCP61 High Definition Audio Controller> mem 0xfe028000-0xfe02bfff irq 23 at device 5.0 on pci0
hdac0: HDA Codec #0: Realtek ALC660
pcm0: <HDA Realtek ALC660 PCM #0 Analog> at cad 0 nid 1 on hdac0
pcm1: <HDA Realtek ALC660 PCM #1 Digital> at cad 0 nid 1 on hdac0
interface snd_hda.1 already present in the KLD 'kernel'!
interface snd_hda.1 already present in the KLD 'kernel'!
* : ========================================
* cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <HDA Realtek ALC660 PCM #0 Analog> (play/rec) default
pcm1: <HDA Realtek ALC660 PCM #1 Digital> (play)
* : ========================================
* echo ==== /boot/kernel/kernel
==== /boot/kernel/kernel
* nm /boot/kernel/kernel
* grep -c hda
114
* echo ==== /boot/kernel/snd_hda.ko
==== /boot/kernel/snd_hda.ko
* nm /boot/kernel/snd_hda.ko
* grep -c hda
114
* : ========================================
* id
uid=0(root) gid=0(wheel) groups=0(wheel),5(operator)
* : ========================================
* kldstat
* grep -E 'sound|snd'
* : ========================================
* kldunload snd_hda.ko
kldunload: can't find file snd_hda.ko
* : ========================================
* kldstat
* grep hda
* : ========================================
* kldload snd_hda.ko
kldload: can't load snd_hda.ko: Exec format error
* : ========================================
* kldstat
* grep hda
* : ========================================

-- << ----------------------------------------------------------

<== This is shocking to me: I have the /boot/kernel/snd_hda.ko but I
can't load and unload it -- apparently the sound support is in the
kernel now.

Sorry if this is a trivial question, but did the kernel modularization
mechanics and/or configuration change between 8 and 9? (I don't easily
see anything applicable in /usr/src/UPDATING).

Thanks.

-- Alex -- alex-goncharov@comcast.net --
   



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1RyPNW-000If4-5Y>