Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Detect ATX Power Supply

BretBret Member Posts: 114
Does anybody know of a "generic" way to detect whether a computer has an AT or ATX power supply? It seems like there should be a bit set somewhere in the CMOS or BIOS that would tell you, but I can't seem to find any references.

Comments

  • jeffleydajeffleyda Member Posts: 390
    : Does anybody know of a "generic" way to detect whether a computer
    : has an AT or ATX power supply? It seems like there should be a bit
    : set somewhere in the CMOS or BIOS that would tell you, but I can't
    : seem to find any references.

    wow. aside from ACPI or DMI/SMBIOS perhaps, I don't think that's possible to do.
    ACPI should have a soft-off capability flag somewhere, or even checking if ACPI is installed should tell you that. There are likely ATX power supplies installed in non ACPI machines though. Perhaps you don't have to go so far as ACPI, just APM's power off functions might tell you.

    -jeff!
  • BretBret Member Posts: 114
    : : Does anybody know of a "generic" way to detect whether a computer
    : : has an AT or ATX power supply? It seems like there should be a bit
    : : set somewhere in the CMOS or BIOS that would tell you, but I can't
    : : seem to find any references.
    :
    : wow. aside from ACPI or DMI/SMBIOS perhaps, I don't think that's
    : possible to do.
    : ACPI should have a soft-off capability flag somewhere, or even
    : checking if ACPI is installed should tell you that. There are
    : likely ATX power supplies installed in non ACPI machines though.
    : Perhaps you don't have to go so far as ACPI, just APM's power off
    : functions might tell you.
    :
    : -jeff!

    I have a computer where the motherboard will accept either type of Power Supply, and right now it is in an AT case. One of the things I'm trying to do is shut down the computer, which of course isn't possible unless it's in an ATX case. Unfortunately, all of the settings in APM and ACPI tell me that I can shut it down. Apparently, the BIOS either doesn't know or doesn't care what kind of Power Supply is installed, and just assumes it's ATX.

    When I issue the shut down request, it acts like it works, the screen does some funny stuff, but the computer doesn't shut down. The BIOS is obviously doing something to the hardware (at least the video hardware), though I don't know exactly what that is. I don't think the computer can be trusted after a failed shut down, so I don't want the user trying to do anything after that happens.

    Right now, my response to all of this is just to tell the user that they need to turn it off using the power switch. I could lock up the computer (like issue a CLI and never issue an STI) to force them to use the power switch, but I don't. I could also reboot the computer, but I want to shut it down, not reboot it.

    So, I would like to be able to determine what kind of Power Supply is installed ahead of time so I can write a well-behaved program. I'll try looking at SMBIOS and see if I can discover amything in there.
  • BretBret Member Posts: 114
    : : : Does anybody know of a "generic" way to detect whether a computer
    : : : has an AT or ATX power supply? It seems like there should be a bit
    : : : set somewhere in the CMOS or BIOS that would tell you, but I can't
    : : : seem to find any references.
    : :
    : : wow. aside from ACPI or DMI/SMBIOS perhaps, I don't think that's
    : : possible to do.
    : : ACPI should have a soft-off capability flag somewhere, or even
    : : checking if ACPI is installed should tell you that. There are
    : : likely ATX power supplies installed in non ACPI machines though.
    : : Perhaps you don't have to go so far as ACPI, just APM's power off
    : : functions might tell you.
    : :
    : : -jeff!
    :
    : I have a computer where the motherboard will accept either type of
    : Power Supply, and right now it is in an AT case. One of the things
    : I'm trying to do is shut down the computer, which of course isn't
    : possible unless it's in an ATX case. Unfortunately, all of the
    : settings in APM and ACPI tell me that I can shut it down.
    : Apparently, the BIOS either doesn't know or doesn't care what kind
    : of Power Supply is installed, and just assumes it's ATX.
    :
    : When I issue the shut down request, it acts like it works, the
    : screen does some funny stuff, but the computer doesn't shut down.
    : The BIOS is obviously doing something to the hardware (at least the
    : video hardware), though I don't know exactly what that is. I don't
    : think the computer can be trusted after a failed shut down, so I
    : don't want the user trying to do anything after that happens.
    :
    : Right now, my response to all of this is just to tell the user that
    : they need to turn it off using the power switch. I could lock up
    : the computer (like issue a CLI and never issue an STI) to force them
    : to use the power switch, but I don't. I could also reboot the
    : computer, but I want to shut it down, not reboot it.
    :
    : So, I would like to be able to determine what kind of Power Supply
    : is installed ahead of time so I can write a well-behaved program.
    : I'll try looking at SMBIOS and see if I can discover amything in
    : there.

    Well, I've scanned through the SMBIOS spec and there's nothing in there about the type of Power Supply (at least that I can find). There's some other interesting stuff, though, like the number of Power Cords and the height of the Chassis. I guess they just assume that all computers have ATX power supplies these days, or that you're not supposed to care.

    I think I may just tell the user they need to use the power switch and then lock up the computer so they have to do it.
  • jeffleydajeffleyda Member Posts: 390
    : Well, I've scanned through the SMBIOS spec and there's nothing in
    : there about the type of Power Supply (at least that I can find).
    : There's some other interesting stuff, though, like the number of
    : Power Cords and the height of the Chassis. I guess they just assume
    : that all computers have ATX power supplies these days, or that
    : you're not supposed to care.

    SMBIOS is kinda cool from a "let's see what's in this box" perspective, but it's (IIRC) entirely just text sitting in memory space somewhere, there's no meat behind any of data; you can't call a routine to actually detect hardware, you just have to trust that the person putting all the data in was accurate.

    :
    : I think I may just tell the user they need to use the power switch
    : and then lock up the computer so they have to do it.

    I think so too. I've been doing hardware snooping and detection for years and I have never heard of a way of doing what you're trying to do. I've also never heard of a motherboard that can handle either AT or ATX power, so I've honestly never looked into even trying to detect it! ;)

    I suppose you could call the power down function, and after that print up a message saying "it's now safe to turn off your computer". Since if the power off works, they'll never know about the message!

    -jeff!
  • BretBret Member Posts: 114
    : : Well, I've scanned through the SMBIOS spec and there's nothing in
    : : there about the type of Power Supply (at least that I can find).
    : : There's some other interesting stuff, though, like the number of
    : : Power Cords and the height of the Chassis. I guess they just assume
    : : that all computers have ATX power supplies these days, or that
    : : you're not supposed to care.
    :
    : SMBIOS is kinda cool from a "let's see what's in this box"
    : perspective, but it's (IIRC) entirely just text sitting in memory
    : space somewhere, there's no meat behind any of data; you can't call
    : a routine to actually detect hardware, you just have to trust that
    : the person putting all the data in was accurate.
    :
    : :
    : : I think I may just tell the user they need to use the power switch
    : : and then lock up the computer so they have to do it.
    :
    : I think so too. I've been doing hardware snooping and detection for
    : years and I have never heard of a way of doing what you're trying to
    : do. I've also never heard of a motherboard that can handle either
    : AT or ATX power, so I've honestly never looked into even trying to
    : detect it! ;)
    :
    : I suppose you could call the power down function, and after that
    : print up a message saying "it's now safe to turn off your computer".
    : Since if the power off works, they'll never know about the message!
    :
    : -jeff!

    : I suppose you could call the power down function, and after that
    : print up a message saying "it's now safe to turn off your computer".
    : Since if the power off works, they'll never know about the message!

    That's exactly what I do. I flush the disk buffers, issue the power down request, wait a couple of seconds, write a message to the screen, and issue a CLI, HLT sequence. If the power down was successful, it never gets to the point where the message gets written. I wish there were a better way to do it, but it seems like there isn't.
Sign In or Register to comment.