Reseting or Power off the PC

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.
Jim
Member
Member
Posts: 27
Joined: Sun Nov 05, 2006 3:46 am

Reseting or Power off the PC

Post by Jim »

:shock: :shock: :shock:
Does any one know how to reset or power off an PC that doesn't support ACPI? for example Bochs. :?: :?:
urxae
Member
Member
Posts: 149
Joined: Sun Jul 30, 2006 8:16 am
Location: The Netherlands

Post by urxae »

Resetting is easy. Just provoke a triple fault.
The easiest way is to load an empty IDT and invoke an interrupt (or cause an exception).
Note that bochs or other VMs may pop up a message instead of resetting in certain configurations.

Powering down is not possible without hardware support AFAIK, so it may not be possible on all machines.
There may be more ways than ACPI, though. I don't know much about that so I'll let someone else answer that one.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

The precursor of ACPI was APM. Before that, any such feature was system-specific, IIRC.
Every good solution is obvious once you've found it.
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Reseting or Power off the PC

Post by Brynet-Inc »

keller wrote::shock: :shock: :shock:
Does any one know how to reset or power off an PC that doesn't support ACPI? for example Bochs. :?: :?:
Quite a few older systems (386/486 and Pentium 1 systems) have really a "direct" power off switch. Usually the switch runs directly into the PSU and turns off the power supply directly. (Kinda like the power switch on the back of most modern PSU's)

In modern systems the front power switch connects to the motherboard using 2 little wires, And it's behaviour is usually configurable in the BIOS or Operating system.

Most new systems don't even power off entirely.. (Sometimes the Ethernet light for example can stay powered on). This allows such technologies as WOL to work..
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
frank
Member
Member
Posts: 729
Joined: Sat Dec 30, 2006 2:31 pm
Location: East Coast, USA

Post by frank »

In my OS I use APM though the BIOS. It has worked on every computer I have tried included emulators ( BOCHS, MS Virtual PC, QEMU ).

I don't know if you can use it directly from protected mode, however, that shouldn't be that big of an problem( you could just return to real mode ).
smbogan
Member
Member
Posts: 29
Joined: Tue Nov 21, 2006 3:17 pm

Post by smbogan »

I hope you don't lose your eyesight reading this, but here's the specification for acpi. May be helpful.
http://www.acpi.info/DOWNLOADS/ACPIspec30b.pdf
This also might tell you about Intels implementation of ACPI-CA:
http://developer.intel.com/technology/i ... nloads.htm

The second link actually has utilities, that may help you. But I've never done anything with ACPI, so...good luck.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

Keller wanted to know how to do the power off / reset on a system without ACPI...
Every good solution is obvious once you've found it.
Jules
Member
Member
Posts: 30
Joined: Mon Jan 08, 2007 3:19 am
Location: UK

Re: Reseting or Power off the PC

Post by Jules »

keller wrote::shock: :shock: :shock:
Does any one know how to reset or power off an PC that doesn't support ACPI? for example Bochs. :?: :?:
Ask the user to press the power button?
Jules
Member
Member
Posts: 30
Joined: Mon Jan 08, 2007 3:19 am
Location: UK

Re: Reseting or Power off the PC

Post by Jules »

Brynet-Inc wrote: Quite a few older systems (386/486 and Pentium 1 systems) have really a "direct" power off switch. Usually the switch runs directly into the PSU and turns off the power supply directly. (Kinda like the power switch on the back of most modern PSU's)
I have a Pentium 2 system with such an arrangement. I'm not sure when exactly it died out, but it was with the transition from AT to ATX cases.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

Well, power-on-LAN or power-on-Call or power-on-time are usefull services, and quite obviously not possible if the PSU is "hard disconnected". Unfortunately the electronics industry has still not mastered the art of "powerless standby"...
Every good solution is obvious once you've found it.
smbogan
Member
Member
Posts: 29
Joined: Tue Nov 21, 2006 3:17 pm

Post by smbogan »

Solar wrote:Keller wanted to know how to do the power off / reset on a system without ACPI...
wow...you're right...apparently, I'm blind... :wink:
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: Reseting or Power off the PC

Post by Brynet-Inc »

Jules wrote:I have a Pentium 2 system with such an arrangement. I'm not sure when exactly it died out, but it was with the transition from AT to ATX cases.
You know I've never seen a Pentium 2 in an AT form factor! :lol:

586-class socket 7 was the newest I've seen that used AT.. I did used to get annoyed during the AT to ATX transition though. Some motherboard manufactures actually started adding connectors for both PSU types. (For a short time..)

But yes, In short.. keller seems to be asking if it's possible to turn off these older systems without using the Hard power-off button. It's not possible.. Sorry :wink:

You certainly can make a Shutdown-like sequence though, Disable things and print a message like the evil Windows 95. :roll:
(It is now safe to turn off your computer.)
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
Mike
Member
Member
Posts: 25
Joined: Tue Oct 17, 2006 7:57 pm

Post by Mike »

APM is pretty simple; it is actually very useful for QEMU so you can create a keyboard shortcut for power-off! It is not supported, however, on my Dell Latitude D820 laptop.

But if "without ACPI" includes "without APM", I'm afraid Brynet is right. About the best you can do is print out a "Please turn off your computer" message. Just do it in a better way than W95: A 640x240 bitmap stretched out to 640x480 saved as a .sys file instead of a .bmp file... Now that was pretty awful!

Mike
GLneo
Member
Member
Posts: 237
Joined: Wed Dec 20, 2006 7:56 pm

Post by GLneo »

Code: Select all

inline void reboot()
{
    volatile unsigned char good = 0x02;
    while ((good & 0x02) != 0)
        good = inportb(0x64);
    outportb(0x64, 0xFE);
}
User avatar
JAAman
Member
Member
Posts: 879
Joined: Wed Oct 27, 2004 11:00 pm
Location: WA

Re: Reseting or Power off the PC

Post by JAAman »

Brynet-Inc wrote: You know I've never seen a Pentium 2 in an AT form factor! :lol:

586-class socket 7 was the newest I've seen that used AT.. I did used to get annoyed during the AT to ATX transition though. Some motherboard manufactures actually started adding connectors for both PSU types. (For a short time..)
yes, i have some slot 1 AT systems (though most support both AT/ATX power connecters, they can only support AT cases -- ATX changed not only the power connector, but also the position of the ports)
You certainly can make a Shutdown-like sequence though, Disable things and print a message like the evil Windows 95. :roll:
(It is now safe to turn off your computer.)
win95 does support auto-shut-down, and only displays that message if it doesnt have proper drivers, and the system doesnt support the 'default' APM method (this same is true of win98/XP -- both will display the same message as win95 does on some MBs (but not all) if you dont have the chipset drivers loaded) -- and win95 will shut down bochs
Post Reply