* Creating grub/grub2/grldr.mbr bootrom with makerom
@ 2007-12-21 18:50 Bean
2007-12-21 19:04 ` Robert Millan
0 siblings, 1 reply; 6+ messages in thread
From: Bean @ 2007-12-21 18:50 UTC (permalink / raw)
To: The development of GRUB 2
makerom is a new tool in the GRUB Utilities project. It can be used to
create bootrom image using grub legacy, grub2 and grldr.mbr.
grub legacy/grub4dos:
makerom rom_xxx.img stage2 grub.bin
grub2:
makerom rom_xxx.img core.img grub2.bin
grldr.mbr:
makerom -s 0 rom_xxx.img grldr.mbr grldr.bin
rom_xxx.img stands for one of the following files:
rom_isa.img: Header for ISA bootrom
rom_pci.img: Header for PCI bootrom
rom_zisa.img: Header for ISA bootrom, support lzma decompression
rom_zpci.img: Header for PCI bootrom, support lzma decompression
To enable lzma, you should use option -z, and choose one of the
headers that supports lzma:
makerom -z rom_zisa.img stage2 grub.bin
As bootrom has 64K size limit, for image larger than 64K, you must use
compression. For example, the uncompressed stage2 for grub 0.97 is
98K, after compression, image reduced to about 50K.
Also note that compression is performed by external lzma program, you
need to install the lzma package before using the compression
function.
To test the bootrom in qemu:
qemu -option-rom grub.bin ...
Other options supported by makerom:
-m message
The message to display.
-t timeout
Timeout in seconds, default value is 2.
-k key
Hot key, default value SPACE.
-d edx
The value of %edx registry, default value 0.
-s skip
Number of bytes to skip at the beginning of input file, default value
512, which is correct for stage2 and core.img. For grldr.mbr, you
should set this value to 0.
-z
Use lzma to compress input file.
-p parm
Extra options for lzma, it can be used to adjust compression ratio.
The program to invoke is lzma in windows, and lzma_alone in Linux. The
default command line is:
lzma_alone e -si -so
-v
Show verbose information.
You can download source code and windows binaries at:
http://download.gna.org/grubutil/
--
Bean
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Creating grub/grub2/grldr.mbr bootrom with makerom
2007-12-21 18:50 Creating grub/grub2/grldr.mbr bootrom with makerom Bean
@ 2007-12-21 19:04 ` Robert Millan
2007-12-22 3:57 ` Bean
2007-12-22 8:06 ` Yoshinori K. Okuji
0 siblings, 2 replies; 6+ messages in thread
From: Robert Millan @ 2007-12-21 19:04 UTC (permalink / raw)
To: The development of GRUB 2
On Sat, Dec 22, 2007 at 02:50:11AM +0800, Bean wrote:
> makerom is a new tool in the GRUB Utilities project. It can be used to
> create bootrom image using grub legacy, grub2 and grldr.mbr.
>
> grub legacy/grub4dos:
> makerom rom_xxx.img stage2 grub.bin
>
> grub2:
> makerom rom_xxx.img core.img grub2.bin
>
> grldr.mbr:
> makerom -s 0 rom_xxx.img grldr.mbr grldr.bin
>
> rom_xxx.img stands for one of the following files:
>
> rom_isa.img: Header for ISA bootrom
> rom_pci.img: Header for PCI bootrom
> rom_zisa.img: Header for ISA bootrom, support lzma decompression
> rom_zpci.img: Header for PCI bootrom, support lzma decompression
>
> To enable lzma, you should use option -z, and choose one of the
> headers that supports lzma:
>
> makerom -z rom_zisa.img stage2 grub.bin
>
> As bootrom has 64K size limit, for image larger than 64K, you must use
> compression. For example, the uncompressed stage2 for grub 0.97 is
> 98K, after compression, image reduced to about 50K.
>
> Also note that compression is performed by external lzma program, you
> need to install the lzma package before using the compression
> function.
How well does compression work for GRUB 2 ? core.img is already compressed
(with lzo); if LZMA makes better results perhaps it'd be a good idea to switch.
--
Robert Millan
<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Creating grub/grub2/grldr.mbr bootrom with makerom
2007-12-21 19:04 ` Robert Millan
@ 2007-12-22 3:57 ` Bean
2007-12-22 8:06 ` Yoshinori K. Okuji
1 sibling, 0 replies; 6+ messages in thread
From: Bean @ 2007-12-22 3:57 UTC (permalink / raw)
To: The development of GRUB 2
On Dec 22, 2007 3:04 AM, Robert Millan <rmh@aybabtu.com> wrote:
> How well does compression work for GRUB 2 ? core.img is already compressed
> (with lzo); if LZMA makes better results perhaps it'd be a good idea to switch.
in fact, lzma is must better than lzo, a simple test with stage2 from grub 0.97:
original: 99834
lzo : 70945
lzo -9 : 60546
lzma: 51402
For compressed image core.img:
original: 65045
lzma: 60087
--
Bean
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Creating grub/grub2/grldr.mbr bootrom with makerom
2007-12-21 19:04 ` Robert Millan
2007-12-22 3:57 ` Bean
@ 2007-12-22 8:06 ` Yoshinori K. Okuji
2007-12-22 9:03 ` Bean
1 sibling, 1 reply; 6+ messages in thread
From: Yoshinori K. Okuji @ 2007-12-22 8:06 UTC (permalink / raw)
To: The development of GRUB 2
On Friday 21 December 2007 20:04, Robert Millan wrote:
> How well does compression work for GRUB 2 ? core.img is already compressed
> (with lzo); if LZMA makes better results perhaps it'd be a good idea to
> switch.
It's not that simple. LZO was chosen instead of gzip, because of the size
requirement on PC. To preserve safety, we need to keep the core part less
than 31.5KB (63 sectors).
The size is the sum of non-compressable bootstrap code, decompression code and
compressed code + data. When I made an experiment in PUPA, although gzip had
a better compression ratio, due to the decompression code size, LZO won.
I don't know precisely, but I suspect that decompression code for LZMA would
be slightly larger than gzip's (IIRC, a range coder is likely to require more
code and data). So I don't expect that LZMA can replace the current usage of
LZO in normal PC so easily.
Okuji
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Creating grub/grub2/grldr.mbr bootrom with makerom
2007-12-22 8:06 ` Yoshinori K. Okuji
@ 2007-12-22 9:03 ` Bean
2007-12-22 9:47 ` Yoshinori K. Okuji
0 siblings, 1 reply; 6+ messages in thread
From: Bean @ 2007-12-22 9:03 UTC (permalink / raw)
To: The development of GRUB 2
On Dec 22, 2007 4:06 PM, Yoshinori K. Okuji <okuji@enbug.org> wrote:
> On Friday 21 December 2007 20:04, Robert Millan wrote:
> > How well does compression work for GRUB 2 ? core.img is already compressed
> > (with lzo); if LZMA makes better results perhaps it'd be a good idea to
> > switch.
>
> It's not that simple. LZO was chosen instead of gzip, because of the size
> requirement on PC. To preserve safety, we need to keep the core part less
> than 31.5KB (63 sectors).
>
> The size is the sum of non-compressable bootstrap code, decompression code and
> compressed code + data. When I made an experiment in PUPA, although gzip had
> a better compression ratio, due to the decompression code size, LZO won.
>
> I don't know precisely, but I suspect that decompression code for LZMA would
> be slightly larger than gzip's (IIRC, a range coder is likely to require more
> code and data). So I don't expect that LZMA can replace the current usage of
> LZO in normal PC so easily.
The decompression code for LZMA is very small, i use -Os option to
compile LzmaDecode.c, the result is about 2.8K.
--
Bean
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Creating grub/grub2/grldr.mbr bootrom with makerom
2007-12-22 9:03 ` Bean
@ 2007-12-22 9:47 ` Yoshinori K. Okuji
0 siblings, 0 replies; 6+ messages in thread
From: Yoshinori K. Okuji @ 2007-12-22 9:47 UTC (permalink / raw)
To: The development of GRUB 2
On Saturday 22 December 2007 10:03, Bean wrote:
> On Dec 22, 2007 4:06 PM, Yoshinori K. Okuji <okuji@enbug.org> wrote:
> > On Friday 21 December 2007 20:04, Robert Millan wrote:
> > > How well does compression work for GRUB 2 ? core.img is already
> > > compressed (with lzo); if LZMA makes better results perhaps it'd be a
> > > good idea to switch.
> >
> > It's not that simple. LZO was chosen instead of gzip, because of the size
> > requirement on PC. To preserve safety, we need to keep the core part less
> > than 31.5KB (63 sectors).
> >
> > The size is the sum of non-compressable bootstrap code, decompression
> > code and compressed code + data. When I made an experiment in PUPA,
> > although gzip had a better compression ratio, due to the decompression
> > code size, LZO won.
> >
> > I don't know precisely, but I suspect that decompression code for LZMA
> > would be slightly larger than gzip's (IIRC, a range coder is likely to
> > require more code and data). So I don't expect that LZMA can replace the
> > current usage of LZO in normal PC so easily.
>
> The decompression code for LZMA is very small, i use -Os option to
> compile LzmaDecode.c, the result is about 2.8K.
Thank you for your information. In my estimate, LZMA will outperform, if the
ratio, compressed size : original size, is less than 0.52. So LZMA might
win. :)
Okuji
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-12-22 9:47 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-21 18:50 Creating grub/grub2/grldr.mbr bootrom with makerom Bean
2007-12-21 19:04 ` Robert Millan
2007-12-22 3:57 ` Bean
2007-12-22 8:06 ` Yoshinori K. Okuji
2007-12-22 9:03 ` Bean
2007-12-22 9:47 ` Yoshinori K. Okuji
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.