Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2354408imm; Thu, 27 Sep 2018 11:23:32 -0700 (PDT) X-Google-Smtp-Source: ACcGV60XjbLSxrqjhPIQj/LnAgmHTn80gNpANOH9FMGtJI2YyOXYAR0NbW5Vqjg812AedmLhVlWZ X-Received: by 2002:a17:902:28e8:: with SMTP id f95-v6mr12222536plb.240.1538072612189; Thu, 27 Sep 2018 11:23:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538072612; cv=none; d=google.com; s=arc-20160816; b=wVCgGJF+GBVOEWdTVULTW1kz3pgEnAGIPc2prbhuDMMYTk4toWdWO4xaVEMnnurvnH dZSlSaIZ/enghiZArtHOB9+4ILlMZ+lX5YhSX6GYUqkG1+CuJKtcQsZwMZjalVnGxCOz D/FvL8pxz1i4WC+LIFcABXDUBzroYfVZhPBBW1tXznNBDXqprA6dnDEszMNTDtZcBPgt b52SoHcORc+u8P3g5hkq/LX7x/lgJh5SYBPQM/Asx/ATq4INIw54tyhUW5igVlDZJPpE hNxsI332HpVlzgijIb9kTzkmaCSmNb8+kb1WZslH0a6AtdkS3dAueKLKCIMtXzjSqSno Cnyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=7rp/5iEndkLZCxZXbT5YYafnRVKH0TTcfePVIV0nnAM=; b=LB/NVJ75M95oCw4DNFVQOolCscp8CO6xX1w67gYwkEwpFcm8KAKFfmQWxAcUpkmv+Z 7dRUfWgDBlwiGjQLTvbbfudRG7V47jC2sQkaaCXFkXvhijHeai6QLqkRzOBUcwfWLYYh IczM+lSH55PJwaQySYA0IFcIzSac09fhw02CjX3AyDT+pZQWNcy69/EVsrcnb5CrsrcP w3IPByKf+UNZQd+Olobw3EZpPn3khPAqK2E8JmVSHjAot7LTUK0gR63vPJWPbzGN161F In21esO08C+C89tmHwrp4KMpNi2aZUl5MDeQzcDgpwOYLI5HsQMOXicxRixgfvB6UEW1 6J2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mqXzeOIV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r25-v6si2666933pga.489.2018.09.27.11.23.14; Thu, 27 Sep 2018 11:23:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mqXzeOIV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728298AbeI1Amj (ORCPT + 99 others); Thu, 27 Sep 2018 20:42:39 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:42616 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727404AbeI1Amj (ORCPT ); Thu, 27 Sep 2018 20:42:39 -0400 Received: by mail-io1-f67.google.com with SMTP id n18-v6so2579652ioa.9 for ; Thu, 27 Sep 2018 11:23:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=7rp/5iEndkLZCxZXbT5YYafnRVKH0TTcfePVIV0nnAM=; b=mqXzeOIV90UIp5wF8L4RhQQtpggJ+OYJgN+2xcGz7zRirxyphxlzs8Q7gDgbt/EHGw Gz1ODh87bLo6OCSh6fGMBn9VgGJEZLUpyccxLMldaMoS/caD/o7e1Nz85T1+XdP96it0 DhugliZVIJyVSpCiQRNXLyynhdj1n9OpdTQeXkb3LE/6YPzIZjsZKmSze/mR+WH/2/cD y13y2MQmFBvDGOVfNvtQLEycCg3rjrWB6EB8YxSW8e9btrJUA9KxDSVWx/+98hL0fXfg QzrAg8o/VFZ3M1W0T2MoLxcxD68v7+gaCcSyXtgpxufo14KRC+36n3gYwKsabn+0bKPL AX6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=7rp/5iEndkLZCxZXbT5YYafnRVKH0TTcfePVIV0nnAM=; b=Bkkd/6lW4tupqtWs3PeHBeaQGEeWR/GU01elxEFrJnc5z9IDha9n0ilCx4p1cqmRF5 rVWb2MUjhWke+NaQRTqN9qZ/YE2v5L5WVwpzY3wxErOmZnR1txpOf3nirq1smC1cYMKF AAu+ESegWqJB3G/TfD/aCt5cvrxt+WBx2TWrpH6IvRZgC+Hm51mGmo5ietaP5riI/EJs 4mvoMvnbeVsbKYBvvrGwLdVg+LcdC7CXj8hcsHmtjAwM6qE10dIR7bnoEaYhCilE2ISU kuEMhFzYT5K/2vxKO6zZh6Weq71ICkWEP+badph6Ffno0nkSb02fDNRJckWYxxQzdvPt qUAA== X-Gm-Message-State: ABuFfoiCGrWRSCi8qdFL97gRx8mnhQl53DCkCcQql4EHFFgpr9vRRN2T VTHS+gYeHo2Qp7zBaQDI8tgCNgBWamdEn39vosECYEA= X-Received: by 2002:a6b:ca85:: with SMTP id a127-v6mr10196340iog.31.1538072587464; Thu, 27 Sep 2018 11:23:07 -0700 (PDT) MIME-Version: 1.0 References: <20180927134117.15371-1-xyproto@archlinux.org> In-Reply-To: <20180927134117.15371-1-xyproto@archlinux.org> From: Brian Gerst Date: Thu, 27 Sep 2018 14:22:55 -0400 Message-ID: Subject: Re: [PATCH] Reduce boot header size with 1 byte To: xyproto@archlinux.org Cc: Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 27, 2018 at 9:42 AM wrote: > > From: Alexander F. R=C3=B8dseth > > 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" ins= tead of "ax". > This saves a byte. > > Signed-off-by: Alexander F. R=C3=B8dseth > --- > 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