grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: contradiction in boot/i386/pc/boot.S


From: Pavel Roskin
Subject: Re: contradiction in boot/i386/pc/boot.S
Date: Tue, 08 Jan 2008 17:57:16 -0500

On Tue, 2008-01-08 at 21:24 +0100, Robert Millan wrote:
> On Tue, Jan 08, 2008 at 01:24:25PM -0500, Pavel Roskin wrote:
> > On Tue, 2008-01-08 at 11:50 +0100, Robert Millan wrote:
> > > boot_drive_check:
> > >         jmp     1f      /* grub-setup may overwrite this jump */
> > >         testb   $0x80, %dl
> > >         jnz     1f
> > >         movb    $0x80, %dl
> > > 1:
> > > 
> > > However, if 0x80 is really "the only possible boot drive", that means the
> > > test is pointless and can be replaced with:
> > 
> > No, I was wrong, I misread "testb" as "cmpb".  Values such as 0x81 are
> > valid and should be preserved.
> 
> Yeah I was going to point that..
> 
> > Please ignore my previous message.
> 
> All of it, or just partly ?

All of it, I'm afraid.

However, it's possible to save 2 bytes if we get rid of the first short
jump and overwrite the whole section (testb, jnz, movb) with NOPs for
the floppies.

We can save 4 more bytes if we do "orb $0x80, %dl" unconditionally for
the hard drives.  However, I'm not sure if there are BIOSes that pass 1
in %dl and how critical it would be if it becomes 0x81.  That's
something I'll rather not do without seeing the original bug reports.

-- 
Regards,
Pavel Roskin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]