Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
What would be the easiest way to control screen brightness? If its using ACPI (which I really don't want to do just yet) then I need to know how to do it without ASL because I don't have that implemented AT ALL quite yet.
Any help is appreciated.
No. Like on a LCD screen of a laptop. I want to dim the screen after a period of inactivity. I want this function written right into the kernel, but I don't know how to do it.
osmiumusa wrote:No. Like on a LCD screen of a laptop. I want to dim the screen after a period of inactivity. I want this function written right into the kernel, but I don't know how to do it.
Sometimes it's implemented by the laptop's EC and can be controlled using a Fn key combo, no OS intervention required, not always however.
ACPI is the only "standard" method of controlling brightness, the publicly available specification has more information about this.. start on page 695, "ACPI Extensions for Display adapters". Indeed it appears an AML interpreter may be necessary.
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
In the "ACPI Shutdown" thread somewhere on this forum (linked from the wiki page about shutdowns), the author shows that you can control acpi by finding the specific values in objects in acpi memory? How do find the _BCL object using "C-acpi", or how do I find out where it is? Is there any documentation about where this is? I currently don't have the time to implement acpica, even though it looks very helpful. I don't think you, but can you do it with APM? Just wondering...
You need to deal with ASL and AML to do it properly. The only reason that little shutdown hack can work is because there's currently a standardized proceedure for invoking a shutdown on a ACPI based computer (you write a specific value to a specific port). Virtually anything else that depends on AML can implement customized methods that could invoke multiple interactions with multiple buses and registers. That's pretty much the entire purpose of AML to begin with. That said, it's important to keep in mind that the shutdown hack described is just that, a hack. There's nothing that prevents a motherboard from having a signature identical to that of the shutdown object stored in a random buffer somewhere that's declared before the shutdown object itself. You basically need an AML interpreter to safely interact with anything in the AML, and that includes all the methods described in the ACPI specification.
Last ditch effort before the realization of the inevitability of implementing ACPICA...
Using a program like iASL, can I write a program that controls screen brightness in ASL, and have it churn out ASM or C source code? I only ask because I haven't gotten iASL to work from the examples in the ACPI documentation.
The two reasons why I'm so reluctant to integrate a whole ACPI layer is because it would add size to the kernel and suck speed from its quick loading time.