From: "Vladimir 'phcoder' Serbinenko" <phcoder@gmail.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: [PATCH 01/01] loader/bsd: Add missing zeros
Date: Sun, 8 Oct 2023 16:33:19 +0200 [thread overview]
Message-ID: <CAEaD8JNf5rv9zwsmnObOBAw67RC+iLuvLajVR7mddC93-AWgiA@mail.gmail.com> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1 bytes --]
[-- Attachment #1.2: Type: text/html, Size: 23 bytes --]
[-- Attachment #2: 0001-loader-bsd-Add-missing-zeros.patch --]
[-- Type: text/x-diff, Size: 1337 bytes --]
From 1be6ed3500b24ef7327ab2ea99c23488102a977b Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phcoder@gmail.com>
Date: Mon, 10 Jul 2023 13:05:21 +0200
Subject: [PATCH 01/01] loader/bsd: Add missing zeros
kern_end is 64-bit and so we need to add this additional zero.
entry is unused and is explicitly zero in own FreeBSD bootloader
Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
---
grub-core/loader/i386/bsd.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c
index 58b976861..ce9d8f4e3 100644
--- a/grub-core/loader/i386/bsd.c
+++ b/grub-core/loader/i386/bsd.c
@@ -896,7 +896,7 @@ grub_freebsd_boot (void)
err = grub_relocator_alloc_chunk_align (relocator, &ch,
0x10000, 0x90000,
- (is_64bit ? 3 : 9) * sizeof (grub_uint32_t)
+ (is_64bit ? 4 : 9) * sizeof (grub_uint32_t)
+ sizeof (bi), 4,
GRUB_RELOCATOR_PREFERENCE_NONE,
0);
@@ -956,9 +956,10 @@ grub_freebsd_boot (void)
state.rsp = stack_target;
state.rip = (((grub_uint64_t) entry_hi) << 32) | entry;
- stack[0] = entry;
+ stack[0] = 0;
stack[1] = bi.tags;
stack[2] = kern_end;
+ stack[3] = 0;
return grub_relocator64_boot (relocator, state, 0, 0x40000000);
}
else
--
2.42.0
[-- Attachment #3: Type: text/plain, Size: 141 bytes --]
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
reply other threads:[~2023-10-08 14:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEaD8JNf5rv9zwsmnObOBAw67RC+iLuvLajVR7mddC93-AWgiA@mail.gmail.com \
--to=phcoder@gmail.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).