[RFC] 64-bit boot protocol for Linux x86

2022-05-21 Thread wei zhang
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 lo

[RFC] 64-bit boot protocol for Linux x86

2022-05-21 Thread Wei Zhang
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 L

Re: [RFC] 64-bit boot protocol for Linux x86

2022-05-21 Thread Wei Zhang
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 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 Li

Re: [RFC] 64-bit boot protocol for Linux x86

2022-05-24 Thread Wei Zhang
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 con