[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: question about adding a field into linux boot header
From: |
Vladimir 'φ-coder/phcoder' Serbinenko |
Subject: |
Re: question about adding a field into linux boot header |
Date: |
Thu, 24 Mar 2011 09:35:52 +0100 |
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 |
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
> address@hidden
> http://lists.gnu.org/mailman/listinfo/grub-devel
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
signature.asc
Description: OpenPGP digital signature