Does any one know how to turn off a pc motherboard automatically? I would like my embedded pc code to power down a pc motherboard.
Steve
Does any one know how to turn off a pc motherboard automatically? I would like my embedded pc code to power down a pc motherboard.
Steve
"Steve West" schreef in bericht news:Oj%sd.151975$5K2.31443@attbi_s03...
If the flavour of your motherboard's powermanagement is APM 1.2 try this:
-- Thanks, Frank. (remove 'q' and 'invalid' when replying by email)
This looks like you need a power management driver to talk to the bios. We are running protected mode and have no bios code after the initial boot. I would like to just set a register and have the pc power down (like a keyboard reboot).
Steve Steve
"Steve West" schreef in bericht news:ES%sd.152034$5K2.125825@attbi_s03...
IWell, the document describes the bios calls so that you could actually write a PM driver. If you don't have a bios, you have to re-write (part of) the PM bios that came with the board, and likely need to know how the hardware does it all, on your particular board. I'd think you need the schematics and datasheets on the chipsets used, for starters.
-- Thanks, Frank. (remove 'q' and 'invalid' when replying by email)
"Steve West" wrote
Doesn't that imply the application software does not have the authority to turn the power off?
How about:
1) Exit protected mode. 2) Call the bios to turn off the power.After all, it is a one-way trip.
What does a disassembly of the OS's 'power-off' driver and the relevant bios show?
-- Nicholas O. Lindan, Cleveland, Ohio Consulting Engineer: Electronics; Informatics; Photonics. Remove spaces etc. to reply: n o lindan at net com dot com psst.. want to buy an f-stop timer? nolindan.com/da/fstop/
If all you want to do is turn off the computer, you don't really need a while driver. There are two basic ways to do it. One would be to simply return to real mode and then invoke the Connect request followed immediately by the Set Power State call. The real mode code would be this:
ConnectAPM: mov ax,5301h ; Real Mode APM connect xor bx,bx ; APM BIOS int 15h PowerDown: mov ax,5307h ; APM Set Power State mov bx,1 ; all managed devices mov cx,3 ; state=off int 15h ; call APM If you're willing to accept the complete lack of error checking, that's all there is to it.
Ed
Ed:
Please read again - this does not work in *protected mode*.
-- Tauno Voipio tauno voipio (at) iki fi
Please read my reply again -- I said "return to real mode and then..." In fact, APM calls can be made from within protected mode as well, if the BIOS supports it (mandatory starting with APM version 1.2). The only catch is that the ConnectAPM call needs to be made from within real mode. It then returns selectors which are then used to CALL the APM routines instead of using the INT instruction. I assumed, however, that this was more effort since it would involve modifying the early startup real mode code. That code is almost identical, however:
ConnectAPMProt32: mov ax,5303h ; 32-bit pmode APM connect request xor bx,bx ; APM BIOS int 15h ;
; if successful (CY = 0), then store returned values into GDT; ; see spec for details
The code that actually does the shutdown does indeed work in protected mode:
PowerDownProt32: mov ax,5307h ; APM Set Power State mov bx,1 ; all powered devicess mov cx,3 ; state = off call APM_SEL:APM_OFFS The only other variation is 16-bit pmode code, which is almost identical.
Ed
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.