From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Y4ZjH-0000jQ-Va for mharc-grub-devel@gnu.org; Fri, 26 Dec 2014 13:35:15 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y4ZjG-0000jK-47 for grub-devel@gnu.org; Fri, 26 Dec 2014 13:35:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Y4ZjC-0008Po-TA for grub-devel@gnu.org; Fri, 26 Dec 2014 13:35:14 -0500 Received: from mail-lb0-x229.google.com ([2a00:1450:4010:c04::229]:37685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Y4ZjC-0008Pg-Kr for grub-devel@gnu.org; Fri, 26 Dec 2014 13:35:10 -0500 Received: by mail-lb0-f169.google.com with SMTP id p9so8785174lbv.14 for ; Fri, 26 Dec 2014 10:35:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=2ILkcHtb83se0zAYldB4F+CX+Y8CpVJ5epN6LrwCnz8=; b=VLYEQ/cQ4+c6fwIBn2ehBcU4OpPWyHe9MSHUSICi4OPF1ko8a7jNxQhnVSqeZRAS8V QwMCtvBTFo5EdSdCCPtyyvP94mBqLL8DeAWHc5OeePMc7XVY4weoXXMRpOOkQK8TCqQI bebCJYz8/HkgoDfjjOzxb9qzlLnaJalbyVwSBboP31UCk9hEsMJQRZLT9nHWgydu8qwb s8ciyoPp6DPBIbBGcEv6PO5yADUnu0dD6/Fh9embVo3x0E+8Qp6kYGe9C6x3BBsW1ldp jx5x3h5R4pptwMACG1OivjgFN92gBLLk5Ntd1POYX83gS7SuRMs1nY9Gvp5P+2Utv2is biSw== X-Received: by 10.152.22.199 with SMTP id g7mr44892171laf.23.1419618909702; Fri, 26 Dec 2014 10:35:09 -0800 (PST) Received: from opensuse.site (ppp91-76-14-38.pppoe.mtu-net.ru. [91.76.14.38]) by mx.google.com with ESMTPSA id 10sm8073767lar.24.2014.12.26.10.35.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Dec 2014 10:35:08 -0800 (PST) Date: Fri, 26 Dec 2014 21:35:06 +0300 From: Andrei Borzenkov To: Alexander Kuleshov Subject: Re: esp register value after jump to linux Message-ID: <20141226213506.79b1cd4b@opensuse.site> In-Reply-To: References: X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.25; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::229 Cc: grub-devel@gnu.org 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: Fri, 26 Dec 2014 18:35:15 -0000 =D0=92 Thu, 25 Dec 2014 00:59:36 +0600 Alexander Kuleshov =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > Hello all, >=20 > I see that grub setups registers before jump to linux kernel at > grub/grub-core/loader/i386/pc/linux.c: >=20 > grub_linux16_boot (void) >=20 > { >=20 > ... >=20 > state.gs =3D state.fs =3D state.es =3D state.Tds =3D state.ss =3D segme= nt; >=20 > state.sp =3D GRUB_LINUX_SETUP_STACK; >=20 > state.cs =3D segment + 0x20; >=20 > state.ip =3D 0; >=20 > ... >=20 > } >=20 > I see in gdb that: ss, ds, and other segment registers are 0x1000, and > cs is 0x1020. It is good. But why esp is 0xf7f4? I see that > GRUB_LINUX_SETUP_STACK is 0x9000. >=20 It is absolutely unclear at which point, where and how you get content of ESP.