[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: possible bug in i386 boot.S floppy probing code
From: |
Vladimir 'φ-coder/phcoder' Serbinenko |
Subject: |
Re: possible bug in i386 boot.S floppy probing code |
Date: |
Sun, 26 Dec 2010 20:49:55 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20101211 Icedove/3.0.11 |
On 10/26/2010 03:08 PM, Mirko Parthey wrote:
> Hello all,
>
> while reading through grub-core/boot/i386/pc/boot.S in the Bazaar version
> of Grub 2, I noticed that the floppy probing code calls
> int $0x13, %ah===$0x02 /* disk read sector */
> without initializing the %es register, and with %bx holding a value
> that was likely meant to go into %es. (boot.S:465)
>
>
You're right patch applied
> My proposed change is included below. The two additional instructions have
> been
> copied from further above in boot.S, where the same BIOS function is
> used correctly. The resulting machine code is enlarged by 4 bytes, but
> apparently still fits within the 512-byte limit.
>
> Please note that I found this by inspection, not by observing undesired
> behaviour. The patch passes "make" and "make check", but I'm not sure if the
> code will actually be exercised by "make check".
> I hope you find it useful.
>
> Mirko
>
> === modified file 'grub-core/boot/i386/pc/boot.S'
> --- grub-core/boot/i386/pc/boot.S 2010-09-19 22:06:45 +0000
> +++ grub-core/boot/i386/pc/boot.S 2010-10-26 09:51:29 +0000
> @@ -459,6 +459,8 @@
> 1:
> /* perform read */
> movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx
> + movw %bx, %es
> + xorw %bx, %bx
> movw $0x201, %ax
> movb $0, %ch
> movb $0, %dh
>
>
> _______________________________________________
> Bug-grub mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-grub
>
>
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
signature.asc
Description: OpenPGP digital signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: possible bug in i386 boot.S floppy probing code,
Vladimir 'φ-coder/phcoder' Serbinenko <=