Page 1 of 2

Reseting or Power off the PC

Posted: Wed Jan 10, 2007 8:16 am
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. :?: :?:

Posted: Wed Jan 10, 2007 8:26 am
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.

Posted: Wed Jan 10, 2007 8:29 am
by Solar
The precursor of ACPI was APM. Before that, any such feature was system-specific, IIRC.

Re: Reseting or Power off the PC

Posted: Wed Jan 10, 2007 8:38 am
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..

Posted: Wed Jan 10, 2007 7:53 pm
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 ).

Posted: Wed Jan 10, 2007 11:29 pm
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.

Posted: Thu Jan 11, 2007 4:06 am
by Solar
Keller wanted to know how to do the power off / reset on a system without ACPI...

Re: Reseting or Power off the PC

Posted: Thu Jan 11, 2007 5:15 am
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?

Re: Reseting or Power off the PC

Posted: Thu Jan 11, 2007 5:17 am
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.

Posted: Thu Jan 11, 2007 5:45 am
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"...

Posted: Thu Jan 11, 2007 8:47 am
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:

Re: Reseting or Power off the PC

Posted: Thu Jan 11, 2007 11:14 am
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.)

Posted: Thu Jan 11, 2007 11:36 am
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

Posted: Thu Jan 11, 2007 9:07 pm
by GLneo

Code: Select all

inline void reboot()
{
    volatile unsigned char good = 0x02;
    while ((good & 0x02) != 0)
        good = inportb(0x64);
    outportb(0x64, 0xFE);
}

Re: Reseting or Power off the PC

Posted: Fri Jan 12, 2007 10:43 am
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