Page 1 of 1
GRUB2 not finding grub.cfg, doesn't provide memory map
Posted: Tue Jun 18, 2013 3:34 am
by zhiayang
GRUB problems. So I finally managed to get
both a working GRUB2 disk image,
and have it mount in OS X.
BUT. GRUB2 boots up fine, it's 2.00 from the FTP. I installed GRUB with this command:
Code: Select all
grub-install --modules="part_msdos multiboot fat help configfile biosdisk" disk.img
It seems that I would have the modules I need (namely biosdisk, part_msdos and fat)... But it doesn't work. I have the GRUB config file in the right place, but it doesn't find it. I have a hypothesis:
Once in the root prompt, root=(hd0)
However, <ls> shows a (hd0,msdos1) that is the actual partition with the files on it.
I need either need to specify (hd0,msdos1) or set root=(hd0,msdos1). Only then, will configfile /boot/grub/grub.cfg find the file.
I (obviously) need to do this automatically; any ideas?
Next: GRUB2 apparently doesn't set the flags properly.
Code: Select all
if(!(MBTStruct->flags & (1 << 6)))
returns false.
I'm using multiboot1 to boot my kernel.
Help?
Re: GRUB2 not finding grub.cfg, doesn't provide memory map
Posted: Tue Jun 18, 2013 7:23 am
by egos
grub-install isn't capable to install into partition of disk.img. Search with "grub-install, disk image/disk.img".
Edited. Alternatively you can use modified GRUB 2 after installing stage 0 and stage 1 into disk image by
Yoda's boot.
Edited. Show your core.img from the disk image. I can check it.
Re: GRUB2 not finding grub.cfg, doesn't provide memory map
Posted: Tue Jun 18, 2013 11:17 am
by zhiayang
Well this is futile. I don't even know why they decided to put the multiboot info after the kernel... Honestly lower memory was fine.
I appear to be trashing it, and I really can't be bothered anymore.
I've got the disk image and installed Grub legacy on it. Works better anyway.
Thanks egos and sorry for wasting your precious time.
Re: GRUB2 not finding grub.cfg, doesn't provide memory map
Posted: Tue Jun 18, 2013 12:42 pm
by xenos
Yes, GRUB2 seems to prefer higher memory locations. I had the same problem, trashing the multiboot info. Finally I solved it by reserving all memory that is needed before reading the multiboot info in the .bss section, so GRUB2 won't put anything there.
Re: GRUB2 not finding grub.cfg, doesn't provide memory map
Posted: Tue Jun 18, 2013 1:07 pm
by Mikemk
egos wrote:grub-install isn't capable to install into partition of disk.img. Search with "grub-install, disk image/disk.img"
Actually, i have a method for doing so.
Create a blank image using dd or similiar. Then download a linux live iso with a partition editor and grub-install. After that, simply do the usb instructions
inside of an emulator
Re: GRUB2 not finding grub.cfg, doesn't provide memory map
Posted: Tue Jun 18, 2013 3:00 pm
by egos
XenOS wrote:Yes, GRUB2 seems to prefer higher memory locations. I had the same problem, trashing the multiboot info. Finally I solved it by reserving all memory that is needed before reading the multiboot info in the .bss section, so GRUB2 won't put anything there.
Yes, I use same method to reserve space for additional module which is used if the module initially was loaded into base memory (it should be a final location). I use this technique instead of memmove (that works correctly with overlapped buffers). I read all required multiboot info before using any "outside" memory.
m12 wrote:Actually, i have a method for doing so.
It's a good approach, but it isn't always convenient/suitable.
Re: GRUB2 not finding grub.cfg, doesn't provide memory map
Posted: Tue Jun 18, 2013 6:18 pm
by Mikemk
egos wrote:m12 wrote:Actually, i have a method for doing so.
It's a good approach, but it isn't always convenient/suitable.
First, I'll agree that it's not convenient. Second, until an actual way of installing grub 2 to a disk image becomes available, it's about the only reliable option.