From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: How to exit from linux kernel and return to then grub?
Date: Sun, 18 May 2014 19:46:17 +0200 [thread overview]
Message-ID: <5378F1E9.8020709@gmail.com> (raw)
In-Reply-To: <5378EAEC.8050605@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2423 bytes --]
On 18.05.2014 19:16, SevenBits wrote:
> 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).
>
Please update your sources. Last CPU that behaved like this is 286. 386
and later can switch between modes in any direction.
GRUB itself run in protected (but not paged mode) and switches to real
mode to call BIOS functions.
"Returning" to GRUB would be technically feasible but very cumbersome.
Original requester didn't even tell what his end goal is and it probably
can be achieved in much less cumbersome way.
> So, no. It isn't possible.
>
>
>
>
>> _______________________________________________ Grub-devel mailing
>> list Grub-devel@gnu.org
>> https://lists.gnu.org/mailman/listinfo/grub-devel
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
> .
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 274 bytes --]
next prev parent reply other threads:[~2014-05-18 17:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-18 5:33 How to exit from linux kernel and return to then grub? Z C
2014-05-18 14:43 ` Lennart Sorensen
2014-05-18 17:16 ` SevenBits
2014-05-18 17:46 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
2014-05-18 17:52 ` SevenBits
2014-05-18 17:23 ` SevenBits
2014-05-18 17:59 ` Chris Jones
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=5378F1E9.8020709@gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.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).