pc motherboard power down

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
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



Re: pc motherboard power down
Quoted text here. Click to load it

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)



Re: pc motherboard power down

Quoted text here. Click to load it
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



Re: pc motherboard power down
Quoted text here. Click to load it
I

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)



Re: pc motherboard power down

Quoted text here. Click to load it

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.
We've slightly trimmed the long signature. Click to see the full one.
Re: pc motherboard power down
Quoted text here. Click to load it

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


Re: pc motherboard power down
Quoted text here. Click to load it

Ed:

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

--

Tauno Voipio
tauno voipio (at) iki fi


Re: pc motherboard power down
Quoted text here. Click to load it


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


Site Timeline