From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Q2g1d-0004sx-BR for mharc-grub-devel@gnu.org; Thu, 24 Mar 2011 04:36:13 -0400 Received: from [140.186.70.92] (port=44579 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2g1X-0004qA-G8 for grub-devel@gnu.org; Thu, 24 Mar 2011 04:36:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2g1W-0006G4-A2 for grub-devel@gnu.org; Thu, 24 Mar 2011 04:36:07 -0400 Received: from mail-ww0-f49.google.com ([74.125.82.49]:54658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2g1W-0006Ei-1L for grub-devel@gnu.org; Thu, 24 Mar 2011 04:36:06 -0400 Received: by wwc33 with SMTP id 33so9832620wwc.30 for ; Thu, 24 Mar 2011 01:36:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:x-enigmail-version:content-type; bh=r8S9tQawhHqUigdkDGbG9JoT0GObRjjZv3ORcezKQcA=; b=R0DTi8x2WEAKdrmrtZl7NBSqTL5t+bvm5gA0neOqzyK7quxDg/i9PmNR0EJgjS1ulp ugBDPHq9G9zU/pXp6NaqH9Z9v1DqV74CjwneAhgd9P3PdWvYXbjHn7VQK+ewT4P1g9yD lKML3F+c2MaMoWN8WyDNo3bpRiu0XnnUmoyrA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:x-enigmail-version:content-type; b=tzO04kst70x3S92dmQIxR3FS0Hx/QE7A+QFeCxhssxAM5Dd0biJ46EzcszsLLbc0Yu xiEzHZWPIdpMGgGLkW22fCEgVhaZ3bfbkJT0wEYn0m/bMKnH39WH5NKExInVhHAaf7sr jd2JXgwSHt/VlAvZ84pa1F2ir39+J6wTwkFpg= Received: by 10.216.239.65 with SMTP id b43mr7212777wer.29.1300955764954; Thu, 24 Mar 2011 01:36:04 -0700 (PDT) Received: from debian.x201.phnet (gprs31.swisscom-mobile.ch [193.247.250.31]) by mx.google.com with ESMTPS id t5sm3641093wes.33.2011.03.24.01.36.02 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 24 Mar 2011 01:36:03 -0700 (PDT) Message-ID: <4D8B0268.3040102@gmail.com> Date: Thu, 24 Mar 2011 09:35:52 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20110303 Iceowl/1.0b1 Icedove/3.0.11 MIME-Version: 1.0 To: grub-devel@gnu.org References: In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig37864F9ABB55CA0D1B0C87BF" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.49 Subject: Re: question about adding a field into linux boot header X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 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: Thu, 24 Mar 2011 08:36:12 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig37864F9ABB55CA0D1B0C87BF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 24.03.2011 09:12, GuoMinskey wrote: > > > I want to use setup_data fields of linux boot header, but grub doesn't= > support it. So, I cone latest grub repo (1.99) and modify grub code as= > follows: > > > 1. in include/grub/i386/linux.h, =20 > > struct linux_kernel_header > { > @@ -130,6 +144,8 @@ > grub_uint16_t pad1; /* Unused */ > grub_uint32_t cmd_line_ptr; /* Points to the kernel command line */ > grub_uint32_t initrd_addr_max; /* Highest address for initrd = */ > + grub_uint32_t pad2[8]; > + grub_uint64_t new_field; <-------------- aligned to the offset > : 0x250 as linux > } __attribute__ ((packed)); > > > 2. grub-core/loader/i386/linux.c > > I add a command by following "initrd", but simply as follows: > > static grub_err_t > grub_cmd_test(cmd, argc, argv[]) > { > grub_printf("entering my test command\n"); > > ... //ensure kernel is loaded > =20 > struct linux_kernel_header *lh =3D (struct > linux_kernel_header *) real_mode_mem; =20 > lh->new_field =3D 0x34FFFFFF; > } > =20 Could you paste the whole code in question rather than let us gues what happens in "..." or how you set your lh variable > =20 > when I boot GRUB with my command, GRUB panic in relocator. Could you please avoid paraphrasing and give exact error? Also please try with debug=3Drelocator and supply the output > I print the kernel > header, seems the header is there ( I mean real_mode_mem). If I > removed the line > "lh->new_field =3D 0x34FFFFFF", GRUB can work. =20 > > Did I miss something if I want pass this field into linux kernel ? > > > thanks, > -minskey=20 > > =20 > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/grub-devel > =20 --=20 Regards Vladimir '=CF=86-coder/phcoder' Serbinenko --------------enig37864F9ABB55CA0D1B0C87BF 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.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAk2LAmgACgkQNak7dOguQgmhlgD/VibKcL8hTfJ83IrPV0yRatfe YmtUcZMYmkDEVAj5dDUBALD+LR19hLxmF3y87GqscBmk98nVtvWMgIY76VjS6PAe =oXSx -----END PGP SIGNATURE----- --------------enig37864F9ABB55CA0D1B0C87BF--