Skip to contentSkip to conversation

Boot sector for ext2

DISCUSSION Martin Rosenau 3 participants 4 messages May 21, 2011 – May 23, 2011

lore
Share & tools
lore
#0 lore raw

Hello everyone.

I am new to GRUB development.

I wrote a tool I wish to publish under GPL that may be integrated into GRUB instead of publishing as separate tool:

Background: In a multi-OS-environment it is sometimes not possible installing GRUB on the MBR (Windows Vista has problems then!) Installing GRUB on an ext2 partition (instead of on the MBR) often requires "block lists" which often do not work.

I wrote a boot sector that is capable to search a file on the ext2 partition by file name (not by inode or block number etc...) and load it. Because the entire code is quite small it fits into the boot sector and "block lists" are not required.

This would also allow to use different "core.img" files (e.g. one booting Linux and one booting Memtest) when booting GRUB from a chain loader (e.g Windows' boot menu).

I did not have the possibility to fully test the tool, yet.

Are you interested in integrating this tool into GRUB?

Have a nice weekend.

Martin

#1 lore raw
Quoted 8 lines · Martin Rosenau

I wrote a tool I wish to publish under GPL that may be integrated into GRUB instead of publishing as separate tool:

Background: In a multi-OS-environment it is sometimes not possible installing GRUB on the MBR (Windows Vista has problems then!) Installing GRUB on an ext2 partition (instead of on the MBR) often requires "block lists" which often do not work.

Quoted 8 lines

I wrote a boot sector that is capable to search a file on the ext2 partition by file name (not by inode or block number etc...) and load it. Because the entire code is quite small it fits into the boot sector and "block lists" are not required.

This would also allow to use different "core.img" files (e.g. one booting Linux and one booting Memtest) when booting GRUB from a chain loader (e.g Windows' boot menu).

Hi,

Thanks for your work. However, doesn't this overlap with what the "ntldr-img" GRUB extras module (originally based on part of GRUB4DOS) already does? Its purpose is to be small enough that it can be booted from the Windows boot loader, which may only be able to load 16 sectors; it supports reading a named file from a handful of file systems, including ext2 and NTFS. It's commonly shipped along with GRUB; for example, Debian and Ubuntu ship it.

Admittedly, ntldr-img will not fit into 512 bytes, so if that's what your code does then it does occupy a slightly different space.

Regards,

Signature · 1 line
Colin Watson                                       [[email protected]]
#2 lore raw
In reply to Martin Rosenau
Quoted 9 lines · Martin Rosenau

Background: In a multi-OS-environment it is sometimes not possible installing GRUB on the MBR (Windows Vista has problems then!) Installing GRUB on an ext2 partition (instead of on the MBR) often requires "block lists" which often do not work.

I wrote a boot sector that is capable to search a file on the ext2 partition by file name (not by inode or block number etc...) and load it. Because the entire code is quite small it fits into the boot sector and "block lists" are not required.

I find this very interesting. The two alternatives that exist currently (or, at least, that I know of), namely (a) installing in the MBR (+ the following sectors), or (b) using block-lists, have well-known shortcomings.

With your solution, one could simply write the boot sector in an ext2 partition's boot record, and put GRUB files in the ext2 filesystem. Whatever is in the MBR would then simply chainload the ext2 partition. Is this correct?

Grégoire

#3 lore raw
Quoted 8 lines · Grégoire Sutre

I find this very interesting. The two alternatives that exist currently (or, at least, that I know of), namely (a) installing in the MBR (+ the following sectors), or (b) using block-lists, have well-known shortcomings.

With your solution, one could simply write the boot sector in an ext2 partition's boot record, and put GRUB files in the ext2 filesystem. Whatever is in the MBR would then simply chainload the ext2 partition. Is this correct?

Yes. This is how it should work.

Martin