APM Help

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.
Post Reply
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

APM Help

Post by Chandra »

I had just tried to implement APM in my kernel (not ACPI at this stage please). I had connected the APM service to protected mode interface through BIOS call in my bootloader. But the problem is: how do I actually write the APM driver or at least few lines of code to actually power down my PC? I had downloaded the APM manual and it says we can implement APM in protected mode to control the power management system(and my pc supports that at least) but what I am not getting is, how exactly?
As mentioned in the manual, the subfunction Ah=53h,al=03h returns the offset of the entry point to the APM BIOS in EBX and APM BIOS 32bit code segment length in ESI. So, how do I use these two values to actually write a APM driver.

If somebody knows how to actually implement APM power management service under protected mode, please HELP! If you have few lines of code involving APM BIOS functions to shutdown the pc, that would be highly appreciated. Thanks in advance for any help.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: APM Help

Post by Combuster »

It appears that half of your questions are answered by the wiki: APM. Did you search?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: APM Help

Post by Chandra »

Yes I did read the wiki. The wiki explains about APM but every function it talks about involves BIOS interrupt. And I know it very well that BIOS interrupts are not available under protected mode( at least unless you switch to VM86 mode). I posted this problem after long search regarding the protected mode driver for APM enabled power control. And my continuos search returned nothing. So I finally realized that someone in this forum could help me on that.

If you have any code or any links, please do post it here. I would be very thankful.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: APM Help

Post by Combuster »

at least unless you switch to VM86 mode
So you do know a solution :shock:

That said, I peeked down the document and it explicitly states that the arguments are identical in whichever mode you decide to call the interface. Now, I don't need to explain what "entry point" means, no?

EDIT: Since this is starting to become a habit, consider the following: if someone can give a correct answer a question with a single link the person asking the question violated forum rules: either he did not search or he asked a stupid question by omitting the specifics by which the found results are not useful in any way.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply