Page 2 of 2
Re: Trouble booting kernel with Grub legacy
Posted: Mon Nov 04, 2013 2:21 am
by egos
depletionmode wrote:I left the board at work so I can't check until tomorrow.
OK. This stub is based on the component of the project that I have found. If this stub will work you can try to build GRUB Legacy in Linux kernel format. Here are patched binaries of that project (I have cleaned them from some bugs):
loadbin-0.1-bin-win32-patched.zip
Usage:
Code: Select all
mkimage -d 0x80,0 ldgrub.bin stage2 grub.bin
I've attached 1kb of my kernel...
Well, I see Linux kernel format header v. 2.12.
Re: Trouble booting kernel with Grub legacy
Posted: Tue Nov 05, 2013 6:38 am
by depletionmode
Same story with the latest stub "Cannot read linux header".
It must differ in some way with the Linux kernel header that does work...
Re: Trouble booting kernel with Grub legacy
Posted: Tue Nov 05, 2013 8:23 am
by egos
Well, I will make a stub with header v. 2.12 used.
Re: Trouble booting kernel with Grub legacy
Posted: Tue Nov 05, 2013 8:31 am
by depletionmode
Thanks so much!
Re: Trouble booting kernel with Grub legacy
Posted: Thu Nov 07, 2013 6:28 am
by egos
I've taken a look on lnxboot.img from GRUB 2. It still uses the header v. 2.03. So the problem could be in my linuxstub(s). Try to load both binaries from
this archive by your boot loader.
Re: Trouble booting kernel with Grub legacy
Posted: Thu Nov 07, 2013 7:20 am
by depletionmode
WHOOHOO Grub seems to like them both! Thanks!
Hard to know if they're being executed properly but at least Grub seems to be loading them ok.
How do I convert my flat kernel into this format?
Re: Trouble booting kernel with Grub legacy
Posted: Thu Nov 07, 2013 8:52 am
by egos
depletionmode wrote:How do I convert my flat kernel into this format?
I'm thinking about it. Meanwhile you can use following boot sequence: your boot loader -> GRUB Legacy (or GRUB 2) in Linux kernel format -> your kernel in ELF format (with short Multiboot header).
File lnxgrub.bin from archive is a complete stage2 of GRUB Legacy. You can use it right now. Just edit boot disk number (offset 0x260), boot partition number (offset 0x261, use value 0xFF for whole disks), config file name (offset 0x617, it's zero-terminated string) if it is need. I used following command to build this image:
Code: Select all
mkimage -d 0x80,0 ldgrub.bin stage2 lnxgrub.bin
File lnxgrub2.bin from archive is a core of GRUB 2. To use it you should put additional modules and other files into /boot/grub/i386-pc (you can find a minimal file collection in sys-grubldr-2.13-compact-add.zip). You can edit boot disk number and boot partition number in same way as mentioned above. But config file name is fixed: /boot/grub/grub.cfg. I used following command to build this image:
Code: Select all
copy /b lnxboot.img+core.img lnxgrub2.bin
Project loadbin contains ldgrub2.bin too but I should check this file first to include it into loadbin-0.1-bin-win32-patched.zip.
Edited. Links deleted.
Re: Trouble booting kernel with Grub legacy
Posted: Fri Feb 07, 2014 2:07 pm
by rajask89
Pardon my ignorance, but what exactly do you guys mean when you say Linux kernel header v2.12 ?
Even I am having the same issues as mentioned above, if any one of you have had any progress, some information would really be appreciated.
Thanks.