🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

shutting down the computer (assembly language)

Started by
7 comments, last by AeroZeplyn 24 years, 3 months ago
i have this little DOS security program that runs on AUTOEXEC.BAT (im using Windows 98). if the person gets the password wrong 2 times, is there anyway i can turn the computer off with some x86 instructions, instead of relying on them to shut it off? if anyone knows, please reply! i''ve been trying to find the answer to this for quite some time. see ya! Aero
Advertisement
There are ways to reboot the computer with code, but actually shutting it off is not a standard procedure -- it must be supported by the system''s BIOS. This also means that the way it is done varies from system to system.
well, of course. but i was wondering if anyone out there actually knows the assembly instructions to shut down the computer? please help if anyone out there can!

thanks!
Aero
Why not just enable the password in the bios? If they type an incorrect password 3 times the system halts. Anything in autoexec can be bypassed by pressing f5, or using a boot disk.
"Do not meddle in the affairs of dragons kuz like, you are krunchy and taste good w/ketchup." -B.F. Dragon
well, the reason is kind of simple. its just basically that i want to learn how to shut down the computer with assembly code ... and this is not the only thing that my program does, it also allows "non-users" to access only certain shells for Windows that i allow them to choose. its kind of complicated.

...so if anyone out there knows the answer to my question, please do help!

Aero
i think that anonymous poster pretty much answered your question.. many computers do not shut off the computer when they''re shut down (from windows you get a black screen with "you may now safely shut down your computer", or something like that), the user has to turn it off physically. with these computers there is no other way to turn it off. it is not possible to power down through a program.
some computers can be powered down by software. as the anon said, it''s supported by the BIOS, so it''s going to be different from system to system. so you need to find out something about your BIOS.
(and if you want portability, it simply can''t be done)
I believe that a program to shutdown the computer is available as open source through the Litestep project, but it''s most likely that that program calls shell commands to do so.
thanks for all of your posts. by now i realize shutting down the computer with a program might not be as easy as i suspected. but thanks for all of your input! =)

see ya!
Aero
Look up Advanced Power Management under Ralf Brown's Interrupt List.

http://www.ctyme.com/intr/cat-031.htm

Note you have to do some initialization of the APM interface first but it's all in there.



Edited by - Strabbi on 3/17/00 12:41:04 PM
--If Train A leave San Francisco at 8:30am EST travelling 25mph and Train B leaves Chicago at 1:30pm MST travelling at 40mph, and they're 3000 miles apart when they start, what is the capital of Bulgaria?

This topic is closed to new replies.

Advertisement