I am not good enough to have made clear progress yet outside of a skeleton implementation of the traits.
Also I am lacking free time to actually learn more and make progress (but I am not giving up).
However I wanted to know if I can have the vendor and infos from acpi tables.
I made an acpidump -o output.dst
Then an acpiexec output.dst, and the methods
commands nicely shows the acpi methods available including acpi BIF and BST for battery info.
I am quite sure that the driver acpi_bat (used by sysmon/envsys) reads info through the acpi subsystem BIF and BST.
However when I execute the method
- execute \_SB.BAT0._BIF
Evaluating \_SB.BAT0._BIF
nsrepair-0325 [00] NsSimpleRepair : \_SB.BAT0._BIF: Converted Buffer to expected String at Package index 9
nsrepair-0325 [00] NsSimpleRepair : \_SB.BAT0._BIF: Converted Buffer to expected String at Package index 10
nsrepair-0325 [00] NsSimpleRepair : \_SB.BAT0._BIF: Converted Buffer to expected String at Package index 11
nsrepair-0325 [00] NsSimpleRepair : \_SB.BAT0._BIF: Converted Buffer to expected String at Package index 12
0x3 Outstanding allocations after evaluation of \_SB.BAT0._BIF
Evaluation of \_SB.BAT0._BIF returned object 0x75a78a7ead00, external buffer length 170
[Package] Contains 13 Elements:
[Integer] = 0000000000000001
[Integer] = 0000000000000000
[Integer] = 0000000000000000
[Integer] = 0000000000000001
[Integer] = 0000000000000000
[Integer] = 0000000000000000
[Integer] = 0000000000000000
[Integer] = 0000000000000000
[Integer] = 0000000000000000
[String] Length 00 = ""
[String] Length 01 = "0"
[String] Length 00 = ""
[String] Length 00 = ""
It is empty.
First I could say, ok maybe it is because it is a dump and it can't query data. But acpi BIF (battery info) contrary to BST (Battery status) is a static information and in https://wiki.ubuntu.com/Kernel/Reference/ACPITricksAndTips the example with the acpi battery finds it nicely.
Maybe it is a problem with the dumped data or something I am doing wrong.
- debug \_SB.BAT0._BIF
Evaluating \_SB.BAT0._BIF
[_BIF] @00000 #0008: Name (BIF0 (Path \_SB_.BAT0._BIF.BIF0), [_BIF] @00005 #0012: Package (0x0D) {})
%
ArgObj: 0x75a78a6864b0 <Obj> Integer 000000000000000D
[_BIF] @00000 #0008: Name (BIF0 (Path \_SB_.BAT0._BIF.BIF0),
%
ArgObj: 0x75a78a6c2bd0 <Node> Name BIF0 Package 0x75a78a686130
ResultObj: 0x75a78a686130 <Obj> Package 0x75a78a686130
[_BIF] @00008 #0035: ECG9 (0x01, BIF0)
%
Seems a need for a parameter but If I add one similar to what it seems to be asked (BIF0) I am told there is an excess of arguments.
I did this with acpica-utils-20160930nb2 but some attempts with amdbl globaly shows the same with ECG9 and things I don't undertand (yet)
If you have an idea I am curious.
I am not a hardcore kernel developer so reading the acpi_bat driver and know how to access /dev/acpi is out of my skillset (at least for now). But if someone knowledgeable can help me, I am very interested.
Also if using acpi instead of sysmon, on x86_64 devices at least, this would allow me to share logic with the freebsd library implementation and have all the battery info I need as sysmon for example does not expose vendor and model.
I also so in the netbsd acpi_bat source code there's a debug function, but I don't really know how to trigger it and if it can display acpi battery info.
static void
acpibat_print_info(device_t dv, ACPI_OBJECT *elm)
https://github.com/NetBSD/src/blob/trunk/sys/dev/acpi/acpi_bat.c
Thanks in advance,
Ps: I don't have a lot of focus on reading long documentations sadly, but I am interested if there is a documentation on netbsd acpi management (I know it is using acpica internally but I am interested into ways the info are accessible from userspace (/dev/acpi, /dev/mem (it seems), or any other ways) in NetBSD.