All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC] 64-bit boot protocol for Linux x86
@ 2022-05-22  3:49 wei zhang
  0 siblings, 0 replies; 4+ messages in thread
From: wei zhang @ 2022-05-22  3:49 UTC (permalink / raw)
  To: grub-devel

Hi guys,
If I understand the Linux boot correctly, GRUB 2 will drop Linux in a
32-bit protected mode,
using the Linux 32-bit boot protocol.
Since Linux has a 64-bit boot protocol, I'm thinking that we can make
use of that. On x86_64
target, if we can use 64-bit boot protocol, we'll drop Linux in long
mode directly, thus
less code executed in the GRUB side, and less code in Linux side.
Obviously it's cleaner to just use 32-bit protocol to boot both i386
and x86_64 kernel, but this
will not add much complexity.
Just new to this mailing list, am I missing anything?

Wei Zhang


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] 64-bit boot protocol for Linux x86
  2022-05-22  3:24 Wei Zhang
  2022-05-22  4:13 ` Wei Zhang
@ 2022-05-24 15:56 ` Wei Zhang
  1 sibling, 0 replies; 4+ messages in thread
From: Wei Zhang @ 2022-05-24 15:56 UTC (permalink / raw)
  To: The development of GNU GRUB

I already have a working code, and I did three things:
1, Using xloadflags (linux boot protocol 2.12+) to determine whether
it's a 64-bit kernel.
2, Setting up an identity mapped page table for the 64-bit kernel.
3, Using grub_relocator64_boot instead of grub_relocator32_boot to boot.

The main concern here may be that the page table will take up 6 pages,
24KB, and I allocated the space right after the protected kernel. On
most systems 24KB is not an issue, but I'm not one hundred percent
sure.

Wei Zhang

On Sun, May 22, 2022 at 11:56 AM Wei Zhang <zhangweilst@126.com> wrote:
>
> Hi guys,
> If I understand the Linux boot correctly, GRUB 2 will drop Linux in a 32-bit protected mode,
> using the Linux 32-bit boot protocol.
> Since Linux has a 64-bit boot protocol, I'm thinking that we can make use of that. On x86_64
> target, if we can make use of 64-bit boot protocol, we'll drop Linux in long mode directly, thus
> less code executed in the GRUB side, and less code in Linux side.
> Obviously it's cleaner to just use 32-bit protocol to boot both i386 and x86_64 kernel, but this
> will not add much complexity.
> Just new to this mailing list, am I missing anything?
>
> Wei Zhang
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFC] 64-bit boot protocol for Linux x86
  2022-05-22  3:24 Wei Zhang
@ 2022-05-22  4:13 ` Wei Zhang
  2022-05-24 15:56 ` Wei Zhang
  1 sibling, 0 replies; 4+ messages in thread
From: Wei Zhang @ 2022-05-22  4:13 UTC (permalink / raw)
  To: The development of GNU GRUB

Sorry about having sent the message twice, please ignore the previous one.

Wei Zhang

On Sun, May 22, 2022 at 11:56 AM Wei Zhang <zhangweilst@126.com> wrote:
>
> Hi guys,
> If I understand the Linux boot correctly, GRUB 2 will drop Linux in a 32-bit protected mode,
> using the Linux 32-bit boot protocol.
> Since Linux has a 64-bit boot protocol, I'm thinking that we can make use of that. On x86_64
> target, if we can make use of 64-bit boot protocol, we'll drop Linux in long mode directly, thus
> less code executed in the GRUB side, and less code in Linux side.
> Obviously it's cleaner to just use 32-bit protocol to boot both i386 and x86_64 kernel, but this
> will not add much complexity.
> Just new to this mailing list, am I missing anything?
>
> Wei Zhang
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [RFC] 64-bit boot protocol for Linux x86
@ 2022-05-22  3:24 Wei Zhang
  2022-05-22  4:13 ` Wei Zhang
  2022-05-24 15:56 ` Wei Zhang
  0 siblings, 2 replies; 4+ messages in thread
From: Wei Zhang @ 2022-05-22  3:24 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 589 bytes --]

Hi guys,
If I understand the Linux boot correctly, GRUB 2 will drop Linux in a 32-bit protected mode,
using the Linux 32-bit boot protocol.
Since Linux has a 64-bit boot protocol, I'm thinking that we can make use of that. On x86_64
target, if we can make use of 64-bit boot protocol, we'll drop Linux in long mode directly, thus
less code executed in the GRUB side, and less code in Linux side.
Obviously it's cleaner to just use 32-bit protocol to boot both i386 and x86_64 kernel, but this
will not add much complexity.
Just new to this mailing list, am I missing anything? 


Wei Zhang

[-- Attachment #2: Type: text/html, Size: 1021 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-05-24 15:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-22  3:49 [RFC] 64-bit boot protocol for Linux x86 wei zhang
  -- strict thread matches above, loose matches on Subject: below --
2022-05-22  3:24 Wei Zhang
2022-05-22  4:13 ` Wei Zhang
2022-05-24 15:56 ` Wei Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.