From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Wm5AV-0001Dq-7c for mharc-grub-devel@gnu.org; Sun, 18 May 2014 13:46:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60952) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wm5AO-0001Dg-Aq for grub-devel@gnu.org; Sun, 18 May 2014 13:46:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wm5AI-0007BP-J9 for grub-devel@gnu.org; Sun, 18 May 2014 13:46:32 -0400 Received: from mail-ee0-x229.google.com ([2a00:1450:4013:c00::229]:38048) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wm5AI-00079f-44 for grub-devel@gnu.org; Sun, 18 May 2014 13:46:26 -0400 Received: by mail-ee0-f41.google.com with SMTP id t10so2935896eei.0 for ; Sun, 18 May 2014 10:46:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=iQuM2oHfLMDgIYswkNkAAYOipGvMqE/SGSm6q1TlbbM=; b=ns4hkkDeUJw9aFItjsxrNA6F/dxFOx1IS/eSZp6915vJh/izHS2Pk+zxf3V8uCaGuY m6AY91AOHfjc71U5YQ+1WDoappwtkDnhoDQfSRxt9b+xhKZCkeXocmR4Y6H943NLYod+ QqbxMF+Y8gc9qmbUkn5CtWnStF3aUdF32XQGI7PYM1mXF8tgPeEjHZcq3xhuydkGwogb 62tR9YmsLVNNbkiWVUOtBVyEh0kcMbO2iAUIALP8OKSQR4i+UuV6Rer2ShO46qOKLkxf GtxnmGItBtXgBd8MPiWyYWgE/RrOGODzpF14z07HVlOPym9+UT2m4NG/SKQIUQou18sH b7Ng== X-Received: by 10.15.83.68 with SMTP id b44mr40226514eez.11.1400435185008; Sun, 18 May 2014 10:46:25 -0700 (PDT) Received: from [192.168.42.123] (151-236.197-178.cust.bluewin.ch. [178.197.236.151]) by mx.google.com with ESMTPSA id ci54sm35954916eeb.19.2014.05.18.10.46.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 18 May 2014 10:46:22 -0700 (PDT) Message-ID: <5378F1E9.8020709@gmail.com> Date: Sun, 18 May 2014 19:46:17 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.4.0 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: How to exit from linux kernel and return to then grub? References: <5378EAEC.8050605@gmail.com> In-Reply-To: <5378EAEC.8050605@gmail.com> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lO774pBxjNO2IsfA4a2QNo9qRHLqXVrTs" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::229 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 17:46:38 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --lO774pBxjNO2IsfA4a2QNo9qRHLqXVrTs Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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? >=20 > You can't. >=20 >=20 >> 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. >=20 >> 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. >=20 > 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. >=20 > 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). >=20 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. >=20 >=20 >=20 >=20 >> _______________________________________________ Grub-devel mailing >> list Grub-devel@gnu.org=20 >> https://lists.gnu.org/mailman/listinfo/grub-devel >=20 >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel > . >=20 --lO774pBxjNO2IsfA4a2QNo9qRHLqXVrTs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlN48eoACgkQmBXlbbo5nOvHoQD8CsSP5xBQJmKUiuHaAjJnaEsk CsbEXiWMFX4EMfheQ+0A/0ELnDN5+X0IK1Rm4ZX3V6HkuuoJsnv4xmSdEpXk+8S2 =mKUw -----END PGP SIGNATURE----- --lO774pBxjNO2IsfA4a2QNo9qRHLqXVrTs--