From: htmldeveloper@gmail.com (Peter Teoh)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Procedure Linux follows for shutting down an x86 system when ACPI is not used
Date: Wed, 15 Jun 2011 15:55:19 +0800 [thread overview]
Message-ID: <BANLkTikE7FC1JZDr-8wNk-BzFs0qGHdCXg@mail.gmail.com> (raw)
In-Reply-To: <SNT111-DS114E50FBE649F37C23D54EA7680@phx.gbl>
To shutdown the CPU, it is just the command "halt" in assembly, but to
shutdown the system' powersupply, and all other component, nowdays it is
hardwired to ACPI, eg:
http://www.thinkwiki.org/wiki/How_to_make_APM_work
http://tuxmobil.org/apm_linux.html
http://www.linuxdocs.org/HOWTOs/mini/Battery-Powered-3.html
<http://forums.anandtech.com/showthread.php?t=487583>So without ACPI, as
mentioned in URL above, alternative is APM. Alternatively if u are talking
about SMM/SMI, yes, sounds logical, as that is how system can shutdown
itself after detecting overheating in motherboard (for example) -
temperature monitoring is part of SMM mode. But I am not sure if u can
trigger SMI that specifically shutdown system or not. (software trigger for
SMI is possible ....port 0xb2)
http://en.wikipedia.org/wiki/System_Management_Mode
Do aware that Intel VT (VMM) can intercept these SMI too:
http://software.intel.com/en-us/forums/showthread.php?t=67301
On Wed, Jun 15, 2011 at 3:53 AM, limp <johnkyr83@hotmail.com> wrote:
> Hi all,
>
> I am trying to figure out the procedure that Linux follows for shutting
> down
> an x86 based system when ACPI is not used. From what I've found, when we
> try
> to shutdown the system from user-space, _reboot() system call is called
> with
> "LINUX_REBOOT_CMD_POWER_OFF" as argument. By tracking down the steps
> performed in the kernel when the aforementioned system call is involved, I
> ended up in kernel_power_off(), unlock_kernel(), and finaly do_exit()
> functions.
>
> The kernel_power_off() ultimately calls the native_machine_shutdown() form
> which Linux disables LAPIC, I/O APIC, HPET, etc. Then, after calling the
> unlock_kernel(), the do_exit() is called for ultimately shutting down the
> system. In the end of this function, I can see that the processor enters an
> infinite loop from which it repeatedly executes NOP instructions. That is
> actually the behaviour that I experience when I am not using ACPI; the
> system is not actually turning off but it goes into an idle state.
>
> Is this how Linux should act when ACPI is not used? I would expect in this
> case Linux to invoke an SMI so that the appropriate SMI function actually
> shutdown the system but I can't see where (and if) that takes place.
>
> Any help will be greatly appreciated.
>
> John K.
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
--
Regards,
Peter Teoh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110615/4a066476/attachment.html
prev parent reply other threads:[~2011-06-15 7:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-14 19:53 Procedure Linux follows for shutting down an x86 system when ACPI is not used limp
2011-06-15 7:55 ` Peter Teoh [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTikE7FC1JZDr-8wNk-BzFs0qGHdCXg@mail.gmail.com \
--to=htmldeveloper@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).