From: "Vladimir 'φ-coder/phcoder' Serbinenko" <phcoder@gmail.com>
To: grub-devel@gnu.org
Subject: Re: question about adding a field into linux boot header
Date: Thu, 24 Mar 2011 09:35:52 +0100 [thread overview]
Message-ID: <4D8B0268.3040102@gmail.com> (raw)
In-Reply-To: <BAY135-W15FA362E1DBC2C412B46F483B60@phx.gbl>
[-- Attachment #1: Type: text/plain, Size: 1981 bytes --]
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,
>
> 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
>
> struct linux_kernel_header *lh = (struct
> linux_kernel_header *) real_mode_mem;
> lh->new_field = 0x34FFFFFF;
> }
>
Could you paste the whole code in question rather than let us gues what
happens in "..." or how you set your lh variable
>
> 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=relocator 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 = 0x34FFFFFF", GRUB can work.
>
> Did I miss something if I want pass this field into linux kernel ?
>
>
> thanks,
> -minskey
>
>
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
next prev parent reply other threads:[~2011-03-24 8:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-24 8:12 question about adding a field into linux boot header GuoMinskey
2011-03-24 8:35 ` Vladimir 'φ-coder/phcoder' Serbinenko [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-03-29 3:29 GuoMinskey
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=4D8B0268.3040102@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.