PDA

View Full Version : apm kernel module not activated


borish
June 8th, 2009, 17:48
Hi,

ACPI doesn't work on my Thinkpad, but APM does. Therefore, I want to enable APM on my system.

I have a kernel without APM, but there's an apm kernel module. To make it work, I put

acpi_load="NO"
apm_load="YES"

in /boot/loader.conf and

hint.acpi.0.disabled="1"
hint.apm.0.disabled="0"
hint.apm.0.flags="0x20"

in /boot/device.hints and

apm_enable="YES"

in /etc/rc.conf.

After booting however, apm doesn't show up in kldstat -v and /dev/apm doesn't exist. Hence, invoking apm fails. kldload apm gives an error "file exists".

What is wrong here?

-Boris

graudeejs
June 8th, 2009, 18:01
comment out your hints (are you sure they are right)

SirDice
June 8th, 2009, 18:10
apm doesn't show up in kldstat -v
{snip}
kldload apm gives an error "file exists".
This usually means it's in the kernel config. Did you compile a custom kernel?

tangram
June 8th, 2009, 18:32
SirDice is right. APM needs to be enabled in the kernel config, the kernel compiled and finally installed.

borish
June 8th, 2009, 23:23
Strange... today it works. Maybe I made a typo somewhere. Sorry for bothering you!

Anyway, this shows that apm doesn't have to be compiled in the kernel. It can be loaded as a module.

I don't know it the hints are necessary. It seems redundant to me as I have that info in loader.conf alredy.

tangram
June 9th, 2009, 10:49
Weird because in my system:

% cd /usr/src/sys/i386/conf ; grep -i apm GENERIC
#device apm

And the Handbook on http://www.freebsd.org/doc/en/books/handbook/book.html#KERNELCONFIG-CONFIG states "Advanced Power Management support. Useful for laptops, although this is disabled in GENERIC by default".

Are you using a custom kernel conf?

borish
June 9th, 2009, 18:46
Yes, I have a custom kernel but without apm. As in the GENERIC kernel, device apm is commented out. This doesn't matter because there's apm.ko:

~% kldstat
Id Refs Address Size Name
1 11 0xc0400000 445fec kernel
2 1 0xc0846000 6da4 apm.ko