-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/18/2014 01:33 AM, Z C wrote:
> If I boot into a linux kernel using a grub command like "linux
> /vmlinuz; inirtd /initrd; boot", how do I shutdown linux itself
> (but do not power off or reboot the computer hardware) and return
> back to the grub directly?

You can't.

> 
> What I meant is something equivalent to the "exit" command in most
> shells: If you are within one shell and you enter another shell,
> then if you want to quit the second shell and return back to the
> first shell, just simply type exit. All env variables and commands
> you previous typed in the first shell are completely intact.
> 
> Suppose I am now in the grub shell, and then I boot into a tiny
> linux kernel, say, a busybox shell, then what can I do to exit the
> second shell (i.e. busybox shell) and return to the first shell
> (i.e. grub shell)? Of course I can enter the grub shell again by
> simply rebooting the hardware, but this is not what I want.

When Linux boots, the kernel takes over the management of the computer
completely. The boot loader is not preserved in memory. Why would it
be? The function of the boot loader really is to just boot up the
computer and then get the heck out.

There are many, many obstacles to implementing something like this.
Not to mention the fact that in order to return to GRUB, you would
need to set the processor to return from protected mode into real
mode. All modern processors can do from real mode to protected mode
(which you must do to enabled 32 bit processing).

So, no. It isn't possible.

> 
> 
> 
> _______________________________________________ Grub-devel mailing
> list Grub-devel@gnu.org 
> https://lists.gnu.org/mailman/listinfo/grub-devel
> 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJTeOrsAAoJEFbRvtGxmFPEkRcIAIXPLokSPvjmBW/1xCVdsOqn
3AP7ZP/IQwNsFvvXUWczpjGDZAZIWSykHdB0zTl7xIYeT9cwEqzgVcZxNnV7riUr
lAKc8viq1ZpZpwR+9k3KOFXzeL63tpNOi2JYaRxnsVHuk/s7ASoDD80KfO+LoqYd
BoJ5XL/yxhYy7EoKkHAElgSQ68RFg3pdix2q4tjN205WvJoP1nfakITyhdiifxLW
Dm7l6LFUv2wn7HWpvJw722UHz6M5/wenXNLZwHejp/561gW+hiKzhT5pTs//p4y/
NOqFrY9W+Q5z8PyIH0AYFDCDmg6Pi04dezEoEGr4c4SFs2N9weMRlVnJpqN48pc=
=rftU
-----END PGP SIGNATURE-----

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to