From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kXrP7-0001f3-Gq for mharc-grub-devel@gnu.org; Wed, 28 Oct 2020 15:46:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43784) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXrP4-0001de-DP for Grub-devel@gnu.org; Wed, 28 Oct 2020 15:46:38 -0400 Received: from shcp25.hosting.zen.net.uk ([82.71.204.30]:59826) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kXrP1-0003EA-9o for Grub-devel@gnu.org; Wed, 28 Oct 2020 15:46:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=monkeyircd.org; s=default; h=Content-Transfer-Encoding:MIME-Version: Content-Type:Date:Cc:To:Reply-To:From:Subject:Message-ID:Sender:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=KuE51FeW/rftuknfagEbzg+xlbWXKVz+V5GG3ng30zc=; b=jeO0lnAPwPAZ8pp3yIO9W6A+f8 359iL9sAb4itQbe64oR6Sy1MUm2yIZPTaIFeUKIXen9Nt8/bjslLDoS7CpVd6ZSFgzjvP3o1+489d GRY1o0XqQm/IUcj3hF3fnmr596eYVrt+TiITHbkBCpYN2y+wChOtXeMmbTzYZ1b2zkIb4OMIfrQ83 aanQyFbahOq3LrHIsaE92HvTYEyKnC+Km4dyAgK2rwF/1OQiBt9RfAL9z0rf3ss23Whnw5SsQ62DP SMlvdWGKniujgBv+UAHeX3PtU6WRqsobqYhgxzat1T0eTd3yw1E9woPaQtQqno95w+iGSp47VX0X6 ZXMLDQQA==; Received: from [82.69.123.44] (port=45062 helo=zoidberg.local.monkeyircd.org) by shcp25.hosting.zen.net.uk with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1kXrNn-002huq-Ep; Wed, 28 Oct 2020 19:45:20 +0000 Message-ID: <4b23bf36d0a833ff038709ae7c443647976dcd8c.camel@monkeyircd.org> Subject: [PATCH] Enable multiboot2 support on arm64-efi target From: Chris Plant Reply-To: chris@monkeyircd.org To: Grub-devel@gnu.org Cc: chris@monkeyircd.org Date: Wed, 28 Oct 2020 19:45:18 +0000 Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.4-2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - shcp25.hosting.zen.net.uk X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - monkeyircd.org X-Get-Message-Sender-Via: shcp25.hosting.zen.net.uk: authenticated_id: chris@monkeyircd.org X-Authenticated-Sender: shcp25.hosting.zen.net.uk: chris@monkeyircd.org Received-SPF: pass client-ip=82.71.204.30; envelope-from=chris@monkeyircd.org; helo=shcp25.hosting.zen.net.uk X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/28 15:45:20 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Oct 2020 19:46:39 -0000 Hello, As you may have guessed from my musings on the mailing list to date, I've been creating a patch to enable the multiboot2 loader on ARM64/aarch64. Why? I am playing with GNU Mach (not sure why - blame COVID-19) on Raspberry PI. I guess the key driver for why it's interesting to a wider audience came from Krystian Hebel - "MB2 is one of the most commonly used (if not the most common) boot protocols for hobby OSes.", so I propose we should support it on a platform which in it's various guises is very easily available to hobby programmers. As part of this effort, I've also found that definition of "struct multiboot_tag_elf_sections" does not match the multiboot2 specification documentation and does not align the elf sections to a 8 byte boundary. This causes issues on aarch64 as the 64 bit numbers within the elf sections are then misaligned throughout. Although the version of the structure document in the multiboot2 documentation would align it correctly, the grub and reference implemntations do not match the documentation. Hence, I have created a new struct multiboot_tag_elf64_sections which is correctly aligned, and also given the next available tag number. I have prepared an update to the multiboot2 specification to document this, which will follow seperately. This sequence of patches: 01 - Updates multiboot2 definitions to include the new elf64 tag, adds awareness of the ARCHITECTURE_AARCH64 to multiboot2. 02 - Add relocator code for ARM64, based on MIPS code 03 - Adds mmap_ functions on ARM64 to support multiboot loader 04 - Adds aarch64 target to the ifdefs in multiboot loader code 05 - Updates Makefile.core.def to compile the multiboot2 loader on the arm-efi target. I apologise for any inadvertant breach of ettique in the way these patches are presented - I'm a bit new to this text patch process but I've tried my best. Signed-off-by: Chris Plant