About grub.cfg——Building coreboot with grub2 payload
Thank you for your help, I have changed my operation, but my coreboot
still step to grub.
/************************************* LOG *********************************************************/ Check fallback/payload
Got a payload
Loading segment from rom address 0xfff29ff8
data (compression=1)
New segment dstaddr 0x8200 memsize 0xd8b8 srcaddr 0xfff2a04c filesize0x3a69
(cleaned up) New segment addr 0x8200 size 0xd8b8 offset 0xfff2a04c
filesize 0x3a69
Loading segment from rom address 0xfff2a014
data (compression=1)
New segment dstaddr 0x15ab8 memsize 0x69914 srcaddr 0xfff2dab5
filesize 0x1d0c0
(cleaned up) New segment addr 0x15ab8 size 0x69914 offset 0xfff2dab5
filesize 0x1d0c0
Loading segment from rom address 0xfff2a030
Entry Point 0x00008200
Loading Segment: addr: 0x0000000000008200 memsz: 0x000000000000d8b8
filesz: 0x0000000000003a69
lb: [0x0000000000100000, 0x0000000000164000)
Post relocation: addr: 0x0000000000008200 memsz: 0x000000000000d8b8
filesz: 0x0000000000003a69
using LZMA
[ 0x00008200, 0000e51b, 0x00015ab8)<- fff2a04c
Clearing Segment: addr: 0x000000000000e51b memsz: 0x000000000000759d dest 00008200, end 00015ab8, bouncebuffer 7fe28000
Loading Segment: addr: 0x0000000000015ab8 memsz: 0x0000000000069914
filesz: 0x000000000001d0c0
lb: [0x0000000000100000, 0x0000000000164000)
Post relocation: addr: 0x0000000000015ab8 memsz: 0x0000000000069914
filesz: 0x000000000001d0c0
using LZMA
[ 0x00015ab8, 0007f3cc, 0x0007f3cc)<- fff2dab5
dest 00015ab8, end 0007f3cc, bouncebuffer 7fe28000
Loaded segments
Jumping to boot code at 8200
entry = 0x00008200lb_start = 0x00100000
lb_size = 0x00064000
adjust = 0x7fd8c000
buffer = 0x7fe28000
elf_boot_notes = 0x0011622cadjusted_boot_notes = 0x7fea222c
/****************************************************************************************************/ I have added "grub_printf("Enter grub_main()!\n")" in the top of
grub_main()(defined in grub-core/kern/main.c). Unfortunately, nothing
can be printed out when booting. I don't know it is stopped before grub
C code or I don't open some grub2 option which close the standard output
mode.
Quoted 66 lines
2011/5/31 Cui Lei<[email protected]>:
Quoted 21 lines
I am working hard at building coreboot with grub2 payload. Now I can build a grub2 payload as follow:
1: Download the lastest grub2 source code.
2: ./autogen.sh./configure --with-platform=coreboot make 3: Use grub-mkimage to generate a "payload.elf", detail: ./grub-mkimage -d . -O i386-coreboot -o ../coreboot-v4/payload.elf--prefix='/boot/grub2'
memdisk cpio -m ../memdisk.tarAccoding the coreboot website(http://www.coreboot.org/Talk:GRUB2),
memdisk is a virtual disk
in grub image and it is suggested that grub.cfg is contained in a
memdisk image. So I made
folders boot/grub2 in my work folder and add a new grub.cfg and some
modules(such as
memdisk.mod cpio.mod ...) into the boot/grub2, then tar boot/grub2 to
memdisk.tar(according
to the website tar can be used to build a memdisk image).Quoted 7 lines
Problems:
1: I don't know wether grub2 can found my grub.cfg ,if I set "
--prefix='/boot/grub2' " ?
On the coreboot website,a sample is --prefix='(ata0)/boot/grub2'. I
think the ata0 is hard disk.
but I use the memdisk image, what should I do ?I use this to create a custom grub2 efi app with memdisk embedded -
/bin/grub-mkimage--directory=/usr/lib/grub/x86_64-efi --memdisk="${memdisk_64_img}" --prefix='(memdisk)/efi/grub2' --format=x86_64-efi --compression=xz --output="${grub2_efi_mp}/efi/boot/bootx64.efi" ${GRUB2_MODULES}Hope this helps.
Quoted 10 lines
2: I want my grub.cfg in memdisk to load the grub.cfg from my hard disk.
Because I have install the
ubuntu11.04 on my hard disk, a grub.cfg file should be in the
/boot/grub. So my grub.cfg just like
this:
search -f -s/boot/grub/grub.cfg
configfile/boot/grub/grub.cfgIs this practicable?
Make it
search --file --no-floppy --set=root /boot/grub/grub.cfg configfile (${root})/boot/grub/grub.cfgQuoted 2 lines
3: I want the gurb can boot into the grub-shell, how to ?
I can't understand the question. You want grub to boot into grub-shell? Don't create a ${prefix}/grub.cfg file.
Quoted 4 lines
BRs,
Rock.C
Regards.
Keshav
Signature · 2 lines
coreboot mailing list: [email protected] http://www.coreboot.org/mailman/listinfo/coreboot
Quoted 49 lines · Rock Cui
Thank you for your help, I have changed my operation, but my coreboot
still step to grub.
/************************************* LOG *********************************************************/ Check fallback/payload
Got a payload
Loading segment from rom address0xfff29ff8
data (compression=1)
New segment dstaddr0x8200memsize0xd8b8srcaddr0xfff2a04cfilesize0x3a69
(cleaned up) New segment addr0x8200size0xd8b8offset0xfff2a04c
filesize0x3a69
Loading segment from rom address0xfff2a014
data (compression=1)
New segment dstaddr0x15ab8memsize0x69914srcaddr0xfff2dab5
filesize0x1d0c0
(cleaned up) New segment addr0x15ab8size0x69914offset0xfff2dab5
filesize0x1d0c0
Loading segment from rom address0xfff2a030
Entry Point0x00008200
Loading Segment: addr:0x0000000000008200memsz:0x000000000000d8b8
filesz:0x0000000000003a69
lb: [0x0000000000100000,0x0000000000164000)
Post relocation: addr:0x0000000000008200memsz:0x000000000000d8b8
filesz:0x0000000000003a69
using LZMA
[0x00008200,0000e51b, 0x00015ab8)<-fff2a04c
Clearing Segment: addr:0x000000000000e51bmemsz:0x000000000000759ddest 00008200, end00015ab8, bouncebuffer7fe28000
Loading Segment: addr:0x0000000000015ab8memsz:0x0000000000069914
filesz:0x000000000001d0c0
lb: [0x0000000000100000,0x0000000000164000)
Post relocation: addr:0x0000000000015ab8memsz:0x0000000000069914
filesz:0x000000000001d0c0
using LZMA
[0x00015ab8,0007f3cc, 0x0007f3cc)<-fff2dab5
dest00015ab8, end0007f3cc, bouncebuffer7fe28000
Loaded segments
Jumping to boot code at 8200
entry =0x00008200lb_start=0x00100000lb_size = 0x00064000 adjust = 0x7fd8c000 buffer = 0x7fe28000 elf_boot_notes = 0x0011622c
adjusted_boot_notes=0x7fea222c
Quoted 7 lines
/****************************************************************************************************/
I have added "
grub_printf("Enter grub_main()!\n")" in the top of grub_main()(defined ingrub-core/kern/main.c). Unfortunately, nothing can be printed out when booting. I don't know it is stopped before grub C code or I don't open some grub2 option which close the standard output mode.
This is guaranteed not to work. You try printing before console is inited.
Quoted 77 lines
Quoted 74 lines
2011/5/31 Cui Lei<[email protected]>:
Quoted 26 lines
I am working hard at building coreboot with grub2 payload. Now I
can build
a grub2 payload as follow:
1: Download the lastest grub2 source code.
2: ./autogen.sh./configure --with-platform=coreboot make 3: Use grub-mkimage to generate a "payload.elf", detail: ./grub-mkimage -d . -O i386-coreboot -o../coreboot-v4/payload.elf
--prefix='/boot/grub2'
memdisk cpio -m ../memdisk.tarAccoding the coreboot
website(http://www.coreboot.org/Talk:GRUB2),
memdisk is a virtual disk
in grub image and it is suggested that grub.cfg is contained in a
memdisk image. So I made
folders boot/grub2 in my work folder and add a new grub.cfg
and some
modules(such as
memdisk.mod cpio.mod ...) into the boot/grub2, then tar
boot/grub2 to
memdisk.tar(according
to the website tar can be used to build a memdisk image).Quoted 8 lines
Problems:
1: I don't know wether grub2 can found my grub.cfg ,if I set "
--prefix='/boot/grub2' " ?
On the coreboot website,a sample is
--prefix='(ata0)/boot/grub2'. I
think the ata0 is hard disk.
but I use the memdisk image, what should I do ?I use this to create a custom grub2 efi app with memdisk embedded -
/bin/grub-mkimage--directory=/usr/lib/grub/x86_64-efi --memdisk="${memdisk_64_img}" --prefix='(memdisk)/efi/grub2' --format=x86_64-efi --compression=xz --output="${grub2_efi_mp}/efi/boot/bootx64.efi" ${GRUB2_MODULES}Hope this helps.
Quoted 11 lines
2: I want my grub.cfg in memdisk to load the grub.cfg from my
hard disk.
Because I have install the
ubuntu11.04 on my hard disk, a grub.cfg file should be in the
/boot/grub. So my grub.cfg just like
this:
search -f -s/boot/grub/grub.cfgconfigfile/boot/grub/grub.cfgIs this practicable?
Make it
search --file --no-floppy --set=root /boot/grub/grub.cfg configfile (${root})/boot/grub/grub.cfgQuoted 2 lines
3: I want the gurb can boot into the grub-shell, how to ?
I can't understand the question. You want grub to boot into grub-shell? Don't create a ${prefix}/grub.cfg file.
Quoted 4 lines
BRs,
Rock.C
Regards.
Keshav
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko