Performing a Software Reset from Linux 7.2 to cause a reboot of the x86 processor
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Performing a Software Reset from Linux 7.2 to cause a reboot of the x86 processor
I am running Redhat Linux 7.2 and I am interested in performing a software reset from within Linux so that the hardware reboots after performing the reset. I have found various solutions to this problem on the web, but none have seemed to work! If you have a solution to my problem, your input would be greatly appreciated! Thank you very much!
I tried "/sbin/modprobe apm" and I got the following error message "Can't locate module module apm". I even tried "/sbin/modprobe /usr/bin/apm" and I got the following response: "modprobe: can't locate module /usr/bin/apm". What am I doing wrong Finegan??? And, once I have this going on the command line, how do I incorporate this functionality into my "C" code??? Your assistance is greatly appreciated!!! Thank you so very much!
Apm is a program and a kernel module, its a driver, Advanced Power Management. It was replaced with a standard know as ACPI, but the Linux kernel didn't support that until 2.4.20-ish, and RedHat never released on it... no matter, acpi is useful for laptops, apm is simple bios interaction.
apmd is the daemon that goes along with it that can control various aspects of power management. Offhand its usually /usr/sbin/apmd
Apm might have been built into your kernel, but RH might have just not compiled in the necessary aspect for real mode power off, there are a bunch of options for apm in the kernel compile. Let's see if they compiled apm directly into the kernel:
dmesg | grep apm
Should pop back something like:
root@sidearm:~# dmesg | grep apm
apm: BIOS version 1.2 Flags 0x03 (Driver version 1.16)
If it returns nothing... and there's no module. I'm a bit perplexed because I remember the old rh7.2 kernel had it, I ran that distro once for a little while on a laptop... or maybe it didn't, huh.
You could compile a new kernel, but all of that work for apm and real mode power off is a bit much, if you want to jump into kernel compiles, its worth it more if you're just wanting to learn about kernel compiling. Of course, RH7.2 is very very old now, not the best learning platform really.
I did what you said and I received the following result....
dmesg | grep apm
root@ESI:# dmesg | grep apm
apm: BIOS version 1.2 Flags 0x03 (Driver version 1.14)
Very similar to what you told me it should look like.
But, I still try and try your command (I tried "/sbin/modprobe apm" and I got the following error message "Can't locate module module apm".) I get the same error message despite the fact that the module is there and loaded!!!!
By the way, how do you implement this in C ????
Thank you very much for all of your time and consideration!
The module isn't there because its compiled directly in, but apparently without the option that allows for soft reset or halt... its a kernel recompile if you're up for it.
Implement what in C? The code necessary to do the reset is in the kernel, its just RH didn't compile it in...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.