[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMzpN2iC7-CaxAsgrq-jwujgMYRqPf_5DLihKUHF5F6a1nxabQ@mail.gmail.com>
Date: Thu, 27 Sep 2018 14:22:55 -0400
From: Brian Gerst <brgerst@...il.com>
To: xyproto@...hlinux.org
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Reduce boot header size with 1 byte
On Thu, Sep 27, 2018 at 9:42 AM <xyproto@...hlinux.org> wrote:
>
> From: Alexander F. Rødseth <xyproto@...hlinux.org>
>
> Only ah needs to be set to 0 before calling interrupt 0x16 for waiting
> for a keypress.
>
> This patch changes the line that uses xor so that it only zeroes "ah" instead of "ax".
> This saves a byte.
>
> Signed-off-by: Alexander F. Rødseth <xyproto@...hlinux.org>
> ---
> arch/x86/boot/header.S | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
> index 850b8762e889..905cb96f43d4 100644
> --- a/arch/x86/boot/header.S
> +++ b/arch/x86/boot/header.S
> @@ -71,14 +71,15 @@ msg_loop:
> jmp msg_loop
>
> bs_die:
> - # Allow the user to press a key, then reboot
> - xorw %ax, %ax
> + # Allow the user to press a key
> + xorb %ah, %ah
Because this is code running in 16-bit real mode, xorw does not need a
16-bit prefix and only uses 2 bytes. You save nothing by using xorb.
--
Brian Gerst
Powered by blists - more mailing lists