pc motherboard power down
CASTalk.com Forum Index CASTalk.com
Discussion of DSP, FPGA, storage and embedded system.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web castalk.com
pc motherboard power down

 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Embedded System
Author Message
Steve West
Guest





Posted: Mon Dec 06, 2004 8:57 pm    Post subject: pc motherboard power down Reply with quote

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
Back to top
Frank Bemelman
Guest





Posted: Mon Dec 06, 2004 9:21 pm    Post subject: Re: pc motherboard power down Reply with quote

"Steve West" <misc@sgwest.com> schreef in bericht
news:Oj%sd.151975$5K2.31443@attbi_s03...
Quote:
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.

If the flavour of your motherboard's powermanagement is APM 1.2
try this:

http://web.mit.edu/afs/sipb/contrib/doc/specs/protocol/apm12.pdf

--
Thanks, Frank.
(remove 'q' and 'invalid' when replying by email)
Back to top
Steve West
Guest





Posted: Mon Dec 06, 2004 9:34 pm    Post subject: Re: pc motherboard power down Reply with quote

Quote:
If the flavour of your motherboard's powermanagement is APM 1.2
try this:

http://web.mit.edu/afs/sipb/contrib/doc/specs/protocol/apm12.pdf

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
Back to top
Frank Bemelman
Guest





Posted: Mon Dec 06, 2004 10:05 pm    Post subject: Re: pc motherboard power down Reply with quote

"Steve West" <misc@sgwest.com> schreef in bericht
news:ES%sd.152034$5K2.125825@attbi_s03...
Quote:

If the flavour of your motherboard's powermanagement is APM 1.2
try this:

http://web.mit.edu/afs/sipb/contrib/doc/specs/protocol/apm12.pdf

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).

Well, 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)
Back to top
Nicholas O. Lindan
Guest





Posted: Tue Dec 07, 2004 1:22 am    Post subject: Re: pc motherboard power down Reply with quote

"Steve West" <misc@sgwest.com> wrote

Quote:
This looks like you need a power management driver to talk to the bios. We
are running protected mode ... [forever & ever] ...

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/
Back to top
Ed Beroset
Guest





Posted: Tue Dec 07, 2004 6:44 am    Post subject: Re: pc motherboard power down Reply with quote

Steve West wrote:
Quote:
If the flavour of your motherboard's powermanagement is APM 1.2
try this:

http://web.mit.edu/afs/sipb/contrib/doc/specs/protocol/apm12.pdf


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).

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
Back to top
Tauno Voipio
Guest





Posted: Tue Dec 07, 2004 12:01 pm    Post subject: Re: pc motherboard power down Reply with quote

Ed Beroset wrote:
Quote:
Steve West wrote:

If the flavour of your motherboard's powermanagement is APM 1.2
try this:

http://web.mit.edu/afs/sipb/contrib/doc/specs/protocol/apm12.pdf


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).


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
Back to top
Ed Beroset
Guest





Posted: Tue Dec 07, 2004 4:54 pm    Post subject: Re: pc motherboard power down Reply with quote

Tauno Voipio wrote:
Quote:
Ed Beroset wrote:

Steve West wrote:

If the flavour of your motherboard's powermanagement is APM 1.2
try this:

http://web.mit.edu/afs/sipb/contrib/doc/specs/protocol/apm12.pdf


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).



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.



Please read again - this does not work in *protected mode*.

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
Back to top
 
Post new topic   Reply to topic    CASTalk.com Forum Index -> Embedded System All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




VoIP Electronics Powered by phpBB